summaryrefslogtreecommitdiffstats
path: root/ash/wm/shelf_layout_manager.h
diff options
context:
space:
mode:
authorvollick@google.com <vollick@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-01 20:31:15 +0000
committervollick@google.com <vollick@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-01 20:31:15 +0000
commit7482542213d768c50ea506fdb56b3442cfa3c8aa (patch)
tree1029af22ed076aefb784ef0643bfab42af547465 /ash/wm/shelf_layout_manager.h
parentdfce15bcdfd22b6d9eb60c9741932d9c917b3bcc (diff)
downloadchromium_src-7482542213d768c50ea506fdb56b3442cfa3c8aa.zip
chromium_src-7482542213d768c50ea506fdb56b3442cfa3c8aa.tar.gz
chromium_src-7482542213d768c50ea506fdb56b3442cfa3c8aa.tar.bz2
Revert 120092 - Reland 120074 -- Disable animations during aura tests.
This causes all animations scheduled during a test to complete immediately. After making this change, I noticed some code assumed that animations would not complete synchronously. Some of this code used animation observers, and I while fixing the code I have updated it to use the preferred ImplicitAnimationObserver. BUG=None TEST=aura_shell_unittests,aura_unittests,compositor_unittests Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=120074 Review URL: https://chromiumcodereview.appspot.com/9222018 TBR=vollick@google.com Review URL: https://chromiumcodereview.appspot.com/9320018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120097 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/wm/shelf_layout_manager.h')
-rw-r--r--ash/wm/shelf_layout_manager.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/ash/wm/shelf_layout_manager.h b/ash/wm/shelf_layout_manager.h
index 8d69cc6..3c35389 100644
--- a/ash/wm/shelf_layout_manager.h
+++ b/ash/wm/shelf_layout_manager.h
@@ -28,7 +28,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::ImplicitAnimationObserver {
+ public ui::LayerAnimationObserver {
public:
ShelfLayoutManager(views::Widget* launcher, views::Widget* status);
virtual ~ShelfLayoutManager();
@@ -41,7 +41,7 @@ class ASH_EXPORT ShelfLayoutManager : public aura::LayoutManager,
// Sets the visibility of the shelf to |visible|.
void SetVisible(bool visible);
- bool visible() const { return visible_; }
+ bool visible() const { return animating_ ? !visible_ : visible_; }
views::Widget* launcher() { return launcher_; }
views::Widget* status() { return status_; }
@@ -72,8 +72,21 @@ class ASH_EXPORT ShelfLayoutManager : public aura::LayoutManager,
void CalculateTargetBounds(bool visible,
TargetBounds* target_bounds);
- // Implementation of ImplicitAnimationObserver
- virtual void OnImplicitAnimationsCompleted() OVERRIDE;
+ // Animates |widget| to the specified bounds and opacity.
+ void AnimateWidgetTo(views::Widget* widget,
+ 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_;
// True when inside LayoutShelf method. Used to prevent calling LayoutShelf
// again from SetChildBounds().