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

Side by Side Diff: ui/events/ozone/events_ozone.cc

Issue 1300803003: Drop ui::TouchEvent shims for radius_{x,y} and force (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 3 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 const ui::TouchEvent* event = 93 const ui::TouchEvent* event =
94 static_cast<const ui::TouchEvent*>(native_event); 94 static_cast<const ui::TouchEvent*>(native_event);
95 DCHECK(event->IsTouchEvent()); 95 DCHECK(event->IsTouchEvent());
96 return event->touch_id(); 96 return event->touch_id();
97 } 97 }
98 98
99 float GetTouchRadiusX(const base::NativeEvent& native_event) { 99 float GetTouchRadiusX(const base::NativeEvent& native_event) {
100 const ui::TouchEvent* event = 100 const ui::TouchEvent* event =
101 static_cast<const ui::TouchEvent*>(native_event); 101 static_cast<const ui::TouchEvent*>(native_event);
102 DCHECK(event->IsTouchEvent()); 102 DCHECK(event->IsTouchEvent());
103 return event->radius_x(); 103 return event->pointer_details().radius_x();
104 } 104 }
105 105
106 float GetTouchRadiusY(const base::NativeEvent& native_event) { 106 float GetTouchRadiusY(const base::NativeEvent& native_event) {
107 const ui::TouchEvent* event = 107 const ui::TouchEvent* event =
108 static_cast<const ui::TouchEvent*>(native_event); 108 static_cast<const ui::TouchEvent*>(native_event);
109 DCHECK(event->IsTouchEvent()); 109 DCHECK(event->IsTouchEvent());
110 return event->radius_y(); 110 return event->pointer_details().radius_y();
111 } 111 }
112 112
113 float GetTouchAngle(const base::NativeEvent& native_event) { 113 float GetTouchAngle(const base::NativeEvent& native_event) {
114 const ui::TouchEvent* event = 114 const ui::TouchEvent* event =
115 static_cast<const ui::TouchEvent*>(native_event); 115 static_cast<const ui::TouchEvent*>(native_event);
116 DCHECK(event->IsTouchEvent()); 116 DCHECK(event->IsTouchEvent());
117 return event->rotation_angle(); 117 return event->rotation_angle();
118 } 118 }
119 119
120 float GetTouchForce(const base::NativeEvent& native_event) { 120 float GetTouchForce(const base::NativeEvent& native_event) {
121 const ui::TouchEvent* event = 121 const ui::TouchEvent* event =
122 static_cast<const ui::TouchEvent*>(native_event); 122 static_cast<const ui::TouchEvent*>(native_event);
123 DCHECK(event->IsTouchEvent()); 123 DCHECK(event->IsTouchEvent());
124 return event->force(); 124 return event->pointer_details().force();
125 } 125 }
126 126
127 bool GetScrollOffsets(const base::NativeEvent& native_event, 127 bool GetScrollOffsets(const base::NativeEvent& native_event,
128 float* x_offset, 128 float* x_offset,
129 float* y_offset, 129 float* y_offset,
130 float* x_offset_ordinal, 130 float* x_offset_ordinal,
131 float* y_offset_ordinal, 131 float* y_offset_ordinal,
132 int* finger_count) { 132 int* finger_count) {
133 const ui::ScrollEvent* event = 133 const ui::ScrollEvent* event =
134 static_cast<const ui::ScrollEvent*>(native_event); 134 static_cast<const ui::ScrollEvent*>(native_event);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 callback.Run(&touch_event); 192 callback.Run(&touch_event);
193 } else if (native_ui_event->IsScrollEvent()) { 193 } else if (native_ui_event->IsScrollEvent()) {
194 ui::ScrollEvent scroll_event(native_event); 194 ui::ScrollEvent scroll_event(native_event);
195 callback.Run(&scroll_event); 195 callback.Run(&scroll_event);
196 } else { 196 } else {
197 NOTREACHED(); 197 NOTREACHED();
198 } 198 }
199 } 199 }
200 200
201 } // namespace ui 201 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/gestures/motion_event_aura.cc ('k') | ui/ozone/platform/egltest/ozone_platform_egltest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698