| 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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 void EventGenerator::MoveTouchId(const gfx::Point& point, int touch_id) { | 223 void EventGenerator::MoveTouchId(const gfx::Point& point, int touch_id) { |
| 224 current_location_ = point; | 224 current_location_ = point; |
| 225 TestTouchEvent touchev( | 225 TestTouchEvent touchev( |
| 226 ui::ET_TOUCH_MOVED, GetLocationInCurrentRoot(), touch_id, flags_); | 226 ui::ET_TOUCH_MOVED, GetLocationInCurrentRoot(), touch_id, flags_); |
| 227 Dispatch(&touchev); | 227 Dispatch(&touchev); |
| 228 | 228 |
| 229 if (!grab_) | 229 if (!grab_) |
| 230 UpdateCurrentDispatcher(point); | 230 UpdateCurrentDispatcher(point); |
| 231 } | 231 } |
| 232 | 232 |
| 233 void EventGenerator::StationaryTouch() { |
| 234 StationaryTouchId(0); |
| 235 } |
| 236 |
| 237 void EventGenerator::StationaryTouchId(int touch_id) { |
| 238 TestTouchEvent touchev( |
| 239 ui::ET_TOUCH_STATIONARY, GetLocationInCurrentRoot(), touch_id, flags_); |
| 240 Dispatch(&touchev); |
| 241 } |
| 242 |
| 233 void EventGenerator::ReleaseTouch() { | 243 void EventGenerator::ReleaseTouch() { |
| 234 ReleaseTouchId(0); | 244 ReleaseTouchId(0); |
| 235 } | 245 } |
| 236 | 246 |
| 237 void EventGenerator::ReleaseTouchId(int touch_id) { | 247 void EventGenerator::ReleaseTouchId(int touch_id) { |
| 238 TestTouchEvent touchev( | 248 TestTouchEvent touchev( |
| 239 ui::ET_TOUCH_RELEASED, GetLocationInCurrentRoot(), touch_id, flags_); | 249 ui::ET_TOUCH_RELEASED, GetLocationInCurrentRoot(), touch_id, flags_); |
| 240 Dispatch(&touchev); | 250 Dispatch(&touchev); |
| 241 } | 251 } |
| 242 | 252 |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 base::MessageLoopProxy::current()->PostTask( | 637 base::MessageLoopProxy::current()->PostTask( |
| 628 FROM_HERE, | 638 FROM_HERE, |
| 629 base::Bind(&EventGenerator::DispatchNextPendingEvent, | 639 base::Bind(&EventGenerator::DispatchNextPendingEvent, |
| 630 base::Unretained(this))); | 640 base::Unretained(this))); |
| 631 } | 641 } |
| 632 } | 642 } |
| 633 | 643 |
| 634 | 644 |
| 635 } // namespace test | 645 } // namespace test |
| 636 } // namespace aura | 646 } // namespace aura |
| OLD | NEW |