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

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

Issue 2573073003: Collapse the API surface on WebInputEvent via accessor functions. (Closed)
Patch Set: Fix nits Created 3 years, 11 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 "content/browser/renderer_host/render_widget_host_impl.h" 9 #include "content/browser/renderer_host/render_widget_host_impl.h"
10 #include "content/browser/renderer_host/render_widget_host_view_aura.h" 10 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 } 128 }
129 129
130 return 0; 130 return 0;
131 } 131 }
132 132
133 } // namespace 133 } // namespace
134 134
135 void SyntheticGestureTargetAura::DispatchWebMouseEventToPlatform( 135 void SyntheticGestureTargetAura::DispatchWebMouseEventToPlatform(
136 const blink::WebMouseEvent& web_mouse, 136 const blink::WebMouseEvent& web_mouse,
137 const ui::LatencyInfo& latency_info) { 137 const ui::LatencyInfo& latency_info) {
138 ui::EventType event_type = WebMouseEventTypeToEventType(web_mouse.type); 138 ui::EventType event_type = WebMouseEventTypeToEventType(web_mouse.type());
139 int flags = WebMouseEventButtonToFlags(web_mouse.button); 139 int flags = WebMouseEventButtonToFlags(web_mouse.button);
140 ui::MouseEvent mouse_event(event_type, gfx::Point(), gfx::Point(), 140 ui::MouseEvent mouse_event(event_type, gfx::Point(), gfx::Point(),
141 ui::EventTimeForNow(), flags, flags); 141 ui::EventTimeForNow(), flags, flags);
142 gfx::PointF location(web_mouse.x * device_scale_factor_, 142 gfx::PointF location(web_mouse.x * device_scale_factor_,
143 web_mouse.y * device_scale_factor_); 143 web_mouse.y * device_scale_factor_);
144 mouse_event.set_location_f(location); 144 mouse_event.set_location_f(location);
145 mouse_event.set_root_location_f(location); 145 mouse_event.set_root_location_f(location);
146 146
147 aura::Window* window = GetWindow(); 147 aura::Window* window = GetWindow();
148 mouse_event.ConvertLocationToTarget(window, window->GetRootWindow()); 148 mouse_event.ConvertLocationToTarget(window, window->GetRootWindow());
(...skipping 21 matching lines...) Expand all
170 ->min_distance_for_pinch_scroll_in_pixels(); 170 ->min_distance_for_pinch_scroll_in_pixels();
171 } 171 }
172 172
173 aura::Window* SyntheticGestureTargetAura::GetWindow() const { 173 aura::Window* SyntheticGestureTargetAura::GetWindow() const {
174 aura::Window* window = render_widget_host()->GetView()->GetNativeView(); 174 aura::Window* window = render_widget_host()->GetView()->GetNativeView();
175 DCHECK(window); 175 DCHECK(window);
176 return window; 176 return window;
177 } 177 }
178 178
179 } // namespace content 179 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698