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

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
« no previous file with comments | « no previous file | content/common/input/synthetic_web_input_event_builders.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.GetType()); 150 WebMouseEventTypeToEventType(web_mouse_event.GetType());
151 int flags = WebEventModifiersToEventFlags(web_mouse_event.GetModifiers()); 151 int flags = WebEventModifiersToEventFlags(web_mouse_event.GetModifiers());
152 ui::PointerDetails pointer_details(
153 WebMousePointerTypeToEventPointerType(web_mouse_event.pointer_type));
152 ui::MouseEvent mouse_event(event_type, gfx::Point(), gfx::Point(), 154 ui::MouseEvent mouse_event(event_type, gfx::Point(), gfx::Point(),
153 ui::EventTimeForNow(), flags, flags); 155 ui::EventTimeForNow(), flags, flags,
156 pointer_details);
154 gfx::PointF location( 157 gfx::PointF location(
155 web_mouse_event.PositionInWidget().x * device_scale_factor_, 158 web_mouse_event.PositionInWidget().x * device_scale_factor_,
156 web_mouse_event.PositionInWidget().y * device_scale_factor_); 159 web_mouse_event.PositionInWidget().y * device_scale_factor_);
157 mouse_event.set_location_f(location); 160 mouse_event.set_location_f(location);
158 mouse_event.set_root_location_f(location); 161 mouse_event.set_root_location_f(location);
159 ui::PointerDetails pointer_details = mouse_event.pointer_details();
160 pointer_details.pointer_type =
161 WebMousePointerTypeToEventPointerType(web_mouse_event.pointer_type);
162 mouse_event.set_pointer_details(pointer_details);
163 162
164 aura::Window* window = GetWindow(); 163 aura::Window* window = GetWindow();
165 mouse_event.ConvertLocationToTarget(window, window->GetRootWindow()); 164 mouse_event.ConvertLocationToTarget(window, window->GetRootWindow());
166 ui::EventDispatchDetails details = 165 ui::EventDispatchDetails details =
167 window->GetHost()->event_sink()->OnEventFromSource(&mouse_event); 166 window->GetHost()->event_sink()->OnEventFromSource(&mouse_event);
168 if (details.dispatcher_destroyed) 167 if (details.dispatcher_destroyed)
169 return; 168 return;
170 } 169 }
171 170
172 SyntheticGestureParams::GestureSourceType 171 SyntheticGestureParams::GestureSourceType
(...skipping 14 matching lines...) Expand all
187 ->min_distance_for_pinch_scroll_in_pixels(); 186 ->min_distance_for_pinch_scroll_in_pixels();
188 } 187 }
189 188
190 aura::Window* SyntheticGestureTargetAura::GetWindow() const { 189 aura::Window* SyntheticGestureTargetAura::GetWindow() const {
191 aura::Window* window = render_widget_host()->GetView()->GetNativeView(); 190 aura::Window* window = render_widget_host()->GetView()->GetNativeView();
192 DCHECK(window); 191 DCHECK(window);
193 return window; 192 return window;
194 } 193 }
195 194
196 } // namespace content 195 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/common/input/synthetic_web_input_event_builders.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698