OLD | NEW |
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 Loading... |
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, 0, 0, Now(), ui::GestureEventDetails(ui::ET_GESTURE_WIN8_EDGE_SWIPE)); | 251 0, |
| 252 0, |
| 253 0, |
| 254 Now(), |
| 255 ui::GestureEventDetails(ui::ET_GESTURE_WIN8_EDGE_SWIPE, 0, 0)); |
252 Dispatch(&gesture); | 256 Dispatch(&gesture); |
253 } | 257 } |
254 | 258 |
255 void EventGenerator::GestureTapAt(const gfx::Point& location) { | 259 void EventGenerator::GestureTapAt(const gfx::Point& location) { |
256 const int kTouchId = 2; | 260 const int kTouchId = 2; |
257 ui::TouchEvent press(ui::ET_TOUCH_PRESSED, | 261 ui::TouchEvent press(ui::ET_TOUCH_PRESSED, |
258 location, | 262 location, |
259 kTouchId, | 263 kTouchId, |
260 Now()); | 264 Now()); |
261 Dispatch(&press); | 265 Dispatch(&press); |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 return default_delegate; | 627 return default_delegate; |
624 } | 628 } |
625 | 629 |
626 EventGeneratorDelegate* EventGenerator::delegate() { | 630 EventGeneratorDelegate* EventGenerator::delegate() { |
627 return const_cast<EventGeneratorDelegate*>( | 631 return const_cast<EventGeneratorDelegate*>( |
628 const_cast<const EventGenerator*>(this)->delegate()); | 632 const_cast<const EventGenerator*>(this)->delegate()); |
629 } | 633 } |
630 | 634 |
631 } // namespace test | 635 } // namespace test |
632 } // namespace ui | 636 } // namespace ui |
OLD | NEW |