Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(837)

Unified Diff: content/browser/renderer_host/input/synthetic_gesture_target_aura.cc

Issue 117333006: Adjust aura synthetic mouse event locations to screen location. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/input/synthetic_gesture_target_aura.cc
diff --git a/content/browser/renderer_host/input/synthetic_gesture_target_aura.cc b/content/browser/renderer_host/input/synthetic_gesture_target_aura.cc
index facbede3840f69d9b254bb04ee62a24bb08c2e75..eb81261c07cb54bcec21cecea2f39d78c1d31a97 100644
--- a/content/browser/renderer_host/input/synthetic_gesture_target_aura.cc
+++ b/content/browser/renderer_host/input/synthetic_gesture_target_aura.cc
@@ -124,11 +124,18 @@ int WebMouseEventButtonToFlags(blink::WebMouseEvent::Button button) {
void SyntheticGestureTargetAura::DispatchWebMouseEventToPlatform(
const blink::WebMouseEvent& web_mouse,
const ui::LatencyInfo& latency_info) {
+ aura::Window* window = render_widget_host()->GetView()->GetNativeView();
+ aura::Window* root_window = window->GetRootWindow();
+ aura::client::ScreenPositionClient* position_client =
+ aura::client::GetScreenPositionClient(root_window);
+ DCHECK(position_client);
+
gfx::Point location(web_mouse.x, web_mouse.y);
+ position_client->ConvertPointToScreen(window, &location);
Dominik Grewe 2013/12/18 10:33:53 I guess we should do the same for mouse wheel even
kouhei (in TOK) 2013/12/19 04:55:39 Done.
+
ui::EventType event_type = WebMouseEventTypeToEventType(web_mouse.type);
int flags = WebMouseEventButtonToFlags(web_mouse.button);
- // TODO: last argument (changed_button_flags) likely isn't right.
- ui::MouseEvent mouse_event(event_type, location, location, flags, 0);
+ ui::MouseEvent mouse_event(event_type, location, location, flags, flags);
GetRootWindowHostDelegate()->OnHostMouseEvent(&mouse_event);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698