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

Side by Side Diff: content/browser/renderer_host/input/synthetic_gesture_target_aura.cc

Issue 2786693002: Add PointerDetails to ui::MouseEvent's constructors (Closed)
Patch Set: mouse constructor Created 3 years, 8 months 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 unified diff | Download patch
OLDNEW
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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 } 142 }
143 143
144 } // namespace 144 } // namespace
145 145
146 void SyntheticGestureTargetAura::DispatchWebMouseEventToPlatform( 146 void SyntheticGestureTargetAura::DispatchWebMouseEventToPlatform(
147 const blink::WebMouseEvent& web_mouse_event, 147 const blink::WebMouseEvent& web_mouse_event,
148 const ui::LatencyInfo& latency_info) { 148 const ui::LatencyInfo& latency_info) {
149 ui::EventType event_type = 149 ui::EventType event_type =
150 WebMouseEventTypeToEventType(web_mouse_event.type()); 150 WebMouseEventTypeToEventType(web_mouse_event.type());
151 int flags = WebEventModifiersToEventFlags(web_mouse_event.modifiers()); 151 int flags = WebEventModifiersToEventFlags(web_mouse_event.modifiers());
152 ui::MouseEvent mouse_event(event_type, gfx::Point(), gfx::Point(),
153 ui::EventTimeForNow(), flags, flags);
154 gfx::PointF location(web_mouse_event.x * device_scale_factor_, 152 gfx::PointF location(web_mouse_event.x * device_scale_factor_,
155 web_mouse_event.y * device_scale_factor_); 153 web_mouse_event.y * device_scale_factor_);
154 ui::PointerDetails pointer_details(
155 WebMousePointerTypeToEventPointerType(web_mouse_event.pointerType));
156 ui::MouseEvent mouse_event(event_type, gfx::Point(), gfx::Point(),
157 ui::EventTimeForNow(), flags, flags,
158 pointer_details);
156 mouse_event.set_location_f(location); 159 mouse_event.set_location_f(location);
157 mouse_event.set_root_location_f(location); 160 mouse_event.set_root_location_f(location);
158 ui::PointerDetails pointer_details = mouse_event.pointer_details();
159 pointer_details.pointer_type =
160 WebMousePointerTypeToEventPointerType(web_mouse_event.pointerType);
161 mouse_event.set_pointer_details(pointer_details);
162 161
163 aura::Window* window = GetWindow(); 162 aura::Window* window = GetWindow();
164 mouse_event.ConvertLocationToTarget(window, window->GetRootWindow()); 163 mouse_event.ConvertLocationToTarget(window, window->GetRootWindow());
165 ui::EventDispatchDetails details = 164 ui::EventDispatchDetails details =
166 window->GetHost()->event_sink()->OnEventFromSource(&mouse_event); 165 window->GetHost()->event_sink()->OnEventFromSource(&mouse_event);
167 if (details.dispatcher_destroyed) 166 if (details.dispatcher_destroyed)
168 return; 167 return;
169 } 168 }
170 169
171 SyntheticGestureParams::GestureSourceType 170 SyntheticGestureParams::GestureSourceType
(...skipping 14 matching lines...) Expand all
186 ->min_distance_for_pinch_scroll_in_pixels(); 185 ->min_distance_for_pinch_scroll_in_pixels();
187 } 186 }
188 187
189 aura::Window* SyntheticGestureTargetAura::GetWindow() const { 188 aura::Window* SyntheticGestureTargetAura::GetWindow() const {
190 aura::Window* window = render_widget_host()->GetView()->GetNativeView(); 189 aura::Window* window = render_widget_host()->GetView()->GetNativeView();
191 DCHECK(window); 190 DCHECK(window);
192 return window; 191 return window;
193 } 192 }
194 193
195 } // namespace content 194 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/common/input/synthetic_web_input_event_builders.cc » ('j') | ui/events/event.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698