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

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: Created 6 years 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
123 float GetTouchForce(const base::NativeEvent& native_event) { 128 float GetTouchForce(const base::NativeEvent& native_event) {
124 const ui::TouchEvent* event = 129 const ui::TouchEvent* event =
125 static_cast<const ui::TouchEvent*>(native_event); 130 static_cast<const ui::TouchEvent*>(native_event);
126 DCHECK(event->IsTouchEvent()); 131 DCHECK(event->IsTouchEvent());
127 return event->force(); 132 return event->force();
128 } 133 }
129 134
130 bool GetScrollOffsets(const base::NativeEvent& native_event, 135 bool GetScrollOffsets(const base::NativeEvent& native_event,
131 float* x_offset, 136 float* x_offset,
132 float* y_offset, 137 float* y_offset,
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 callback.Run(&touch_event); 197 callback.Run(&touch_event);
193 } else if (native_ui_event->IsScrollEvent()) { 198 } else if (native_ui_event->IsScrollEvent()) {
194 ui::ScrollEvent scroll_event(native_event); 199 ui::ScrollEvent scroll_event(native_event);
195 callback.Run(&scroll_event); 200 callback.Run(&scroll_event);
196 } else { 201 } else {
197 NOTREACHED(); 202 NOTREACHED();
198 } 203 }
199 } 204 }
200 205
201 } // namespace ui 206 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698