Index: ui/chromeos/touch_exploration_controller.h |
diff --git a/ui/chromeos/touch_exploration_controller.h b/ui/chromeos/touch_exploration_controller.h |
index 59ff11444f54a4cf7bbd0b1a057e8de65ebfe23e..f53185efb09030dc60acb306655a85650461aa98 100644 |
--- a/ui/chromeos/touch_exploration_controller.h |
+++ b/ui/chromeos/touch_exploration_controller.h |
@@ -33,13 +33,25 @@ class TouchExplorationControllerDelegate { |
public: |
virtual ~TouchExplorationControllerDelegate() {} |
- // This function should be called whenever the delegate wants to play a sound |
- // when the volume adjusts. |
- virtual void PlayVolumeAdjustSound() = 0; |
- |
// Takes an int from 0.0 to 100.0 that indicates the percent the volume |
// should be set to. |
virtual void SetOutputLevel(int volume) = 0; |
+ |
+ // This function should be called when the volume adjust earcon should be |
+ // played |
+ virtual void PlayVolumeAdjustEarcon() = 0; |
+ |
+ // This function should be called when the passthrough earcon should be |
+ // played. |
+ virtual void PlayPassthroughEarcon() = 0; |
+ |
+ // This function should be called when the exit screen earcon should be |
+ // played. |
+ virtual void PlayExitScreenEarcon() = 0; |
+ |
+ // This function should be called when the enter screen earcon should be |
+ // played. |
+ virtual void PlayEnterScreenEarcon() = 0; |
}; |
// TouchExplorationController is used in tandem with "Spoken Feedback" to |
@@ -57,7 +69,9 @@ class TouchExplorationControllerDelegate { |
// right would correspond to the keyboard short cut shift+search+right. |
// When two or more fingers are pressed initially, from then on the events |
// are passed through, but with the initial finger removed - so if you swipe |
-// down with two fingers, the running app will see a one-finger swipe. Slide |
+// down with two fingers, the running app will see a one-finger swipe. If the |
+// user holds down the corner of the screen until an earcon sounds, all |
+// subsequent fingers will also be passed through in a similar manner. Slide |
// gestures performed on the edge of the screen can change settings |
// continuously. For example, sliding a finger along the right side of the |
// screen will change the volume. |
@@ -171,7 +185,7 @@ class UI_CHROMEOS_EXPORT TouchExplorationController |
const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event); |
ui::EventRewriteStatus InTouchExploration( |
const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event); |
- ui::EventRewriteStatus InTwoToOneFinger( |
+ ui::EventRewriteStatus InCornerPassthrough( |
const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event); |
ui::EventRewriteStatus InOneFingerPassthrough( |
const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event); |
@@ -194,6 +208,13 @@ class UI_CHROMEOS_EXPORT TouchExplorationController |
void StartTapTimer(); |
void OnTapTimerFired(); |
+ // This timer is started every timer we get the first press event and the |
+ // finger is in the corner of the screen. |
+ // It fires after the long_press timeout elapses (500 ms by default). If the |
aboxhall
2014/08/06 18:10:45
Looks like it's 700ms now. Maybe just refer to the
lisayin
2014/08/06 20:37:35
Done.
|
+ // user is still in the corner by the time this timre fires, all subsequent |
+ // fingers added on the screen will be passed through. |
+ void OnLongPressTimerFired(); |
+ |
// Dispatch a new event outside of the event rewriting flow. |
void DispatchEvent(ui::Event* event); |
@@ -302,6 +323,11 @@ class UI_CHROMEOS_EXPORT TouchExplorationController |
// all fingers. |
ONE_FINGER_PASSTHROUGH, |
+ // If the user has pressed and held down the left corner past long press, |
+ // then as long as they are holding the corner, all subsequent fingers |
+ // registered will be in passthrough. |
+ CORNER_PASSTHROUGH, |
+ |
// If the user added another finger in SINGLE_TAP_PRESSED, or if the user |
// has multiple fingers fingers down in any other state between |
// passthrough, touch exploration, and gestures, they must release |
@@ -323,6 +349,8 @@ class UI_CHROMEOS_EXPORT TouchExplorationController |
TOP_EDGE = 1 << 1, |
LEFT_EDGE = 1 << 2, |
BOTTOM_EDGE = 1 << 3, |
+ BOTTOM_LEFT_CORNER = LEFT_EDGE | BOTTOM_EDGE, |
+ BOTTOM_RIGHT_CORNER = RIGHT_EDGE | BOTTOM_EDGE, |
}; |
// Given a point, if it is within the given bounds of an edge, returns the |
@@ -368,9 +396,12 @@ class UI_CHROMEOS_EXPORT TouchExplorationController |
// we send the passed-through tap to the location of this event. |
scoped_ptr<ui::TouchEvent> last_touch_exploration_; |
- // A timer to fire the mouse move event after the double-tap delay. |
+ // A timer that fires after the double-tap delay. |
base::OneShotTimer<TouchExplorationController> tap_timer_; |
+ // A timer that fires after a long press delay. |
+ base::OneShotTimer<TouchExplorationController> long_press_timer_; |
+ |
// A timer to fire an indicating sound when sliding to change volume. |
base::RepeatingTimer<TouchExplorationController> sound_timer_; |
@@ -394,6 +425,10 @@ class UI_CHROMEOS_EXPORT TouchExplorationController |
// testing, this clock is set to the simulated clock and used. |
base::TickClock* tick_clock_; |
+ // Indicates if a finger is in the lower left corner waiting for the timer to |
+ // run out. |
+ bool waiting_for_corner_passthrough_; |
+ |
DISALLOW_COPY_AND_ASSIGN(TouchExplorationController); |
}; |