1234567891011121314151617181920212223242526272829303132333435 |
- // Copyright 2014 The Chromium Authors. All rights reserved.
- // Use of this source code is governed by a BSD-style license that can be
- // found in the LICENSE file.
- #ifndef UI_COMPOSITOR_CLOSURE_ANIMATION_OBSERVER_H_
- #define UI_COMPOSITOR_CLOSURE_ANIMATION_OBSERVER_H_
- #include "base/callback.h"
- #include "ui/compositor/compositor_export.h"
- #include "ui/compositor/layer_animation_observer.h"
- namespace ui {
- // Runs a callback at the end of the animation. This observe also destroys
- // itself afterwards.
- class COMPOSITOR_EXPORT ClosureAnimationObserver
- : public ImplicitAnimationObserver {
- public:
- explicit ClosureAnimationObserver(base::OnceClosure closure);
- ClosureAnimationObserver(const ClosureAnimationObserver&) = delete;
- ClosureAnimationObserver& operator=(const ClosureAnimationObserver&) = delete;
- private:
- ~ClosureAnimationObserver() override;
- // ImplicitAnimationObserver:
- void OnImplicitAnimationsCompleted() override;
- base::OnceClosure closure_;
- };
- } // namespace ui
- #endif // UI_COMPOSITOR_CLOSURE_ANIMATION_OBSERVER_H_
|