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

Side by Side Diff: content/browser/renderer_host/ui_events_helper.cc

Issue 1372253002: gfx: Make conversions from gfx::Point to PointF explicit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pointfconvert-event: mandol_line Created 5 years, 1 month 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui_events_helper.h" 5 #include "content/browser/renderer_host/ui_events_helper.h"
6 6
7 #include "content/browser/renderer_host/input/web_input_event_util.h" 7 #include "content/browser/renderer_host/input/web_input_event_util.h"
8 #include "content/common/input/web_touch_event_traits.h" 8 #include "content/common/input/web_touch_event_traits.h"
9 #include "third_party/WebKit/public/web/WebInputEvent.h" 9 #include "third_party/WebKit/public/web/WebInputEvent.h"
10 #include "ui/events/blink/blink_event_util.h" 10 #include "ui/events/blink/blink_event_util.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 for (unsigned i = 0; i < touch.touchesLength; ++i) { 67 for (unsigned i = 0; i < touch.touchesLength; ++i) {
68 const blink::WebTouchPoint& point = touch.touches[i]; 68 const blink::WebTouchPoint& point = touch.touches[i];
69 if (WebTouchPointStateToEventType(point.state) != type) 69 if (WebTouchPointStateToEventType(point.state) != type)
70 continue; 70 continue;
71 // ui events start in the co-ordinate space of the EventDispatcher. 71 // ui events start in the co-ordinate space of the EventDispatcher.
72 gfx::PointF location; 72 gfx::PointF location;
73 if (coordinate_system == LOCAL_COORDINATES) 73 if (coordinate_system == LOCAL_COORDINATES)
74 location = point.position; 74 location = point.position;
75 else 75 else
76 location = point.screenPosition; 76 location = point.screenPosition;
77 ui::TouchEvent* uievent = new ui::TouchEvent(type, 77 ui::TouchEvent* uievent = new ui::TouchEvent(
78 location, 78 type, gfx::Point(), flags, point.id, timestamp, point.radiusX,
79 flags, 79 point.radiusY, point.rotationAngle, point.force);
80 point.id, 80 uievent->set_location_f(location);
81 timestamp, 81 uievent->set_root_location_f(location);
82 point.radiusX,
83 point.radiusY,
84 point.rotationAngle,
85 point.force);
86 uievent->set_latency(touch_with_latency.latency); 82 uievent->set_latency(touch_with_latency.latency);
87 list->push_back(uievent); 83 list->push_back(uievent);
88 } 84 }
89 return true; 85 return true;
90 } 86 }
91 87
92 blink::WebGestureEvent MakeWebGestureEventFromUIEvent( 88 blink::WebGestureEvent MakeWebGestureEventFromUIEvent(
93 const ui::GestureEvent& event) { 89 const ui::GestureEvent& event) {
94 return ui::CreateWebGestureEvent(event.details(), event.time_stamp(), 90 return ui::CreateWebGestureEvent(event.details(), event.time_stamp(),
95 event.location_f(), event.root_location_f(), 91 event.location_f(), event.root_location_f(),
96 event.flags()); 92 event.flags());
97 } 93 }
98 94
99 } // namespace content 95 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698