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 17 matching lines...) Expand all Loading... |
28 event.nativeKeyCode, | 28 event.nativeKeyCode, |
29 event.isSystemKey, | 29 event.isSystemKey, |
30 reinterpret_cast<const char*>(event.text), | 30 reinterpret_cast<const char*>(event.text), |
31 reinterpret_cast<const char*>(event.unmodifiedText)); | 31 reinterpret_cast<const char*>(event.unmodifiedText)); |
32 } | 32 } |
33 | 33 |
34 void ApppendEventDetails(const WebMouseEvent& event, std::string* result) { | 34 void ApppendEventDetails(const WebMouseEvent& event, std::string* result) { |
35 StringAppendF(result, | 35 StringAppendF(result, |
36 "{\n Button: %d\n Pos: (%d, %d)\n WindowPos: (%d, %d)\n" | 36 "{\n Button: %d\n Pos: (%d, %d)\n WindowPos: (%d, %d)\n" |
37 " GlobalPos: (%d, %d)\n Movement: (%d, %d)\n Clicks: %d\n}", | 37 " GlobalPos: (%d, %d)\n Movement: (%d, %d)\n Clicks: %d\n}", |
38 event.button, | 38 static_cast<int>(event.button), |
39 event.x, | 39 event.x, |
40 event.y, | 40 event.y, |
41 event.windowX, | 41 event.windowX, |
42 event.windowY, | 42 event.windowY, |
43 event.globalX, | 43 event.globalX, |
44 event.globalY, | 44 event.globalY, |
45 event.movementX, | 45 event.movementX, |
46 event.movementY, | 46 event.movementY, |
47 event.clickCount); | 47 event.clickCount); |
48 } | 48 } |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 | 295 |
296 uint32_t WebInputEventTraits::GetUniqueTouchEventId( | 296 uint32_t WebInputEventTraits::GetUniqueTouchEventId( |
297 const WebInputEvent& event) { | 297 const WebInputEvent& event) { |
298 if (WebInputEvent::isTouchEventType(event.type)) { | 298 if (WebInputEvent::isTouchEventType(event.type)) { |
299 return static_cast<const WebTouchEvent&>(event).uniqueTouchEventId; | 299 return static_cast<const WebTouchEvent&>(event).uniqueTouchEventId; |
300 } | 300 } |
301 return 0U; | 301 return 0U; |
302 } | 302 } |
303 | 303 |
304 } // namespace content | 304 } // namespace content |
OLD | NEW |