| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/common/input/web_input_event_traits.h" | 5 #include "content/common/input/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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 event.movementX, | 45 event.movementX, |
| 46 event.movementY, | 46 event.movementY, |
| 47 event.clickCount); | 47 event.clickCount); |
| 48 } | 48 } |
| 49 | 49 |
| 50 void ApppendEventDetails(const WebMouseWheelEvent& event, std::string* result) { | 50 void ApppendEventDetails(const WebMouseWheelEvent& event, std::string* result) { |
| 51 StringAppendF( | 51 StringAppendF( |
| 52 result, | 52 result, |
| 53 "{\n Delta: (%f, %f)\n WheelTicks: (%f, %f)\n Accel: (%f, %f)\n" | 53 "{\n Delta: (%f, %f)\n WheelTicks: (%f, %f)\n Accel: (%f, %f)\n" |
| 54 " ScrollByPage: %d\n HasPreciseScrollingDeltas: %d\n" | 54 " ScrollByPage: %d\n HasPreciseScrollingDeltas: %d\n" |
| 55 " Phase: (%d, %d)\n CanRubberband: (%d, %d)\n}", | 55 " Phase: (%d, %d)", |
| 56 event.deltaX, event.deltaY, event.wheelTicksX, event.wheelTicksY, | 56 event.deltaX, event.deltaY, event.wheelTicksX, event.wheelTicksY, |
| 57 event.accelerationRatioX, event.accelerationRatioY, event.scrollByPage, | 57 event.accelerationRatioX, event.accelerationRatioY, event.scrollByPage, |
| 58 event.hasPreciseScrollingDeltas, event.phase, event.momentumPhase, | 58 event.hasPreciseScrollingDeltas, event.phase, event.momentumPhase); |
| 59 event.canRubberbandLeft, event.canRubberbandRight); | |
| 60 } | 59 } |
| 61 | 60 |
| 62 void ApppendEventDetails(const WebGestureEvent& event, std::string* result) { | 61 void ApppendEventDetails(const WebGestureEvent& event, std::string* result) { |
| 63 StringAppendF(result, | 62 StringAppendF(result, |
| 64 "{\n Pos: (%d, %d)\n GlobalPos: (%d, %d)\n SourceDevice: %d\n" | 63 "{\n Pos: (%d, %d)\n GlobalPos: (%d, %d)\n SourceDevice: %d\n" |
| 65 " RawData: (%f, %f, %f, %f, %d)\n}", | 64 " RawData: (%f, %f, %f, %f, %d)\n}", |
| 66 event.x, | 65 event.x, |
| 67 event.y, | 66 event.y, |
| 68 event.globalX, | 67 event.globalX, |
| 69 event.globalY, | 68 event.globalY, |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 | 295 |
| 297 uint32_t WebInputEventTraits::GetUniqueTouchEventId( | 296 uint32_t WebInputEventTraits::GetUniqueTouchEventId( |
| 298 const WebInputEvent& event) { | 297 const WebInputEvent& event) { |
| 299 if (WebInputEvent::isTouchEventType(event.type)) { | 298 if (WebInputEvent::isTouchEventType(event.type)) { |
| 300 return static_cast<const WebTouchEvent&>(event).uniqueTouchEventId; | 299 return static_cast<const WebTouchEvent&>(event).uniqueTouchEventId; |
| 301 } | 300 } |
| 302 return 0U; | 301 return 0U; |
| 303 } | 302 } |
| 304 | 303 |
| 305 } // namespace content | 304 } // namespace content |
| OLD | NEW |