From 49a80418cac0392fdda7e8c88528fb1eaf217711 Mon Sep 17 00:00:00 2001 From: "pkotwicz@chromium.org" Date: Fri, 25 May 2012 00:29:49 +0000 Subject: The message pump gets events in pixels. Convert to DIP as we should. This patch depends on 10391074 Repro: 1) Go to http://html5demos.com/drag 2) Scroll page to bottom of screen 2) Select an item to drag 3) Drag item and move mouse to ~20px of top of tab contents. Expected: page scrolls up Actual: Nothing happens BUG=None TEST=Manual, see above Review URL: https://chromiumcodereview.appspot.com/10386225 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138945 0039d316-1c4b-4281-b951-d872f2087c98 --- content/browser/web_contents/web_contents_view_aura.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'content') diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc index 2845cff..7c81d8e 100644 --- a/content/browser/web_contents/web_contents_view_aura.cc +++ b/content/browser/web_contents/web_contents_view_aura.cc @@ -5,6 +5,7 @@ #include "content/browser/web_contents/web_contents_view_aura.h" #include "base/utf_string_conversions.h" +#include "content/browser/renderer_host/dip_util.h" #include "content/browser/renderer_host/render_view_host_factory.h" #include "content/browser/web_contents/interstitial_page_impl.h" #include "content/browser/web_contents/web_contents_impl.h" @@ -67,7 +68,9 @@ class WebDragSourceAura : public MessageLoopForUI::Observer { case ui::ET_MOUSE_DRAGGED: rvh = contents_->GetRenderViewHost(); if (rvh) { - gfx::Point screen_loc = ui::EventLocationFromNative(event); + gfx::Point screen_loc_in_pixel = ui::EventLocationFromNative(event); + gfx::Point screen_loc = content::ConvertPointToDIP(rvh->GetView(), + screen_loc_in_pixel); gfx::Point client_loc = screen_loc; aura::Window* window = rvh->GetView()->GetNativeView(); aura::Window::ConvertPointToWindow(window->GetRootWindow(), -- cgit v1.1