| OLD | NEW |
| 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/aura/test/event_generator.h" | 5 #include "ui/aura/test/event_generator.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
| 10 #include "ui/aura/client/screen_position_client.h" | 10 #include "ui/aura/client/screen_position_client.h" |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 void EventGenerator::PressMoveAndReleaseTouchTo(const gfx::Point& point) { | 241 void EventGenerator::PressMoveAndReleaseTouchTo(const gfx::Point& point) { |
| 242 PressTouch(); | 242 PressTouch(); |
| 243 MoveTouch(point); | 243 MoveTouch(point); |
| 244 ReleaseTouch(); | 244 ReleaseTouch(); |
| 245 } | 245 } |
| 246 | 246 |
| 247 void EventGenerator::PressMoveAndReleaseTouchToCenterOf(Window* window) { | 247 void EventGenerator::PressMoveAndReleaseTouchToCenterOf(Window* window) { |
| 248 PressMoveAndReleaseTouchTo(CenterOfWindow(window)); | 248 PressMoveAndReleaseTouchTo(CenterOfWindow(window)); |
| 249 } | 249 } |
| 250 | 250 |
| 251 void EventGenerator::GestureEdgeSwipe() { |
| 252 ui::GestureEvent gesture( |
| 253 ui::ET_GESTURE_WIN8_EDGE_SWIPE, |
| 254 0, |
| 255 0, |
| 256 0, |
| 257 ui::EventTimeForNow(), |
| 258 ui::GestureEventDetails(ui::ET_GESTURE_WIN8_EDGE_SWIPE, 0, 0), |
| 259 0); |
| 260 Dispatch(&gesture); |
| 261 } |
| 262 |
| 251 void EventGenerator::GestureTapAt(const gfx::Point& location) { | 263 void EventGenerator::GestureTapAt(const gfx::Point& location) { |
| 252 const int kTouchId = 2; | 264 const int kTouchId = 2; |
| 253 ui::TouchEvent press(ui::ET_TOUCH_PRESSED, | 265 ui::TouchEvent press(ui::ET_TOUCH_PRESSED, |
| 254 location, | 266 location, |
| 255 kTouchId, | 267 kTouchId, |
| 256 ui::EventTimeForNow()); | 268 ui::EventTimeForNow()); |
| 257 Dispatch(&press); | 269 Dispatch(&press); |
| 258 | 270 |
| 259 ui::TouchEvent release( | 271 ui::TouchEvent release( |
| 260 ui::ET_TOUCH_RELEASED, location, kTouchId, | 272 ui::ET_TOUCH_RELEASED, location, kTouchId, |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 base::MessageLoopProxy::current()->PostTask( | 623 base::MessageLoopProxy::current()->PostTask( |
| 612 FROM_HERE, | 624 FROM_HERE, |
| 613 base::Bind(&EventGenerator::DispatchNextPendingEvent, | 625 base::Bind(&EventGenerator::DispatchNextPendingEvent, |
| 614 base::Unretained(this))); | 626 base::Unretained(this))); |
| 615 } | 627 } |
| 616 } | 628 } |
| 617 | 629 |
| 618 | 630 |
| 619 } // namespace test | 631 } // namespace test |
| 620 } // namespace aura | 632 } // namespace aura |
| OLD | NEW |