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

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

Issue 10790019: Add gesture target fuzzing to views (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Patch with unit tests 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
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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 //////////////////////////////////////////////////////////////////////////////// 209 ////////////////////////////////////////////////////////////////////////////////
210 // GestureEvent, public: 210 // GestureEvent, public:
211 211
212 GestureEvent::GestureEvent(const GestureEvent& model, View* source, 212 GestureEvent::GestureEvent(const GestureEvent& model, View* source,
213 View* target) 213 View* target)
214 : LocatedEvent(model, source, target), 214 : LocatedEvent(model, source, target),
215 details_(model.details_) { 215 details_(model.details_) {
216 } 216 }
217 217
218 //////////////////////////////////////////////////////////////////////////////// 218 ////////////////////////////////////////////////////////////////////////////////
219 // GestureEvent, protected:
220
221 GestureEvent::GestureEvent(ui::EventType type, int x, int y, int flags)
222 : LocatedEvent(type, gfx::Point(x, y), flags),
223 details_(type, 0.f, 0.f) {
224 }
225
226 GestureEvent::GestureEvent(ui::EventType type,
227 int x,
228 int y,
229 int flags,
230 ui::GestureEventDetails details)
231 : LocatedEvent(type, gfx::Point(x, y), flags),
232 details_(details) {
233 }
234
235 ////////////////////////////////////////////////////////////////////////////////
219 // GestureEvent, private: 236 // GestureEvent, private:
220 237
221 GestureEvent::GestureEvent(const GestureEvent& model, View* root) 238 GestureEvent::GestureEvent(const GestureEvent& model, View* root)
222 : LocatedEvent(model, root), 239 : LocatedEvent(model, root),
223 details_(model.details_) { 240 details_(model.details_) {
224 } 241 }
225 242
226 GestureEvent::GestureEvent(ui::EventType type, int x, int y, int flags)
227 : LocatedEvent(type, gfx::Point(x, y), flags),
228 details_(type, 0.f, 0.f) {
229 }
230
231 GestureEvent::~GestureEvent() { 243 GestureEvent::~GestureEvent() {
232 } 244 }
233 245
234 #if !defined(USE_AURA) 246 #if !defined(USE_AURA)
235 int GestureEvent::GetLowestTouchId() const { 247 int GestureEvent::GetLowestTouchId() const {
236 // TODO: 248 // TODO:
237 return 0; 249 return 0;
238 } 250 }
239 #endif 251 #endif
240 252
241 GestureEventForTest::GestureEventForTest(ui::EventType type, 253 GestureEventForTest::GestureEventForTest(ui::EventType type,
242 int x, 254 int x,
243 int y, 255 int y,
244 int flags) 256 int flags)
245 : GestureEvent(type, x, y, flags) { 257 : GestureEvent(type, x, y, flags) {
246 } 258 }
247 259
260 GestureEventForTest::GestureEventForTest(ui::EventType type,
261 int x,
262 int y,
263 int flags,
264 ui::GestureEventDetails details)
265 : GestureEvent(type, x, y, flags, details) {
266 }
267
248 } // namespace views 268 } // namespace views
OLDNEW
« ui/views/events/event.h ('K') | « ui/views/events/event.h ('k') | ui/views/view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698