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, | 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 Loading... |
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 |
OLD | NEW |