| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 } | 138 } |
| 139 | 139 |
| 140 } // namespace | 140 } // namespace |
| 141 | 141 |
| 142 void SyntheticGestureTargetAura::DispatchWebMouseEventToPlatform( | 142 void SyntheticGestureTargetAura::DispatchWebMouseEventToPlatform( |
| 143 const blink::WebMouseEvent& web_mouse_event, | 143 const blink::WebMouseEvent& web_mouse_event, |
| 144 const ui::LatencyInfo& latency_info) { | 144 const ui::LatencyInfo& latency_info) { |
| 145 ui::EventType event_type = | 145 ui::EventType event_type = |
| 146 WebMouseEventTypeToEventType(web_mouse_event.type()); | 146 WebMouseEventTypeToEventType(web_mouse_event.type()); |
| 147 int flags = WebEventModifiersToEventFlags(web_mouse_event.modifiers()); | 147 int flags = WebEventModifiersToEventFlags(web_mouse_event.modifiers()); |
| 148 ui::MouseEvent mouse_event(event_type, gfx::Point(), gfx::Point(), | 148 ui::MouseEvent mouse_event( |
| 149 ui::EventTimeForNow(), flags, flags); | 149 event_type, gfx::Point(), gfx::Point(), ui::EventTimeForNow(), flags, |
| 150 flags, |
| 151 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE, |
| 152 ui::PointerEvent::kMousePointerId)); |
| 150 gfx::PointF location(web_mouse_event.x * device_scale_factor_, | 153 gfx::PointF location(web_mouse_event.x * device_scale_factor_, |
| 151 web_mouse_event.y * device_scale_factor_); | 154 web_mouse_event.y * device_scale_factor_); |
| 152 mouse_event.set_location_f(location); | 155 mouse_event.set_location_f(location); |
| 153 mouse_event.set_root_location_f(location); | 156 mouse_event.set_root_location_f(location); |
| 154 ui::PointerDetails pointer_details = mouse_event.pointer_details(); | 157 ui::PointerDetails pointer_details = mouse_event.pointer_details(); |
| 155 pointer_details.pointer_type = | 158 pointer_details.pointer_type = |
| 156 WebMousePointerTypeToEventPointerType(web_mouse_event.pointerType); | 159 WebMousePointerTypeToEventPointerType(web_mouse_event.pointerType); |
| 157 mouse_event.set_pointer_details(pointer_details); | 160 mouse_event.set_pointer_details(pointer_details); |
| 158 | 161 |
| 159 aura::Window* window = GetWindow(); | 162 aura::Window* window = GetWindow(); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 182 ->min_distance_for_pinch_scroll_in_pixels(); | 185 ->min_distance_for_pinch_scroll_in_pixels(); |
| 183 } | 186 } |
| 184 | 187 |
| 185 aura::Window* SyntheticGestureTargetAura::GetWindow() const { | 188 aura::Window* SyntheticGestureTargetAura::GetWindow() const { |
| 186 aura::Window* window = render_widget_host()->GetView()->GetNativeView(); | 189 aura::Window* window = render_widget_host()->GetView()->GetNativeView(); |
| 187 DCHECK(window); | 190 DCHECK(window); |
| 188 return window; | 191 return window; |
| 189 } | 192 } |
| 190 | 193 |
| 191 } // namespace content | 194 } // namespace content |
| OLD | NEW |