From 15cc6bedb9143afb15db0e6d5435a60244467b62 Mon Sep 17 00:00:00 2001 From: "simonhong@chromium.org" Date: Tue, 26 Nov 2013 23:24:17 +0000 Subject: [ash] Cannot re-insert an item in the scrolled OverflowBubble Problem: Origin of DragInsertBounds is calculated by using ShelfView. When scroll is occurred to last item, the origin of ShelfView in OverflowBubble is different from OverflowBubble's. R=jamescook@chromium.org BUG=322389 TEST=ash_unittests --gtest_filter=ShelfViewTest.CheckDragInsertBoundsOfScrolledOverflowBubble Review URL: https://codereview.chromium.org/82793003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237432 0039d316-1c4b-4281-b951-d872f2087c98 --- ash/shelf/shelf_view.cc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'ash/shelf/shelf_view.cc') diff --git a/ash/shelf/shelf_view.cc b/ash/shelf/shelf_view.cc index 87316fb..7fc5ec6 100644 --- a/ash/shelf/shelf_view.cc +++ b/ash/shelf/shelf_view.cc @@ -17,6 +17,7 @@ #include "ash/shelf/alternate_app_list_button.h" #include "ash/shelf/app_list_button.h" #include "ash/shelf/overflow_bubble.h" +#include "ash/shelf/overflow_bubble_view.h" #include "ash/shelf/overflow_button.h" #include "ash/shelf/shelf_button.h" #include "ash/shelf/shelf_icon_observer.h" @@ -1341,7 +1342,8 @@ gfx::Rect ShelfView::GetBoundsForDragInsertInScreen() { gfx::Size preferred_size; if (is_overflow_mode()) { DCHECK(owner_overflow_bubble_); - gfx::Rect bubble_bounds = owner_overflow_bubble_->GetBubbleBounds(); + gfx::Rect bubble_bounds = + owner_overflow_bubble_->bubble_view()->GetBubbleBounds(); preferred_size = bubble_bounds.size(); } else { const int preferred_shelf_size = layout_manager_->GetPreferredShelfSize(); @@ -1365,7 +1367,16 @@ gfx::Rect ShelfView::GetBoundsForDragInsertInScreen() { } } gfx::Point origin(GetMirroredXWithWidthInView(0, preferred_size.width()), 0); - ConvertPointToScreen(this, &origin); + + // In overflow mode, we should use OverflowBubbleView as a source for + // converting |origin| to screen coordinates. When a scroll operation is + // occurred in OverflowBubble, the bounds of ShelfView in OverflowBubble can + // be changed. + if (is_overflow_mode()) + ConvertPointToScreen(owner_overflow_bubble_->bubble_view(), &origin); + else + ConvertPointToScreen(this, &origin); + return gfx::Rect(origin, preferred_size); } -- cgit v1.1