diff options
author | pkotwicz <pkotwicz@chromium.org> | 2015-02-24 13:16:05 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-24 21:17:05 +0000 |
commit | deb3f7248b8a7f7ed92b1cd4eaa7fb8df4645efc (patch) | |
tree | 8d245daf790fa78f98a033b774fb85fdc11e507c /ui | |
parent | c2c7d0fb617e4192ffc88e1634183354956bcc13 (diff) | |
download | chromium_src-deb3f7248b8a7f7ed92b1cd4eaa7fb8df4645efc.zip chromium_src-deb3f7248b8a7f7ed92b1cd4eaa7fb8df4645efc.tar.gz chromium_src-deb3f7248b8a7f7ed92b1cd4eaa7fb8df4645efc.tar.bz2 |
Pass location in screen coordinates to DragDropClient::StartDragAndDrop()
This CL:
- Avoids converting from screen coordinates in
WebContentsViewAura::StartDragging() and back to screen coordinates in
DragDropController::StartDragAndDrop()
- Passes the location in the correct coordinates to StartDragAndDrop() in
DragDownloadItem() in drag_download_item_views.cc
BUG=456619
TEST=Manual, see bug
Review URL: https://codereview.chromium.org/901563005
Cr-Commit-Position: refs/heads/master@{#317888}
Diffstat (limited to 'ui')
7 files changed, 13 insertions, 12 deletions
diff --git a/ui/views/controls/button/menu_button_unittest.cc b/ui/views/controls/button/menu_button_unittest.cc index 2a17acf..d00743e 100644 --- a/ui/views/controls/button/menu_button_unittest.cc +++ b/ui/views/controls/button/menu_button_unittest.cc @@ -171,7 +171,7 @@ class TestDragDropClient : public aura::client::DragDropClient, int StartDragAndDrop(const ui::OSExchangeData& data, aura::Window* root_window, aura::Window* source_window, - const gfx::Point& root_location, + const gfx::Point& screen_location, int operation, ui::DragDropTypes::DragEventSource source) override; void DragUpdate(aura::Window* target, const ui::LocatedEvent& event) override; @@ -203,7 +203,7 @@ int TestDragDropClient::StartDragAndDrop( const ui::OSExchangeData& data, aura::Window* root_window, aura::Window* source_window, - const gfx::Point& root_location, + const gfx::Point& screen_location, int operation, ui::DragDropTypes::DragEventSource source) { if (IsDragDropInProgress()) diff --git a/ui/views/drag_utils_aura.cc b/ui/views/drag_utils_aura.cc index cb64199..21a8fce 100644 --- a/ui/views/drag_utils_aura.cc +++ b/ui/views/drag_utils_aura.cc @@ -6,6 +6,7 @@ #include "ui/aura/window.h" #include "ui/aura/window_event_dispatcher.h" +#include "ui/wm/core/coordinate_conversion.h" #include "ui/wm/public/drag_drop_client.h" namespace views { @@ -15,12 +16,12 @@ void RunShellDrag(gfx::NativeView view, const gfx::Point& location, int operation, ui::DragDropTypes::DragEventSource source) { - gfx::Point root_location(location); + gfx::Point screen_location(location); + wm::ConvertPointToScreen(view, &screen_location); aura::Window* root_window = view->GetRootWindow(); - aura::Window::ConvertPointToTarget(view, root_window, &root_location); if (aura::client::GetDragDropClient(root_window)) { aura::client::GetDragDropClient(root_window)->StartDragAndDrop( - data, root_window, view, root_location, operation, source); + data, root_window, view, screen_location, operation, source); } } diff --git a/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc b/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc index 70db036..cf15425 100644 --- a/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc +++ b/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc @@ -648,7 +648,7 @@ int DesktopDragDropClientAuraX11::StartDragAndDrop( const ui::OSExchangeData& data, aura::Window* root_window, aura::Window* source_window, - const gfx::Point& root_location, + const gfx::Point& screen_location, int operation, ui::DragDropTypes::DragEventSource source) { UMA_HISTOGRAM_ENUMERATION("Event.DragDrop.Start", source, diff --git a/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.h b/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.h index 880aa5d..888791b 100644 --- a/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.h +++ b/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.h @@ -83,7 +83,7 @@ class VIEWS_EXPORT DesktopDragDropClientAuraX11 int StartDragAndDrop(const ui::OSExchangeData& data, aura::Window* root_window, aura::Window* source_window, - const gfx::Point& root_location, + const gfx::Point& screen_location, int operation, ui::DragDropTypes::DragEventSource source) override; void DragUpdate(aura::Window* target, const ui::LocatedEvent& event) override; diff --git a/ui/views/widget/desktop_aura/desktop_drag_drop_client_win.cc b/ui/views/widget/desktop_aura/desktop_drag_drop_client_win.cc index 9b08a9d..8afa69b 100644 --- a/ui/views/widget/desktop_aura/desktop_drag_drop_client_win.cc +++ b/ui/views/widget/desktop_aura/desktop_drag_drop_client_win.cc @@ -33,7 +33,7 @@ int DesktopDragDropClientWin::StartDragAndDrop( const ui::OSExchangeData& data, aura::Window* root_window, aura::Window* source_window, - const gfx::Point& root_location, + const gfx::Point& screen_location, int operation, ui::DragDropTypes::DragEventSource source) { drag_drop_in_progress_ = true; diff --git a/ui/views/widget/desktop_aura/desktop_drag_drop_client_win.h b/ui/views/widget/desktop_aura/desktop_drag_drop_client_win.h index ef6b9ec..c46e242 100644 --- a/ui/views/widget/desktop_aura/desktop_drag_drop_client_win.h +++ b/ui/views/widget/desktop_aura/desktop_drag_drop_client_win.h @@ -31,7 +31,7 @@ class VIEWS_EXPORT DesktopDragDropClientWin const ui::OSExchangeData& data, aura::Window* root_window, aura::Window* source_window, - const gfx::Point& root_location, + const gfx::Point& screen_location, int operation, ui::DragDropTypes::DragEventSource source) override; virtual void DragUpdate(aura::Window* target, diff --git a/ui/wm/public/drag_drop_client.h b/ui/wm/public/drag_drop_client.h index 62a2355..e9989a5 100644 --- a/ui/wm/public/drag_drop_client.h +++ b/ui/wm/public/drag_drop_client.h @@ -28,12 +28,12 @@ class AURA_EXPORT DragDropClient { virtual ~DragDropClient() {} // Initiates a drag and drop session. Returns the drag operation that was - // applied at the end of the drag drop session. |root_location| is in the - // root Window's coordinate system. + // applied at the end of the drag drop session. |screen_location| is in + // screen coordinates. virtual int StartDragAndDrop(const ui::OSExchangeData& data, aura::Window* root_window, aura::Window* source_window, - const gfx::Point& root_location, + const gfx::Point& screen_location, int operation, ui::DragDropTypes::DragEventSource source) = 0; |