blob: 60b13415590851e199625eec2e2e84f2672730fc [file] [log] [blame]
// 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 "base/macros.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);
private:
~ClosureAnimationObserver() override;
// ImplicitAnimationObserver:
void OnImplicitAnimationsCompleted() override;
base::OnceClosure closure_;
DISALLOW_COPY_AND_ASSIGN(ClosureAnimationObserver);
};
} // namespace ui
#endif // UI_COMPOSITOR_CLOSURE_ANIMATION_OBSERVER_H_