OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/renderer_host/input/synthetic_gesture_target_aura.h" | 5 #include "content/browser/renderer_host/input/synthetic_gesture_target_aura.h" |
6 | 6 |
7 #include "content/browser/renderer_host/render_widget_host_impl.h" | 7 #include "content/browser/renderer_host/render_widget_host_impl.h" |
8 #include "content/browser/renderer_host/render_widget_host_view_aura.h" | 8 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
9 #include "content/browser/renderer_host/ui_events_helper.h" | 9 #include "content/browser/renderer_host/ui_events_helper.h" |
10 #include "content/common/input/input_event.h" | 10 #include "content/common/input/input_event.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 end = events.end(); iter != end; ++iter) { | 56 end = events.end(); iter != end; ++iter) { |
57 root_window_host_delegate->OnHostTouchEvent(*iter); | 57 root_window_host_delegate->OnHostTouchEvent(*iter); |
58 } | 58 } |
59 } | 59 } |
60 | 60 |
61 void SyntheticGestureTargetAura::DispatchWebMouseWheelEventToPlatform( | 61 void SyntheticGestureTargetAura::DispatchWebMouseWheelEventToPlatform( |
62 const blink::WebMouseWheelEvent& web_wheel, | 62 const blink::WebMouseWheelEvent& web_wheel, |
63 const ui::LatencyInfo&) { | 63 const ui::LatencyInfo&) { |
64 gfx::Point location(web_wheel.x, web_wheel.y); | 64 gfx::Point location(web_wheel.x, web_wheel.y); |
65 ui::MouseEvent mouse_event( | 65 ui::MouseEvent mouse_event( |
66 ui::ET_MOUSEWHEEL, location, location, ui::EF_NONE); | 66 ui::ET_MOUSEWHEEL, location, location, ui::EF_NONE, ui::EF_NONE); |
67 ui::MouseWheelEvent wheel_event( | 67 ui::MouseWheelEvent wheel_event( |
68 mouse_event, web_wheel.deltaX, web_wheel.deltaY); | 68 mouse_event, web_wheel.deltaX, web_wheel.deltaY); |
69 | 69 |
70 GetRootWindowHostDelegate()->OnHostMouseEvent(&wheel_event); | 70 GetRootWindowHostDelegate()->OnHostMouseEvent(&wheel_event); |
71 } | 71 } |
72 | 72 |
73 namespace { | 73 namespace { |
74 | 74 |
75 ui::EventType | 75 ui::EventType |
76 WebMouseEventTypeToEventType(blink::WebInputEvent::Type web_type) { | 76 WebMouseEventTypeToEventType(blink::WebInputEvent::Type web_type) { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 } | 120 } |
121 | 121 |
122 } // namespace | 122 } // namespace |
123 | 123 |
124 void SyntheticGestureTargetAura::DispatchWebMouseEventToPlatform( | 124 void SyntheticGestureTargetAura::DispatchWebMouseEventToPlatform( |
125 const blink::WebMouseEvent& web_mouse, | 125 const blink::WebMouseEvent& web_mouse, |
126 const ui::LatencyInfo& latency_info) { | 126 const ui::LatencyInfo& latency_info) { |
127 gfx::Point location(web_mouse.x, web_mouse.y); | 127 gfx::Point location(web_mouse.x, web_mouse.y); |
128 ui::EventType event_type = WebMouseEventTypeToEventType(web_mouse.type); | 128 ui::EventType event_type = WebMouseEventTypeToEventType(web_mouse.type); |
129 int flags = WebMouseEventButtonToFlags(web_mouse.button); | 129 int flags = WebMouseEventButtonToFlags(web_mouse.button); |
130 ui::MouseEvent mouse_event(event_type, location, location, flags); | 130 // TODO: last argument (changed_button_flags) likely isn't right. |
| 131 ui::MouseEvent mouse_event(event_type, location, location, flags, 0); |
131 | 132 |
132 GetRootWindowHostDelegate()->OnHostMouseEvent(&mouse_event); | 133 GetRootWindowHostDelegate()->OnHostMouseEvent(&mouse_event); |
133 } | 134 } |
134 | 135 |
135 SyntheticGestureParams::GestureSourceType | 136 SyntheticGestureParams::GestureSourceType |
136 SyntheticGestureTargetAura::GetDefaultSyntheticGestureSourceType() const { | 137 SyntheticGestureTargetAura::GetDefaultSyntheticGestureSourceType() const { |
137 return SyntheticGestureParams::MOUSE_INPUT; | 138 return SyntheticGestureParams::MOUSE_INPUT; |
138 } | 139 } |
139 | 140 |
140 bool SyntheticGestureTargetAura::SupportsSyntheticGestureSourceType( | 141 bool SyntheticGestureTargetAura::SupportsSyntheticGestureSourceType( |
(...skipping 13 matching lines...) Expand all Loading... |
154 aura::Window* window = render_widget_host()->GetView()->GetNativeView(); | 155 aura::Window* window = render_widget_host()->GetView()->GetNativeView(); |
155 aura::Window* root_window = window->GetRootWindow(); | 156 aura::Window* root_window = window->GetRootWindow(); |
156 aura::RootWindowHostDelegate* root_window_host_delegate = | 157 aura::RootWindowHostDelegate* root_window_host_delegate = |
157 root_window->GetDispatcher()->AsRootWindowHostDelegate(); | 158 root_window->GetDispatcher()->AsRootWindowHostDelegate(); |
158 DCHECK(root_window_host_delegate); | 159 DCHECK(root_window_host_delegate); |
159 return root_window_host_delegate; | 160 return root_window_host_delegate; |
160 } | 161 } |
161 | 162 |
162 | 163 |
163 } // namespace content | 164 } // namespace content |
OLD | NEW |