diff options
author | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-21 16:55:30 +0000 |
---|---|---|
committer | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-21 16:55:30 +0000 |
commit | ef37dee71f9fc34316c46f7cc286908b01051581 (patch) | |
tree | f7b49502cbd1111a96b3d87be294bad8c172e6a0 /ash/wm/app_list_controller.cc | |
parent | 7648159bf98111b96ed13092d2af4f7670add8cc (diff) | |
download | chromium_src-ef37dee71f9fc34316c46f7cc286908b01051581.zip chromium_src-ef37dee71f9fc34316c46f7cc286908b01051581.tar.gz chromium_src-ef37dee71f9fc34316c46f7cc286908b01051581.tar.bz2 |
cros: Fix app list bubble over-scroll at wrong position with hidden launcher.
This is because cached bubble bounds |view_bounds_| at bubble creation time
might not be correct when launcher is hidden and the bubble moves when launcher
shows up. The fix is to defer getting the bubble location until first
over-scroll movement.
BUG=150851
TEST=Verify app list bubble at expected location when over-scrolling with hidden launcher.
R=sky@chromium.org
Review URL: https://codereview.chromium.org/10967021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@158007 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/wm/app_list_controller.cc')
-rw-r--r-- | ash/wm/app_list_controller.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ash/wm/app_list_controller.cc b/ash/wm/app_list_controller.cc index f6f9cdd..438bef0a 100644 --- a/ash/wm/app_list_controller.cc +++ b/ash/wm/app_list_controller.cc @@ -190,7 +190,6 @@ void AppListController::ScheduleAnimation() { gfx::Rect target_bounds; if (is_visible_) { target_bounds = layer->bounds(); - view_bounds_ = target_bounds; layer->SetBounds(OffsetTowardsShelf(layer->bounds())); } else { target_bounds = OffsetTowardsShelf(layer->bounds()); @@ -230,10 +229,8 @@ void AppListController::ProcessLocatedEvent(aura::Window* target, } void AppListController::UpdateBounds() { - if (view_ && is_visible_) { + if (view_ && is_visible_) view_->UpdateBounds(); - view_bounds_ = view_->GetWidget()->GetNativeView()->bounds(); - } } //////////////////////////////////////////////////////////////////////////////// @@ -339,6 +336,10 @@ void AppListController::TransitionChanged() { return; if (!pagination_model_->IsRevertingCurrentTransition()) { + // Update cached |view_bounds_| before the first over-scroll move. + if (!should_snap_back_) + view_bounds_ = view_->GetWidget()->GetNativeView()->bounds(); + const int current_page = pagination_model_->selected_page(); const int dir = transition.target_page > current_page ? -1 : 1; |