Chromium Code Reviews| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 98 ui::EventRewriteStatus InSingleTapPressed( | 98 ui::EventRewriteStatus InSingleTapPressed( |
| 99 const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event); | 99 const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event); |
| 100 ui::EventRewriteStatus InSingleTapReleased( | 100 ui::EventRewriteStatus InSingleTapReleased( |
| 101 const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event); | 101 const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event); |
| 102 ui::EventRewriteStatus InDoubleTapPressed( | 102 ui::EventRewriteStatus InDoubleTapPressed( |
| 103 const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event); | 103 const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event); |
| 104 ui::EventRewriteStatus InTouchExploration( | 104 ui::EventRewriteStatus InTouchExploration( |
| 105 const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event); | 105 const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event); |
| 106 ui::EventRewriteStatus InPassthroughMinusOne( | 106 ui::EventRewriteStatus InPassthroughMinusOne( |
| 107 const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event); | 107 const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event); |
| 108 | 108 ui::EventRewriteStatus InTESecondPress( |
|
dmazzoni
2014/06/13 05:52:38
TE is too abbreviated for me. How about InTouchExp
evy
2014/06/13 16:48:07
Done.
Should the state name be changed from TE_SEC
| |
| 109 const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event); | |
| 109 // This timer is started every time we get the first press event, and | 110 // This timer is started every time we get the first press event, and |
| 110 // it fires after the double-click timeout elapses (300 ms by default). | 111 // it fires after the double-click timeout elapses (300 ms by default). |
| 111 // If the user taps and releases within 300 ms and doesn't press again, | 112 // If the user taps and releases within 300 ms and doesn't press again, |
| 112 // we treat that as a single mouse move (touch exploration) event. | 113 // we treat that as a single mouse move (touch exploration) event. |
| 113 void OnTapTimerFired(); | 114 void OnTapTimerFired(); |
| 114 | 115 |
| 115 // Dispatch a new event outside of the event rewriting flow. | 116 // Dispatch a new event outside of the event rewriting flow. |
| 116 void DispatchEvent(ui::Event* event); | 117 void DispatchEvent(ui::Event* event); |
| 117 | 118 |
| 118 scoped_ptr<ui::Event> CreateMouseMoveEvent(const gfx::PointF& location, | 119 scoped_ptr<ui::Event> CreateMouseMoveEvent(const gfx::PointF& location, |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 152 | 153 |
| 153 // The user placed two or more fingers down within the grace period. | 154 // The user placed two or more fingers down within the grace period. |
| 154 // We're now in passthrough mode until all fingers are lifted. Initially | 155 // We're now in passthrough mode until all fingers are lifted. Initially |
| 155 // the first finger is ignored and other fingers are passed through | 156 // the first finger is ignored and other fingers are passed through |
| 156 // as-is. If a finger other than the initial one is the first to be | 157 // as-is. If a finger other than the initial one is the first to be |
| 157 // released, we rewrite the first finger with the touch id of the finger | 158 // released, we rewrite the first finger with the touch id of the finger |
| 158 // that was released, from now on. The motivation for this is that if | 159 // that was released, from now on. The motivation for this is that if |
| 159 // the user starts a scroll with 2 fingers, they can release either one | 160 // the user starts a scroll with 2 fingers, they can release either one |
| 160 // and continue the scrolling. | 161 // and continue the scrolling. |
| 161 PASSTHROUGH_MINUS_ONE, | 162 PASSTHROUGH_MINUS_ONE, |
| 163 | |
| 164 // The user was in touch exploration, but has placed down another finger | |
|
dmazzoni
2014/06/13 05:52:38
Nit: end this sentence with a period.
evy
2014/06/13 16:48:08
Done.
| |
| 165 // If the user releases the second finger, a click will go through | |
|
dmazzoni
2014/06/13 05:52:38
To be entirely accurate, we don't send a click, we
evy
2014/06/13 16:48:08
Done.
| |
| 166 // at the last touch explore location. If the user releases the touch | |
| 167 // explore finger, the other finger will continue with touch explore. | |
| 168 // Once more than two fingers are pressed, the state is changed to wait | |
| 169 // for all fingers to be released before continuing. | |
| 170 TE_SECOND_PRESS, | |
| 162 }; | 171 }; |
| 163 | 172 |
| 164 void VLOGState(int line_number); | 173 void VLOGState(int line_number); |
| 165 | 174 |
| 166 void VLOGEvent(const ui::Event& event, int line_number); | 175 void VLOGEvent(const ui::Event& event, int line_number); |
| 167 | 176 |
| 168 // Gets enum name from integer value | 177 // Gets enum name from integer value |
| 169 const char* EnumStateToString(State state); | 178 const char* EnumStateToString(State state); |
| 170 | 179 |
| 171 const char* EnumEventTypeToString(ui::EventType type); | 180 const char* EnumEventTypeToString(ui::EventType type); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 210 | 219 |
| 211 // The previous EventType | 220 // The previous EventType |
| 212 ui::EventType prev_event_; | 221 ui::EventType prev_event_; |
| 213 | 222 |
| 214 DISALLOW_COPY_AND_ASSIGN(TouchExplorationController); | 223 DISALLOW_COPY_AND_ASSIGN(TouchExplorationController); |
| 215 }; | 224 }; |
| 216 | 225 |
| 217 } // namespace ui | 226 } // namespace ui |
| 218 | 227 |
| 219 #endif // UI_CHROMEOS_TOUCH_EXPLORATION_CONTROLLER_H_ | 228 #endif // UI_CHROMEOS_TOUCH_EXPLORATION_CONTROLLER_H_ |
| OLD | NEW |