Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1719)

Unified Diff: ui/gfx/compositor/test_layer_animation_observer.h

Issue 8395046: Allows observers to be notified when layer animations complete. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address reviewer comments. Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/gfx/compositor/test_layer_animation_observer.h
diff --git a/ui/gfx/compositor/test_layer_animation_observer.h b/ui/gfx/compositor/test_layer_animation_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..879c74ba7af7803f40f485bf4a94eb40a19dce8c
--- /dev/null
+++ b/ui/gfx/compositor/test_layer_animation_observer.h
@@ -0,0 +1,57 @@
+// Copyright (c) 2011 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_GFX_COMPOSITOR_TEST_LAYER_ANIMATION_OBSERVER_
+#define UI_GFX_COMPOSITOR_TEST_LAYER_ANIMATION_OBSERVER_
+#pragma once
+
+#include "base/compiler_specific.h"
+#include "ui/gfx/compositor/compositor_export.h"
+#include "ui/gfx/compositor/layer_animation_observer.h"
+
+namespace ui {
+
+class LayerAnimationSequence;
+
+// Listens to animation ended notifications. Remembers the last sequence that
+// it was notified about.
+class COMPOSITOR_EXPORT TestLayerAnimationObserver
+ : public LayerAnimationObserver {
+ public:
+ TestLayerAnimationObserver();
+ virtual ~TestLayerAnimationObserver();
+
+ virtual void OnLayerAnimationEnded(
+ const LayerAnimationSequence* sequence) OVERRIDE;
+
+ virtual void OnLayerAnimationAborted(
+ const LayerAnimationSequence* sequence) OVERRIDE;
+
+ virtual void OnLayerAnimationScheduled(
+ const LayerAnimationSequence* sequence) OVERRIDE;
+
sky 2011/10/28 22:11:38 nit: remove line.
+
+ const LayerAnimationSequence* last_ended_sequence() const {
+ return last_ended_sequence_;
+ }
+
+ const LayerAnimationSequence* last_scheduled_sequence() const {
+ return last_scheduled_sequence_;
+ }
+
+ const LayerAnimationSequence* last_aborted_sequence() const {
+ return last_aborted_sequence_;
+ }
+
+ private:
+ const LayerAnimationSequence* last_ended_sequence_;
+ const LayerAnimationSequence* last_scheduled_sequence_;
+ const LayerAnimationSequence* last_aborted_sequence_;
+
+ // Copy and assign are allowed.
+};
+
+} // namespace ui
+
+#endif // UI_GFX_COMPOSITOR_TEST_LAYER_ANIMATION_OBSERVER_

Powered by Google App Engine
This is Rietveld 408576698