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

Side by Side Diff: ui/events/blink/blink_event_util.cc

Issue 999423003: Set the unique_event_id when converting from TouchEvent to WebTouchEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 // MSVC++ requires this to be set before any other includes to get M_PI. 5 // MSVC++ requires this to be set before any other includes to get M_PI.
6 #define _USE_MATH_DEFINES 6 #define _USE_MATH_DEFINES
7 7
8 #include "ui/events/blink/blink_event_util.h" 8 #include "ui/events/blink/blink_event_util.h"
9 9
10 #include <cmath> 10 #include <cmath>
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 "inconsistent maximum number of active touch points"); 135 "inconsistent maximum number of active touch points");
136 136
137 blink::WebTouchEvent result; 137 blink::WebTouchEvent result;
138 138
139 result.type = ToWebInputEventType(event.GetAction()); 139 result.type = ToWebInputEventType(event.GetAction());
140 result.cancelable = (result.type != WebInputEvent::TouchCancel); 140 result.cancelable = (result.type != WebInputEvent::TouchCancel);
141 result.timeStampSeconds = 141 result.timeStampSeconds =
142 (event.GetEventTime() - base::TimeTicks()).InSecondsF(), 142 (event.GetEventTime() - base::TimeTicks()).InSecondsF(),
143 result.causesScrollingIfUncanceled = may_cause_scrolling; 143 result.causesScrollingIfUncanceled = may_cause_scrolling;
144 result.modifiers = EventFlagsToWebEventModifiers(event.GetFlags()); 144 result.modifiers = EventFlagsToWebEventModifiers(event.GetFlags());
145 result.uniqueTouchEventId = event.GetUniqueId();
145 result.touchesLength = 146 result.touchesLength =
146 std::min(static_cast<unsigned>(event.GetPointerCount()), 147 std::min(static_cast<unsigned>(event.GetPointerCount()),
147 static_cast<unsigned>(WebTouchEvent::touchesLengthCap)); 148 static_cast<unsigned>(WebTouchEvent::touchesLengthCap));
148 DCHECK_GT(result.touchesLength, 0U); 149 DCHECK_GT(result.touchesLength, 0U);
149 150
150 for (size_t i = 0; i < result.touchesLength; ++i) 151 for (size_t i = 0; i < result.touchesLength; ++i)
151 result.touches[i] = CreateWebTouchPoint(event, i); 152 result.touches[i] = CreateWebTouchPoint(event, i);
152 153
153 return result; 154 return result;
154 } 155 }
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 } 295 }
295 296
296 WebGestureEvent CreateWebGestureEventFromGestureEventData( 297 WebGestureEvent CreateWebGestureEventFromGestureEventData(
297 const GestureEventData& data) { 298 const GestureEventData& data) {
298 return CreateWebGestureEvent(data.details, data.time - base::TimeTicks(), 299 return CreateWebGestureEvent(data.details, data.time - base::TimeTicks(),
299 gfx::PointF(data.x, data.y), 300 gfx::PointF(data.x, data.y),
300 gfx::PointF(data.raw_x, data.raw_y), data.flags); 301 gfx::PointF(data.raw_x, data.raw_y), data.flags);
301 } 302 }
302 303
303 } // namespace ui 304 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698