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

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

Issue 2317253005: SourceEventType added to LatencyInfo (Closed)
Patch Set: reviews addressed. Created 4 years, 3 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ui/events/blink/web_input_event_traits.h" 5 #include "ui/events/blink/web_input_event_traits.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 9
10 using base::StringAppendF; 10 using base::StringAppendF;
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 } 245 }
246 246
247 uint32_t WebInputEventTraits::GetUniqueTouchEventId( 247 uint32_t WebInputEventTraits::GetUniqueTouchEventId(
248 const WebInputEvent& event) { 248 const WebInputEvent& event) {
249 if (WebInputEvent::isTouchEventType(event.type)) { 249 if (WebInputEvent::isTouchEventType(event.type)) {
250 return static_cast<const WebTouchEvent&>(event).uniqueTouchEventId; 250 return static_cast<const WebTouchEvent&>(event).uniqueTouchEventId;
251 } 251 }
252 return 0U; 252 return 0U;
253 } 253 }
254 254
255 // static
256 LatencyInfo WebInputEventTraits::CreateLatencyInfoForWebGestureEvent(
257 WebGestureEvent event) {
258 SourceEventType source_event_type = SourceEventType::UNKOWN;
259 if (event.sourceDevice == blink::WebGestureDevice::WebGestureDeviceTouchpad)
260 source_event_type = SourceEventType::WHEEL;
261 else if (event.sourceDevice ==
262 blink::WebGestureDevice::WebGestureDeviceTouchscreen) {
263 source_event_type = SourceEventType::TOUCH;
264 }
265 LatencyInfo latency_info(source_event_type);
266 return latency_info;
267 }
268
255 } // namespace ui 269 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698