Chromium Code Reviews

Side by Side Diff: content/common/input/web_input_event_traits.cc

Issue 755403006: Added experimental Touch.tilt, Touch.tiltDirection support for Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
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 <bitset> 7 #include <bitset>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 74 matching lines...)
85 event.data.scrollUpdate.deltaX, 85 event.data.scrollUpdate.deltaX,
86 event.data.scrollUpdate.deltaY, 86 event.data.scrollUpdate.deltaY,
87 event.data.scrollUpdate.velocityX, 87 event.data.scrollUpdate.velocityX,
88 event.data.scrollUpdate.velocityY, 88 event.data.scrollUpdate.velocityY,
89 event.data.scrollUpdate.previousUpdateInSequencePrevented); 89 event.data.scrollUpdate.previousUpdateInSequencePrevented);
90 } 90 }
91 91
92 void ApppendTouchPointDetails(const WebTouchPoint& point, std::string* result) { 92 void ApppendTouchPointDetails(const WebTouchPoint& point, std::string* result) {
93 StringAppendF(result, 93 StringAppendF(result,
94 " (ID: %d, State: %d, ScreenPos: (%f, %f), Pos: (%f, %f)," 94 " (ID: %d, State: %d, ScreenPos: (%f, %f), Pos: (%f, %f),"
95 " Radius: (%f, %f), Rot: %f, Force: %f),\n", 95 " Radius: (%f, %f), Rot: %f, Tilt: %f, Force: %f),\n",
96 point.id, 96 point.id,
97 point.state, 97 point.state,
98 point.screenPosition.x, 98 point.screenPosition.x,
99 point.screenPosition.y, 99 point.screenPosition.y,
100 point.position.x, 100 point.position.x,
101 point.position.y, 101 point.position.y,
102 point.radiusX, 102 point.radiusX,
103 point.radiusY, 103 point.radiusY,
104 point.rotationAngle, 104 point.rotationAngle,
105 point.tilt,
105 point.force); 106 point.force);
106 } 107 }
107 108
108 void ApppendEventDetails(const WebTouchEvent& event, std::string* result) { 109 void ApppendEventDetails(const WebTouchEvent& event, std::string* result) {
109 StringAppendF(result, 110 StringAppendF(result,
110 "{\n Touches: %u, Cancelable: %d, CausesScrolling: %d\n[\n", 111 "{\n Touches: %u, Cancelable: %d, CausesScrolling: %d\n[\n",
111 event.touchesLength, 112 event.touchesLength,
112 event.cancelable, 113 event.cancelable,
113 event.causesScrollingIfUncanceled); 114 event.causesScrollingIfUncanceled);
114 for (unsigned i = 0; i < event.touchesLength; ++i) 115 for (unsigned i = 0; i < event.touchesLength; ++i)
(...skipping 363 matching lines...)
478 case WebInputEvent::TouchStart: 479 case WebInputEvent::TouchStart:
479 case WebInputEvent::TouchMove: 480 case WebInputEvent::TouchMove:
480 case WebInputEvent::TouchEnd: 481 case WebInputEvent::TouchEnd:
481 return !static_cast<const WebTouchEvent&>(event).cancelable; 482 return !static_cast<const WebTouchEvent&>(event).cancelable;
482 default: 483 default:
483 return false; 484 return false;
484 } 485 }
485 } 486 }
486 487
487 } // namespace content 488 } // namespace content
OLDNEW

Powered by Google App Engine