| 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 #ifndef UI_AURA_TEST_EVENT_GENERATOR_H_ | 5 #ifndef UI_AURA_TEST_EVENT_GENERATOR_H_ |
| 6 #define UI_AURA_TEST_EVENT_GENERATOR_H_ | 6 #define UI_AURA_TEST_EVENT_GENERATOR_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 // | 80 // |
| 81 // If one of these applies to your test, please use |ui_controls| | 81 // If one of these applies to your test, please use |ui_controls| |
| 82 // package instead. | 82 // package instead. |
| 83 // | 83 // |
| 84 // Note: The coordinates of the points in API is determined by the | 84 // Note: The coordinates of the points in API is determined by the |
| 85 // EventGeneratorDelegate. | 85 // EventGeneratorDelegate. |
| 86 class EventGenerator { | 86 class EventGenerator { |
| 87 public: | 87 public: |
| 88 // Creates an EventGenerator with the mouse/touch location (0,0), | 88 // Creates an EventGenerator with the mouse/touch location (0,0), |
| 89 // which uses the |root_window|'s coordinates. | 89 // which uses the |root_window|'s coordinates. |
| 90 explicit EventGenerator(RootWindow* root_window); | 90 explicit EventGenerator(Window* root_window); |
| 91 | 91 |
| 92 // Create an EventGenerator with EventGeneratorDelegate, | 92 // Create an EventGenerator with EventGeneratorDelegate, |
| 93 // which uses the coordinates used by |delegate|. | 93 // which uses the coordinates used by |delegate|. |
| 94 explicit EventGenerator(EventGeneratorDelegate* delegate); | 94 explicit EventGenerator(EventGeneratorDelegate* delegate); |
| 95 | 95 |
| 96 // Creates an EventGenerator with the mouse/touch location | 96 // Creates an EventGenerator with the mouse/touch location |
| 97 // at |initial_location|, which uses the |root_window|'s coordinates. | 97 // at |initial_location|, which uses the |root_window|'s coordinates. |
| 98 EventGenerator(RootWindow* root_window, const gfx::Point& initial_location); | 98 EventGenerator(Window* root_window, const gfx::Point& initial_location); |
| 99 | 99 |
| 100 // Creates an EventGenerator with the mouse/touch location | 100 // Creates an EventGenerator with the mouse/touch location |
| 101 // centered over |window|, which uses the |root_window|'s coordinates. | 101 // centered over |window|, which uses the |root_window|'s coordinates. |
| 102 EventGenerator(RootWindow* root_window, Window* window); | 102 EventGenerator(Window* root_window, Window* window); |
| 103 | 103 |
| 104 virtual ~EventGenerator(); | 104 virtual ~EventGenerator(); |
| 105 | 105 |
| 106 // Explicitly sets the location used by mouse/touch events. This is set by the | 106 // Explicitly sets the location used by mouse/touch events. This is set by the |
| 107 // various methods that take a location but can be manipulated directly, | 107 // various methods that take a location but can be manipulated directly, |
| 108 // typically for touch. | 108 // typically for touch. |
| 109 void set_current_location(const gfx::Point& location) { | 109 void set_current_location(const gfx::Point& location) { |
| 110 current_location_ = location; | 110 current_location_ = location; |
| 111 } | 111 } |
| 112 const gfx::Point& current_location() const { return current_location_; } | 112 const gfx::Point& current_location() const { return current_location_; } |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 // Set to true to cause events to be posted asynchronously. | 314 // Set to true to cause events to be posted asynchronously. |
| 315 bool async_; | 315 bool async_; |
| 316 | 316 |
| 317 DISALLOW_COPY_AND_ASSIGN(EventGenerator); | 317 DISALLOW_COPY_AND_ASSIGN(EventGenerator); |
| 318 }; | 318 }; |
| 319 | 319 |
| 320 } // namespace test | 320 } // namespace test |
| 321 } // namespace aura | 321 } // namespace aura |
| 322 | 322 |
| 323 #endif // UI_AURA_TEST_EVENT_GENERATOR_H_ | 323 #endif // UI_AURA_TEST_EVENT_GENERATOR_H_ |
| OLD | NEW |