| 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 #if defined(OS_WIN) |
| 252 void EventGenerator::GestureEdgeSwipe() { |
| 253 ui::GestureEvent gesture( |
| 254 ui::ET_GESTURE_WIN8_EDGE_SWIPE, |
| 255 0, |
| 256 0, |
| 257 0, |
| 258 ui::EventTimeForNow(), |
| 259 ui::GestureEventDetails(ui::ET_GESTURE_WIN8_EDGE_SWIPE, 0, 0), |
| 260 0); |
| 261 Dispatch(&gesture); |
| 262 } |
| 263 #endif |
| 264 |
| 251 void EventGenerator::GestureTapAt(const gfx::Point& location) { | 265 void EventGenerator::GestureTapAt(const gfx::Point& location) { |
| 252 const int kTouchId = 2; | 266 const int kTouchId = 2; |
| 253 ui::TouchEvent press(ui::ET_TOUCH_PRESSED, | 267 ui::TouchEvent press(ui::ET_TOUCH_PRESSED, |
| 254 location, | 268 location, |
| 255 kTouchId, | 269 kTouchId, |
| 256 ui::EventTimeForNow()); | 270 ui::EventTimeForNow()); |
| 257 Dispatch(&press); | 271 Dispatch(&press); |
| 258 | 272 |
| 259 ui::TouchEvent release( | 273 ui::TouchEvent release( |
| 260 ui::ET_TOUCH_RELEASED, location, kTouchId, | 274 ui::ET_TOUCH_RELEASED, location, kTouchId, |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 base::MessageLoopProxy::current()->PostTask( | 625 base::MessageLoopProxy::current()->PostTask( |
| 612 FROM_HERE, | 626 FROM_HERE, |
| 613 base::Bind(&EventGenerator::DispatchNextPendingEvent, | 627 base::Bind(&EventGenerator::DispatchNextPendingEvent, |
| 614 base::Unretained(this))); | 628 base::Unretained(this))); |
| 615 } | 629 } |
| 616 } | 630 } |
| 617 | 631 |
| 618 | 632 |
| 619 } // namespace test | 633 } // namespace test |
| 620 } // namespace aura | 634 } // namespace aura |
| OLD | NEW |