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 #ifndef UI_CHROMEOS_TOUCH_EXPLORATION_CONTROLLER_H_ | 5 #ifndef UI_CHROMEOS_TOUCH_EXPLORATION_CONTROLLER_H_ |
6 #define UI_CHROMEOS_TOUCH_EXPLORATION_CONTROLLER_H_ | 6 #define UI_CHROMEOS_TOUCH_EXPLORATION_CONTROLLER_H_ |
7 | 7 |
8 #include "base/timer/timer.h" | 8 #include "base/timer/timer.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "ui/chromeos/ui_chromeos_export.h" | 10 #include "ui/chromeos/ui_chromeos_export.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 // The caller is expected to retain ownership of instances of this class and | 97 // The caller is expected to retain ownership of instances of this class and |
98 // destroy them before |root_window| is destroyed. | 98 // destroy them before |root_window| is destroyed. |
99 class UI_CHROMEOS_EXPORT TouchExplorationController | 99 class UI_CHROMEOS_EXPORT TouchExplorationController |
100 : public ui::EventRewriter, | 100 : public ui::EventRewriter, |
101 public ui::GestureProviderAuraClient { | 101 public ui::GestureProviderAuraClient { |
102 public: | 102 public: |
103 explicit TouchExplorationController(aura::Window* root_window); | 103 explicit TouchExplorationController(aura::Window* root_window); |
104 virtual ~TouchExplorationController(); | 104 virtual ~TouchExplorationController(); |
105 | 105 |
106 void CallTapTimerNowForTesting(); | 106 void CallTapTimerNowForTesting(); |
| 107 void CallTapTimerNowIfRunningForTesting(); |
107 void SetEventHandlerForTesting(ui::EventHandler* event_handler_for_testing); | 108 void SetEventHandlerForTesting(ui::EventHandler* event_handler_for_testing); |
108 bool IsInNoFingersDownStateForTesting() const; | 109 bool IsInNoFingersDownStateForTesting() const; |
109 bool IsInGestureInProgressStateForTesting() const; | 110 bool IsInGestureInProgressStateForTesting() const; |
| 111 // VLOGs should be suppressed in tests that generate a lot of logs, |
| 112 // for example permutations of nine touch events. |
| 113 void SuppressVLOGsForTesting(bool suppress); |
110 | 114 |
111 private: | 115 private: |
112 // Overridden from ui::EventRewriter | 116 // Overridden from ui::EventRewriter |
113 virtual ui::EventRewriteStatus RewriteEvent( | 117 virtual ui::EventRewriteStatus RewriteEvent( |
114 const ui::Event& event, | 118 const ui::Event& event, |
115 scoped_ptr<ui::Event>* rewritten_event) OVERRIDE; | 119 scoped_ptr<ui::Event>* rewritten_event) OVERRIDE; |
116 virtual ui::EventRewriteStatus NextDispatchEvent( | 120 virtual ui::EventRewriteStatus NextDispatchEvent( |
117 const ui::Event& last_event, scoped_ptr<ui::Event>* new_event) OVERRIDE; | 121 const ui::Event& last_event, scoped_ptr<ui::Event>* new_event) OVERRIDE; |
118 | 122 |
119 // Event handlers based on the current state - see State, below. | 123 // Event handlers based on the current state - see State, below. |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 | 293 |
290 // Gesture Handler to interpret the touch events. | 294 // Gesture Handler to interpret the touch events. |
291 ui::GestureProviderAura gesture_provider_; | 295 ui::GestureProviderAura gesture_provider_; |
292 | 296 |
293 // The previous state entered. | 297 // The previous state entered. |
294 State prev_state_; | 298 State prev_state_; |
295 | 299 |
296 // A copy of the previous event passed. | 300 // A copy of the previous event passed. |
297 scoped_ptr<ui::TouchEvent> prev_event_; | 301 scoped_ptr<ui::TouchEvent> prev_event_; |
298 | 302 |
| 303 // This toggles whether VLOGS are turned on or not. |
| 304 bool VLOG_on_; |
| 305 |
299 DISALLOW_COPY_AND_ASSIGN(TouchExplorationController); | 306 DISALLOW_COPY_AND_ASSIGN(TouchExplorationController); |
300 }; | 307 }; |
301 | 308 |
302 } // namespace ui | 309 } // namespace ui |
303 | 310 |
304 #endif // UI_CHROMEOS_TOUCH_EXPLORATION_CONTROLLER_H_ | 311 #endif // UI_CHROMEOS_TOUCH_EXPLORATION_CONTROLLER_H_ |
OLD | NEW |