closure_animation_observer.cc revision 6e8cce623b6e4fe0c9e4af605d675dd9d0338c38
1// Copyright 2014 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "ui/compositor/closure_animation_observer.h"
6
7namespace ui {
8
9ClosureAnimationObserver::ClosureAnimationObserver(const base::Closure& closure)
10    : closure_(closure) {
11  DCHECK(!closure_.is_null());
12}
13
14ClosureAnimationObserver::~ClosureAnimationObserver() {
15}
16
17void ClosureAnimationObserver::OnImplicitAnimationsCompleted() {
18  closure_.Run();
19  delete this;
20}
21
22}  // namespace ui
23