| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 // | 96 // |
| 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 private: |
| 107 void CallTapTimerNowIfRunningForTesting(); | 107 friend class TouchExplorationControllerTestApi; |
| 108 void SetEventHandlerForTesting(ui::EventHandler* event_handler_for_testing); | |
| 109 bool IsInNoFingersDownStateForTesting() 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); | |
| 114 | 108 |
| 115 private: | |
| 116 // Overridden from ui::EventRewriter | 109 // Overridden from ui::EventRewriter |
| 117 virtual ui::EventRewriteStatus RewriteEvent( | 110 virtual ui::EventRewriteStatus RewriteEvent( |
| 118 const ui::Event& event, | 111 const ui::Event& event, |
| 119 scoped_ptr<ui::Event>* rewritten_event) OVERRIDE; | 112 scoped_ptr<ui::Event>* rewritten_event) OVERRIDE; |
| 120 virtual ui::EventRewriteStatus NextDispatchEvent( | 113 virtual ui::EventRewriteStatus NextDispatchEvent( |
| 121 const ui::Event& last_event, scoped_ptr<ui::Event>* new_event) OVERRIDE; | 114 const ui::Event& last_event, scoped_ptr<ui::Event>* new_event) OVERRIDE; |
| 122 | 115 |
| 123 // Event handlers based on the current state - see State, below. | 116 // Event handlers based on the current state - see State, below. |
| 124 ui::EventRewriteStatus InNoFingersDown( | 117 ui::EventRewriteStatus InNoFingersDown( |
| 125 const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event); | 118 const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event); |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 | 295 |
| 303 // This toggles whether VLOGS are turned on or not. | 296 // This toggles whether VLOGS are turned on or not. |
| 304 bool VLOG_on_; | 297 bool VLOG_on_; |
| 305 | 298 |
| 306 DISALLOW_COPY_AND_ASSIGN(TouchExplorationController); | 299 DISALLOW_COPY_AND_ASSIGN(TouchExplorationController); |
| 307 }; | 300 }; |
| 308 | 301 |
| 309 } // namespace ui | 302 } // namespace ui |
| 310 | 303 |
| 311 #endif // UI_CHROMEOS_TOUCH_EXPLORATION_CONTROLLER_H_ | 304 #endif // UI_CHROMEOS_TOUCH_EXPLORATION_CONTROLLER_H_ |
| OLD | NEW |