| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 void EventGenerator::ExitPenPointerMode() { | 267 void EventGenerator::ExitPenPointerMode() { |
| 268 touch_pointer_details_.pointer_type = | 268 touch_pointer_details_.pointer_type = |
| 269 ui::EventPointerType::POINTER_TYPE_TOUCH; | 269 ui::EventPointerType::POINTER_TYPE_TOUCH; |
| 270 } | 270 } |
| 271 | 271 |
| 272 void EventGenerator::SetTouchRadius(float x, float y) { | 272 void EventGenerator::SetTouchRadius(float x, float y) { |
| 273 touch_pointer_details_.radius_x = x; | 273 touch_pointer_details_.radius_x = x; |
| 274 touch_pointer_details_.radius_y = y; | 274 touch_pointer_details_.radius_y = y; |
| 275 } | 275 } |
| 276 | 276 |
| 277 void EventGenerator::SetTouchTilt(float x, float y) { |
| 278 touch_pointer_details_.tilt_x = x; |
| 279 touch_pointer_details_.tilt_y = y; |
| 280 } |
| 281 |
| 277 void EventGenerator::PressTouch() { | 282 void EventGenerator::PressTouch() { |
| 278 PressTouchId(0); | 283 PressTouchId(0); |
| 279 } | 284 } |
| 280 | 285 |
| 281 void EventGenerator::PressTouchId(int touch_id) { | 286 void EventGenerator::PressTouchId(int touch_id) { |
| 282 TestTouchEvent touchev(ui::ET_TOUCH_PRESSED, GetLocationInCurrentRoot(), | 287 TestTouchEvent touchev(ui::ET_TOUCH_PRESSED, GetLocationInCurrentRoot(), |
| 283 touch_id, flags_, ui::EventTimeForNow()); | 288 touch_id, flags_, ui::EventTimeForNow()); |
| 284 Dispatch(&touchev); | 289 Dispatch(&touchev); |
| 285 } | 290 } |
| 286 | 291 |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 return default_delegate; | 717 return default_delegate; |
| 713 } | 718 } |
| 714 | 719 |
| 715 EventGeneratorDelegate* EventGenerator::delegate() { | 720 EventGeneratorDelegate* EventGenerator::delegate() { |
| 716 return const_cast<EventGeneratorDelegate*>( | 721 return const_cast<EventGeneratorDelegate*>( |
| 717 const_cast<const EventGenerator*>(this)->delegate()); | 722 const_cast<const EventGenerator*>(this)->delegate()); |
| 718 } | 723 } |
| 719 | 724 |
| 720 } // namespace test | 725 } // namespace test |
| 721 } // namespace ui | 726 } // namespace ui |
| OLD | NEW |