Skip to content

Commit

Permalink
Status Area disappears during Multi-User Sign-in
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jonross@chromium.org committed Jun 24, 2014
1 parent 0d3dee9 commit cc7508e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
20 changes: 20 additions & 0 deletions ash/shelf/shelf_layout_manager_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions ash/wm/status_area_layout_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit cc7508e

Please sign in to comment.