16e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)// Copyright 2014 The Chromium Authors. All rights reserved.
26e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
36e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)// found in the LICENSE file.
46e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
56e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)#ifndef UI_COMPOSITOR_CLOSURE_ANIMATION_OBSERVER_H_
66e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)#define UI_COMPOSITOR_CLOSURE_ANIMATION_OBSERVER_H_
76e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
86e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)#include "base/callback.h"
96e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)#include "base/macros.h"
106e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)#include "ui/compositor/compositor_export.h"
116e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)#include "ui/compositor/layer_animation_observer.h"
126e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
136e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)namespace ui {
146e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
156e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)// Runs a callback at the end of the animation. This observe also destroys
166e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)// itself afterwards.
176e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)class COMPOSITOR_EXPORT ClosureAnimationObserver
186e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    : public ImplicitAnimationObserver {
196e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) public:
206e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  explicit ClosureAnimationObserver(const base::Closure& closure);
216e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
226e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) private:
236e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  virtual ~ClosureAnimationObserver();
246e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
256e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  // ImplicitAnimationObserver:
266e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  virtual void OnImplicitAnimationsCompleted() OVERRIDE;
276e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
286e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  const base::Closure closure_;
296e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
306e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  DISALLOW_COPY_AND_ASSIGN(ClosureAnimationObserver);
316e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)};
326e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
336e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)}  // namespace ui
346e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
356e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)#endif  // UI_COMPOSITOR_CLOSURE_ANIMATION_OBSERVER_H_
36