| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 // | 83 // |
| 84 // The caller is expected to retain ownership of instances of this class and | 84 // The caller is expected to retain ownership of instances of this class and |
| 85 // destroy them before |root_window| is destroyed. | 85 // destroy them before |root_window| is destroyed. |
| 86 class UI_CHROMEOS_EXPORT TouchExplorationController | 86 class UI_CHROMEOS_EXPORT TouchExplorationController |
| 87 : public ui::EventRewriter { | 87 : public ui::EventRewriter { |
| 88 public: | 88 public: |
| 89 explicit TouchExplorationController(aura::Window* root_window); | 89 explicit TouchExplorationController(aura::Window* root_window); |
| 90 virtual ~TouchExplorationController(); | 90 virtual ~TouchExplorationController(); |
| 91 | 91 |
| 92 void CallTapTimerNowForTesting(); | 92 void CallTapTimerNowForTesting(); |
| 93 void CallTapTimerNowIfRunningForTesting(); | |
| 94 void SetEventHandlerForTesting(ui::EventHandler* event_handler_for_testing); | 93 void SetEventHandlerForTesting(ui::EventHandler* event_handler_for_testing); |
| 95 bool IsInNoFingersDownStateForTesting() const; | 94 bool IsInNoFingersDownStateForTesting() const; |
| 96 // VLOGs should be suppressed in tests that generate a lot of logs, | |
| 97 // for example permutations of nine touch events. | |
| 98 void SuppressVLOGsForTesting(bool suppress); | |
| 99 | 95 |
| 100 private: | 96 private: |
| 101 // Overridden from ui::EventRewriter | 97 // Overridden from ui::EventRewriter |
| 102 virtual ui::EventRewriteStatus RewriteEvent( | 98 virtual ui::EventRewriteStatus RewriteEvent( |
| 103 const ui::Event& event, | 99 const ui::Event& event, |
| 104 scoped_ptr<ui::Event>* rewritten_event) OVERRIDE; | 100 scoped_ptr<ui::Event>* rewritten_event) OVERRIDE; |
| 105 virtual ui::EventRewriteStatus NextDispatchEvent( | 101 virtual ui::EventRewriteStatus NextDispatchEvent( |
| 106 const ui::Event& last_event, scoped_ptr<ui::Event>* new_event) OVERRIDE; | 102 const ui::Event& last_event, scoped_ptr<ui::Event>* new_event) OVERRIDE; |
| 107 | 103 |
| 108 // Event handlers based on the current state - see State, below. | 104 // Event handlers based on the current state - see State, below. |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 // A default gesture detector config, so we can share the same | 243 // A default gesture detector config, so we can share the same |
| 248 // timeout and pixel slop constants. | 244 // timeout and pixel slop constants. |
| 249 ui::GestureDetector::Config gesture_detector_config_; | 245 ui::GestureDetector::Config gesture_detector_config_; |
| 250 | 246 |
| 251 // The previous state entered. | 247 // The previous state entered. |
| 252 State prev_state_; | 248 State prev_state_; |
| 253 | 249 |
| 254 // A copy of the previous event passed. | 250 // A copy of the previous event passed. |
| 255 scoped_ptr<ui::TouchEvent> prev_event_; | 251 scoped_ptr<ui::TouchEvent> prev_event_; |
| 256 | 252 |
| 257 // This toggles whether VLOGS are turned on or not. | |
| 258 bool VLOG_on_; | |
| 259 | |
| 260 DISALLOW_COPY_AND_ASSIGN(TouchExplorationController); | 253 DISALLOW_COPY_AND_ASSIGN(TouchExplorationController); |
| 261 }; | 254 }; |
| 262 | 255 |
| 263 } // namespace ui | 256 } // namespace ui |
| 264 | 257 |
| 265 #endif // UI_CHROMEOS_TOUCH_EXPLORATION_CONTROLLER_H_ | 258 #endif // UI_CHROMEOS_TOUCH_EXPLORATION_CONTROLLER_H_ |
| OLD | NEW |