summaryrefslogtreecommitdiffstats
path: root/ash/shelf/shelf_view.cc
diff options
context:
space:
mode:
authorsimonhong@chromium.org <simonhong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-26 23:24:17 +0000
committersimonhong@chromium.org <simonhong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-26 23:24:17 +0000
commit15cc6bedb9143afb15db0e6d5435a60244467b62 (patch)
tree3ade7d16049dabac02c2b7d012dde93d5c7c2711 /ash/shelf/shelf_view.cc
parent6f742dd07eaf78c0defb248e487a53480b1971e1 (diff)
downloadchromium_src-15cc6bedb9143afb15db0e6d5435a60244467b62.zip
chromium_src-15cc6bedb9143afb15db0e6d5435a60244467b62.tar.gz
chromium_src-15cc6bedb9143afb15db0e6d5435a60244467b62.tar.bz2
[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
Diffstat (limited to 'ash/shelf/shelf_view.cc')
-rw-r--r--ash/shelf/shelf_view.cc15
1 files changed, 13 insertions, 2 deletions
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);
}