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

Side by Side Diff: ui/views/events/event.cc

Issue 10829262: views: Remove dependency on ui::TouchEvent/GestureEvent from views. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/events/event.h ('k') | ui/views/events/event_aura.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/views/events/event.h" 5 #include "ui/views/events/event.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/base/keycodes/keyboard_code_conversion.h" 8 #include "ui/base/keycodes/keyboard_code_conversion.h"
9 #include "ui/views/view.h" 9 #include "ui/views/view.h"
10 #include "ui/views/widget/root_view.h" 10 #include "ui/views/widget/root_view.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 touch_id_(model.touch_id_), 116 touch_id_(model.touch_id_),
117 radius_x_(model.radius_x_), 117 radius_x_(model.radius_x_),
118 radius_y_(model.radius_y_), 118 radius_y_(model.radius_y_),
119 rotation_angle_(model.rotation_angle_), 119 rotation_angle_(model.rotation_angle_),
120 force_(model.force_) { 120 force_(model.force_) {
121 } 121 }
122 122
123 TouchEvent::~TouchEvent() { 123 TouchEvent::~TouchEvent() {
124 } 124 }
125 125
126 ui::EventType TouchEvent::GetEventType() const {
127 return type();
128 }
129
130 gfx::Point TouchEvent::GetLocation() const {
131 return location();
132 }
133
134 int TouchEvent::GetTouchId() const {
135 return touch_id_;
136 }
137
138 int TouchEvent::GetEventFlags() const {
139 return flags();
140 }
141
142 base::TimeDelta TouchEvent::GetTimestamp() const {
143 return base::TimeDelta::FromMilliseconds(time_stamp().ToDoubleT() * 1000);
144 }
145
146 float TouchEvent::RadiusX() const {
147 return radius_x_;
148 }
149
150 float TouchEvent::RadiusY() const {
151 return radius_y_;
152 }
153
154 float TouchEvent::RotationAngle() const {
155 return rotation_angle_;
156 }
157
158 float TouchEvent::Force() const {
159 return force_;
160 }
161
162 //////////////////////////////////////////////////////////////////////////////// 126 ////////////////////////////////////////////////////////////////////////////////
163 // TouchEvent, private: 127 // TouchEvent, private:
164 128
165 TouchEvent::TouchEvent(const TouchEvent& model, View* root) 129 TouchEvent::TouchEvent(const TouchEvent& model, View* root)
166 : LocatedEvent(model, root), 130 : LocatedEvent(model, root),
167 touch_id_(model.touch_id_), 131 touch_id_(model.touch_id_),
168 radius_x_(model.radius_x_), 132 radius_x_(model.radius_x_),
169 radius_y_(model.radius_y_), 133 radius_y_(model.radius_y_),
170 rotation_angle_(model.rotation_angle_), 134 rotation_angle_(model.rotation_angle_),
171 force_(model.force_) { 135 force_(model.force_) {
(...skipping 29 matching lines...) Expand all
201 } 165 }
202 166
203 GestureEvent::GestureEvent(ui::EventType type, int x, int y, int flags) 167 GestureEvent::GestureEvent(ui::EventType type, int x, int y, int flags)
204 : LocatedEvent(type, gfx::Point(x, y), flags), 168 : LocatedEvent(type, gfx::Point(x, y), flags),
205 details_(type, 0.f, 0.f) { 169 details_(type, 0.f, 0.f) {
206 } 170 }
207 171
208 GestureEvent::~GestureEvent() { 172 GestureEvent::~GestureEvent() {
209 } 173 }
210 174
211 #if !defined(USE_AURA)
212 int GestureEvent::GetLowestTouchId() const {
213 // TODO:
214 return 0;
215 }
216 #endif
217
218 GestureEventForTest::GestureEventForTest(ui::EventType type, 175 GestureEventForTest::GestureEventForTest(ui::EventType type,
219 int x, 176 int x,
220 int y, 177 int y,
221 int flags) 178 int flags)
222 : GestureEvent(type, x, y, flags) { 179 : GestureEvent(type, x, y, flags) {
223 } 180 }
224 181
225 } // namespace views 182 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/events/event.h ('k') | ui/views/events/event_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698