diff options
author | simonhong@chromium.org <simonhong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-28 03:50:52 +0000 |
---|---|---|
committer | simonhong@chromium.org <simonhong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-28 03:50:52 +0000 |
commit | 49d3af3e1ce6d70c0faa839f3c9d69fd24157355 (patch) | |
tree | 4bce2b99acfb9c9a394925af9038db62662d465a /ui/app_list | |
parent | eaa2b1da4924420f5f83c88f990a62f2ddb509b0 (diff) | |
download | chromium_src-49d3af3e1ce6d70c0faa839f3c9d69fd24157355.zip chromium_src-49d3af3e1ce6d70c0faa839f3c9d69fd24157355.tar.gz chromium_src-49d3af3e1ce6d70c0faa839f3c9d69fd24157355.tar.bz2 |
[ash] drag and drop from app list to shelf is not working in secondary monitor.
Problem:
Callers of ApplicationDragAndDropHost method in ShelfView and AppsGridView
uses root window coordinate.
R=skuhne@chromium.org, benwells@chromium.org, jamescook@chromium.org
BUG=319826
TEST=browser_tests --gtest_filter=LauncherAppBrowserTestWithMultiMonitor.BasicDragAndDrop
Review URL: https://codereview.chromium.org/68263026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237668 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/app_list')
-rw-r--r-- | ui/app_list/views/apps_grid_view.cc | 13 | ||||
-rw-r--r-- | ui/app_list/views/apps_grid_view.h | 3 |
2 files changed, 10 insertions, 6 deletions
diff --git a/ui/app_list/views/apps_grid_view.cc b/ui/app_list/views/apps_grid_view.cc index d6f0a81..a2cba7d 100644 --- a/ui/app_list/views/apps_grid_view.cc +++ b/ui/app_list/views/apps_grid_view.cc @@ -512,9 +512,11 @@ void AppsGridView::UpdateDragFromItem(Pointer pointer, // If a drag and drop host is provided, see if the drag operation needs to be // forwarded. - DispatchDragEventToDragAndDropHost(event.root_location()); + gfx::Point location_in_screen = drag_point_in_grid_view; + views::View::ConvertPointToScreen(this, &location_in_screen); + DispatchDragEventToDragAndDropHost(location_in_screen); if (drag_and_drop_host_) - drag_and_drop_host_->UpdateDragIconProxy(event.root_location()); + drag_and_drop_host_->UpdateDragIconProxy(location_in_screen); } void AppsGridView::UpdateDrag(Pointer pointer, const gfx::Point& point) { @@ -1235,7 +1237,7 @@ void AppsGridView::StartDragAndDropHostDrag(const gfx::Point& grid_location) { } void AppsGridView::DispatchDragEventToDragAndDropHost( - const gfx::Point& point) { + const gfx::Point& location_in_screen_coordinates) { if (!drag_view_ || !drag_and_drop_host_) return; if (bounds().Contains(last_drag_point_)) { @@ -1250,13 +1252,14 @@ void AppsGridView::DispatchDragEventToDragAndDropHost( // The event happened outside our app menu and we might need to dispatch. if (forward_events_to_drag_and_drop_host_) { // Dispatch since we have already started. - if (!drag_and_drop_host_->Drag(point)) { + if (!drag_and_drop_host_->Drag(location_in_screen_coordinates)) { // The host is not active any longer and we cancel the operation. forward_events_to_drag_and_drop_host_ = false; drag_and_drop_host_->EndDrag(true); } } else { - if (drag_and_drop_host_->StartDrag(drag_view_->model()->id(), point)) { + if (drag_and_drop_host_->StartDrag(drag_view_->model()->id(), + location_in_screen_coordinates)) { // From now on we forward the drag events. forward_events_to_drag_and_drop_host_ = true; // Any flip operations are stopped. diff --git a/ui/app_list/views/apps_grid_view.h b/ui/app_list/views/apps_grid_view.h index e357f05..2ff51fa 100644 --- a/ui/app_list/views/apps_grid_view.h +++ b/ui/app_list/views/apps_grid_view.h @@ -243,7 +243,8 @@ class APP_LIST_EXPORT AppsGridView : public views::View, void StartDragAndDropHostDrag(const gfx::Point& grid_location); // Dispatch the drag and drop update event to the dnd host (if needed). - void DispatchDragEventToDragAndDropHost(const gfx::Point& point); + void DispatchDragEventToDragAndDropHost( + const gfx::Point& location_in_screen_coordinates); // Starts the page flip timer if |drag_point| is in left/right side page flip // zone or is over page switcher. |