summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjonross@chromium.org <jonross@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-24 21:51:40 +0000
committerjonross@chromium.org <jonross@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-24 21:51:40 +0000
commitcc7508e05577ef53e15d51ea1507820124218ad7 (patch)
tree31de92b046eca72457da1cf7c7a6b8ab6a3f456d
parent0d3dee92d84477d96a3a138925ee1a097ce1b0e4 (diff)
downloadchromium_src-cc7508e05577ef53e15d51ea1507820124218ad7.zip
chromium_src-cc7508e05577ef53e15d51ea1507820124218ad7.tar.gz
chromium_src-cc7508e05577ef53e15d51ea1507820124218ad7.tar.bz2
Status Area disappears during Multi-User Sign-in
Update StatusAreaLayoutManager to acccount for animations when it is updating its bounds. TEST=ShelfLayoutManagerTest.ShelfAutoHideToggleDuringAnimationUpdatesBounds BUG=386069 Review URL: https://codereview.chromium.org/343193007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@279504 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--ash/shelf/shelf_layout_manager_unittest.cc20
-rw-r--r--ash/wm/status_area_layout_manager.cc6
2 files changed, 23 insertions, 3 deletions
diff --git a/ash/shelf/shelf_layout_manager_unittest.cc b/ash/shelf/shelf_layout_manager_unittest.cc
index de47fa9..d5670a2 100644
--- a/ash/shelf/shelf_layout_manager_unittest.cc
+++ b/ash/shelf/shelf_layout_manager_unittest.cc
@@ -2056,4 +2056,24 @@ TEST_F(ShelfLayoutManagerTest, MaximizeModeResetsAutohide) {
EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_NEVER, shelf->auto_hide_behavior());
}
+// Tests that when the auto-hide behaviour is changed during an animation the
+// target bounds are updated to reflect the new state.
+TEST_F(ShelfLayoutManagerTest,
+ ShelfAutoHideToggleDuringAnimationUpdatesBounds) {
+ ShelfLayoutManager* shelf_manager = GetShelfLayoutManager();
+ aura::Window* status_window = GetShelfWidget()->status_area_widget()->
+ GetNativeView();
+ gfx::Rect initial_bounds = status_window->bounds();
+
+ ui::ScopedAnimationDurationScaleMode regular_animations(
+ ui::ScopedAnimationDurationScaleMode::SLOW_DURATION);
+ shelf_manager->SetAutoHideBehavior(SHELF_AUTO_HIDE_ALWAYS_HIDDEN);
+ gfx::Rect hide_target_bounds = status_window->GetTargetBounds();
+ EXPECT_GT(hide_target_bounds.y(), initial_bounds.y());
+
+ shelf_manager->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
+ gfx::Rect reshow_target_bounds = status_window->GetTargetBounds();
+ EXPECT_EQ(initial_bounds, reshow_target_bounds);
+}
+
} // namespace ash
diff --git a/ash/wm/status_area_layout_manager.cc b/ash/wm/status_area_layout_manager.cc
index a1bf98e..a93f102 100644
--- a/ash/wm/status_area_layout_manager.cc
+++ b/ash/wm/status_area_layout_manager.cc
@@ -55,9 +55,9 @@ void StatusAreaLayoutManager::SetChildBounds(
return;
}
- // If the size matches, no need to do anything. We don't check the location as
- // that is managed by the shelf.
- if (requested_bounds == child->bounds())
+ // If the bounds match, no need to do anything. Check for target bounds to
+ // ensure any active animation is retargeted.
+ if (requested_bounds == child->GetTargetBounds())
return;
SetChildBoundsDirect(child, requested_bounds);