Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

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

Issue 1187273004: Pass MotionEvent tilt angles to Blink on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 event.data.scrollUpdate.deltaX, 86 event.data.scrollUpdate.deltaX,
87 event.data.scrollUpdate.deltaY, 87 event.data.scrollUpdate.deltaY,
88 event.data.scrollUpdate.velocityX, 88 event.data.scrollUpdate.velocityX,
89 event.data.scrollUpdate.velocityY, 89 event.data.scrollUpdate.velocityY,
90 event.data.scrollUpdate.previousUpdateInSequencePrevented); 90 event.data.scrollUpdate.previousUpdateInSequencePrevented);
91 } 91 }
92 92
93 void ApppendTouchPointDetails(const WebTouchPoint& point, std::string* result) { 93 void ApppendTouchPointDetails(const WebTouchPoint& point, std::string* result) {
94 StringAppendF(result, 94 StringAppendF(result,
95 " (ID: %d, State: %d, ScreenPos: (%f, %f), Pos: (%f, %f)," 95 " (ID: %d, State: %d, ScreenPos: (%f, %f), Pos: (%f, %f),"
96 " Radius: (%f, %f), Rot: %f, Force: %f),\n", 96 " Radius: (%f, %f), Rot: %f, Force: %f,"
97 " Tilt: (%d, %d)),\n",
97 point.id, 98 point.id,
98 point.state, 99 point.state,
99 point.screenPosition.x, 100 point.screenPosition.x,
100 point.screenPosition.y, 101 point.screenPosition.y,
101 point.position.x, 102 point.position.x,
102 point.position.y, 103 point.position.y,
103 point.radiusX, 104 point.radiusX,
104 point.radiusY, 105 point.radiusY,
105 point.rotationAngle, 106 point.rotationAngle,
106 point.force); 107 point.force,
108 point.tiltX,
109 point.tiltY);
107 } 110 }
108 111
109 void ApppendEventDetails(const WebTouchEvent& event, std::string* result) { 112 void ApppendEventDetails(const WebTouchEvent& event, std::string* result) {
110 StringAppendF(result, 113 StringAppendF(result,
111 "{\n Touches: %u, Cancelable: %d, CausesScrolling: %d," 114 "{\n Touches: %u, Cancelable: %d, CausesScrolling: %d,"
112 " uniqueTouchEventId: %u\n[\n", 115 " uniqueTouchEventId: %u\n[\n",
113 event.touchesLength, event.cancelable, 116 event.touchesLength, event.cancelable,
114 event.causesScrollingIfUncanceled, event.uniqueTouchEventId); 117 event.causesScrollingIfUncanceled, event.uniqueTouchEventId);
115 for (unsigned i = 0; i < event.touchesLength; ++i) 118 for (unsigned i = 0; i < event.touchesLength; ++i)
116 ApppendTouchPointDetails(event.touches[i], result); 119 ApppendTouchPointDetails(event.touches[i], result);
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 } 491 }
489 492
490 uint32 WebInputEventTraits::GetUniqueTouchEventId(const WebInputEvent& event) { 493 uint32 WebInputEventTraits::GetUniqueTouchEventId(const WebInputEvent& event) {
491 if (WebInputEvent::isTouchEventType(event.type)) { 494 if (WebInputEvent::isTouchEventType(event.type)) {
492 return static_cast<const WebTouchEvent&>(event).uniqueTouchEventId; 495 return static_cast<const WebTouchEvent&>(event).uniqueTouchEventId;
493 } 496 }
494 return 0U; 497 return 0U;
495 } 498 }
496 499
497 } // namespace content 500 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698