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

Side by Side Diff: ui/events/ozone/events_ozone.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: Added EventSender.SetTouchPointTilt() for tests Created 5 years, 10 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "ui/events/ozone/events_ozone.h" 5 #include "ui/events/ozone/events_ozone.h"
6 6
7 #include "ui/events/event.h" 7 #include "ui/events/event.h"
8 #include "ui/events/event_constants.h" 8 #include "ui/events/event_constants.h"
9 #include "ui/events/event_utils.h" 9 #include "ui/events/event_utils.h"
10 10
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 return event->radius_y(); 113 return event->radius_y();
114 } 114 }
115 115
116 float GetTouchAngle(const base::NativeEvent& native_event) { 116 float GetTouchAngle(const base::NativeEvent& native_event) {
117 const ui::TouchEvent* event = 117 const ui::TouchEvent* event =
118 static_cast<const ui::TouchEvent*>(native_event); 118 static_cast<const ui::TouchEvent*>(native_event);
119 DCHECK(event->IsTouchEvent()); 119 DCHECK(event->IsTouchEvent());
120 return event->rotation_angle(); 120 return event->rotation_angle();
121 } 121 }
122 122
123 float GetTouchTilt(const base::NativeEvent& native_event) {
124 NOTIMPLEMENTED();
125 return 0.0f;
126 }
127
128 float GetTouchTiltDirection(const base::NativeEvent& native_event) {
129 NOTIMPLEMENTED();
130 return 0.0f;
131 }
132
123 float GetTouchForce(const base::NativeEvent& native_event) { 133 float GetTouchForce(const base::NativeEvent& native_event) {
124 const ui::TouchEvent* event = 134 const ui::TouchEvent* event =
125 static_cast<const ui::TouchEvent*>(native_event); 135 static_cast<const ui::TouchEvent*>(native_event);
126 DCHECK(event->IsTouchEvent()); 136 DCHECK(event->IsTouchEvent());
127 return event->force(); 137 return event->force();
128 } 138 }
129 139
130 bool GetScrollOffsets(const base::NativeEvent& native_event, 140 bool GetScrollOffsets(const base::NativeEvent& native_event,
131 float* x_offset, 141 float* x_offset,
132 float* y_offset, 142 float* y_offset,
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 callback.Run(&touch_event); 205 callback.Run(&touch_event);
196 } else if (native_ui_event->IsScrollEvent()) { 206 } else if (native_ui_event->IsScrollEvent()) {
197 ui::ScrollEvent scroll_event(native_event); 207 ui::ScrollEvent scroll_event(native_event);
198 callback.Run(&scroll_event); 208 callback.Run(&scroll_event);
199 } else { 209 } else {
200 NOTREACHED(); 210 NOTREACHED();
201 } 211 }
202 } 212 }
203 213
204 } // namespace ui 214 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698