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

Side by Side Diff: ui/events/test/event_generator.cc

Issue 565583005: Clean up GestureEventDetails constructors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Upload to the most recent patch Created 6 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
« no previous file with comments | « ui/events/gesture_event_details.cc ('k') | ui/views/controls/button/custom_button_unittest.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/test/event_generator.h" 5 #include "ui/events/test/event_generator.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 MoveTouch(point); 241 MoveTouch(point);
242 ReleaseTouch(); 242 ReleaseTouch();
243 } 243 }
244 244
245 void EventGenerator::PressMoveAndReleaseTouchToCenterOf(EventTarget* window) { 245 void EventGenerator::PressMoveAndReleaseTouchToCenterOf(EventTarget* window) {
246 PressMoveAndReleaseTouchTo(CenterOfWindow(window)); 246 PressMoveAndReleaseTouchTo(CenterOfWindow(window));
247 } 247 }
248 248
249 void EventGenerator::GestureEdgeSwipe() { 249 void EventGenerator::GestureEdgeSwipe() {
250 ui::GestureEvent gesture( 250 ui::GestureEvent gesture(
251 0, 251 0, 0, 0, Now(), ui::GestureEventDetails(ui::ET_GESTURE_WIN8_EDGE_SWIPE));
252 0,
253 0,
254 Now(),
255 ui::GestureEventDetails(ui::ET_GESTURE_WIN8_EDGE_SWIPE, 0, 0));
256 Dispatch(&gesture); 252 Dispatch(&gesture);
257 } 253 }
258 254
259 void EventGenerator::GestureTapAt(const gfx::Point& location) { 255 void EventGenerator::GestureTapAt(const gfx::Point& location) {
260 const int kTouchId = 2; 256 const int kTouchId = 2;
261 ui::TouchEvent press(ui::ET_TOUCH_PRESSED, 257 ui::TouchEvent press(ui::ET_TOUCH_PRESSED,
262 location, 258 location,
263 kTouchId, 259 kTouchId,
264 Now()); 260 Now());
265 Dispatch(&press); 261 Dispatch(&press);
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 return default_delegate; 623 return default_delegate;
628 } 624 }
629 625
630 EventGeneratorDelegate* EventGenerator::delegate() { 626 EventGeneratorDelegate* EventGenerator::delegate() {
631 return const_cast<EventGeneratorDelegate*>( 627 return const_cast<EventGeneratorDelegate*>(
632 const_cast<const EventGenerator*>(this)->delegate()); 628 const_cast<const EventGenerator*>(this)->delegate());
633 } 629 }
634 630
635 } // namespace test 631 } // namespace test
636 } // namespace ui 632 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/gesture_event_details.cc ('k') | ui/views/controls/button/custom_button_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698