OLD | NEW |
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 Loading... |
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::UNKNOWN; |
| 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 |
OLD | NEW |