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

Unified Diff: ash/wm/shelf_layout_manager.h

Issue 9222018: reland -- Disable animations during aura tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address reviewer comments. Created 8 years, 11 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: ash/wm/shelf_layout_manager.h
diff --git a/ash/wm/shelf_layout_manager.h b/ash/wm/shelf_layout_manager.h
index 3c35389d0589ea02316e3bbfc836f95626e407df..5f30e79f241f23c4f7fa1432a2402ff362e5a275 100644
--- a/ash/wm/shelf_layout_manager.h
+++ b/ash/wm/shelf_layout_manager.h
@@ -8,9 +8,10 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.h"
#include "ui/aura/layout_manager.h"
#include "ash/ash_export.h"
-#include "ui/gfx/compositor/layer_animation_observer.h"
+#include "ash/wm/shelf_animation_observer_client.h"
#include "ui/gfx/insets.h"
#include "ui/gfx/rect.h"
@@ -28,7 +29,7 @@ namespace internal {
// To respond to bounds changes in the status area StatusAreaLayoutManager works
// closely with ShelfLayoutManager.
class ASH_EXPORT ShelfLayoutManager : public aura::LayoutManager,
- public ui::LayerAnimationObserver {
+ public ShelfAnimationObserverClient {
public:
ShelfLayoutManager(views::Widget* launcher, views::Widget* status);
virtual ~ShelfLayoutManager();
@@ -41,7 +42,7 @@ class ASH_EXPORT ShelfLayoutManager : public aura::LayoutManager,
// Sets the visibility of the shelf to |visible|.
void SetVisible(bool visible);
- bool visible() const { return animating_ ? !visible_ : visible_; }
+ bool visible() const { return visible_; }
views::Widget* launcher() { return launcher_; }
views::Widget* status() { return status_; }
@@ -74,19 +75,13 @@ class ASH_EXPORT ShelfLayoutManager : public aura::LayoutManager,
// Animates |widget| to the specified bounds and opacity.
void AnimateWidgetTo(views::Widget* widget,
+ ui::ImplicitAnimationObserver* observer,
const gfx::Rect& target_bounds,
float target_opacity);
- // LayerAnimationObserver overrides:
- virtual void OnLayerAnimationEnded(
- const ui::LayerAnimationSequence* sequence) OVERRIDE;
- virtual void OnLayerAnimationAborted(
- const ui::LayerAnimationSequence* sequence) OVERRIDE {}
- virtual void OnLayerAnimationScheduled(
- const ui::LayerAnimationSequence* sequence) OVERRIDE {}
-
- // Are we animating?
- bool animating_;
+ // ShelfAnimationObserverClient overrides:
+ virtual void OnShelfAnimationsCompleted(
+ ui::ImplicitAnimationObserver*) OVERRIDE;
// True when inside LayoutShelf method. Used to prevent calling LayoutShelf
// again from SetChildBounds().
@@ -99,6 +94,11 @@ class ASH_EXPORT ShelfLayoutManager : public aura::LayoutManager,
// Max height needed.
int max_height_;
+ // The live observers. When the manager is destroyed, they are
+ // removed and deleted. The shelf layout manager owns the observers.
+ scoped_ptr<ui::ImplicitAnimationObserver> launcher_animation_observer_;
+ scoped_ptr<ui::ImplicitAnimationObserver> status_animation_observer_;
+
views::Widget* launcher_;
views::Widget* status_;

Powered by Google App Engine
This is Rietveld 408576698