| 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 #include "third_party/WebKit/public/platform/WebGestureEvent.h" | 9 #include "third_party/WebKit/public/platform/WebGestureEvent.h" |
| 10 #include "third_party/WebKit/public/platform/WebKeyboardEvent.h" | 10 #include "third_party/WebKit/public/platform/WebKeyboardEvent.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 " Text: %s\n UnmodifiedText: %s\n}", | 30 " Text: %s\n UnmodifiedText: %s\n}", |
| 31 event.windowsKeyCode, | 31 event.windowsKeyCode, |
| 32 event.nativeKeyCode, | 32 event.nativeKeyCode, |
| 33 event.isSystemKey, | 33 event.isSystemKey, |
| 34 reinterpret_cast<const char*>(event.text), | 34 reinterpret_cast<const char*>(event.text), |
| 35 reinterpret_cast<const char*>(event.unmodifiedText)); | 35 reinterpret_cast<const char*>(event.unmodifiedText)); |
| 36 } | 36 } |
| 37 | 37 |
| 38 void ApppendEventDetails(const WebMouseEvent& event, std::string* result) { | 38 void ApppendEventDetails(const WebMouseEvent& event, std::string* result) { |
| 39 StringAppendF(result, | 39 StringAppendF(result, |
| 40 "{\n Button: %d\n Pos: (%d, %d)\n" | 40 "{\n Button: %d\n Pos: (%f, %f)\n" |
| 41 " GlobalPos: (%d, %d)\n Movement: (%d, %d)\n Clicks: %d\n}", | 41 " GlobalPos: (%f, %f)\n Movement: (%d, %d)\n Clicks: %d\n}", |
| 42 static_cast<int>(event.button), event.x, event.y, event.globalX, | 42 static_cast<int>(event.button), event.positionInWidget().x, |
| 43 event.globalY, event.movementX, event.movementY, | 43 event.positionInWidget().y, event.positionInScreen().x, |
| 44 event.positionInScreen().y, event.movementX, event.movementY, |
| 44 event.clickCount); | 45 event.clickCount); |
| 45 } | 46 } |
| 46 | 47 |
| 47 void ApppendEventDetails(const WebMouseWheelEvent& event, std::string* result) { | 48 void ApppendEventDetails(const WebMouseWheelEvent& event, std::string* result) { |
| 48 StringAppendF( | 49 StringAppendF( |
| 49 result, | 50 result, |
| 50 "{\n Delta: (%f, %f)\n WheelTicks: (%f, %f)\n Accel: (%f, %f)\n" | 51 "{\n Delta: (%f, %f)\n WheelTicks: (%f, %f)\n Accel: (%f, %f)\n" |
| 51 " ScrollByPage: %d\n HasPreciseScrollingDeltas: %d\n" | 52 " ScrollByPage: %d\n HasPreciseScrollingDeltas: %d\n" |
| 52 " Phase: (%d, %d)", | 53 " Phase: (%d, %d)", |
| 53 event.deltaX, event.deltaY, event.wheelTicksX, event.wheelTicksY, | 54 event.deltaX, event.deltaY, event.wheelTicksX, event.wheelTicksY, |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 source_event_type = SourceEventType::WHEEL; | 267 source_event_type = SourceEventType::WHEEL; |
| 267 } else if (event.sourceDevice == | 268 } else if (event.sourceDevice == |
| 268 blink::WebGestureDevice::WebGestureDeviceTouchscreen) { | 269 blink::WebGestureDevice::WebGestureDeviceTouchscreen) { |
| 269 source_event_type = SourceEventType::TOUCH; | 270 source_event_type = SourceEventType::TOUCH; |
| 270 } | 271 } |
| 271 LatencyInfo latency_info(source_event_type); | 272 LatencyInfo latency_info(source_event_type); |
| 272 return latency_info; | 273 return latency_info; |
| 273 } | 274 } |
| 274 | 275 |
| 275 } // namespace ui | 276 } // namespace ui |
| OLD | NEW |