Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(760)

Unified Diff: ui/chromeos/touch_exploration_controller.h

Issue 410783002: Corner Passthrough for Accessibility (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@side-gestures
Patch Set: Refactored tests Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/chromeos/touch_exploration_controller.h
diff --git a/ui/chromeos/touch_exploration_controller.h b/ui/chromeos/touch_exploration_controller.h
index 12f0bfa2fcebe0e32d1289d5343f9a0d1dfb0552..021ed684c7a3bd5e0ea4b20b63ab5a43b9818b50 100644
--- a/ui/chromeos/touch_exploration_controller.h
+++ b/ui/chromeos/touch_exploration_controller.h
@@ -39,6 +39,11 @@ class TouchExplorationControllerDelegate {
// 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 whenever the delegate should play an earcon.
+ // In the future a parameter can be passed to indicate what sound should be
+ // played.
+ virtual void PlayEarCon() = 0;
};
// TouchExplorationController is used in tandem with "Spoken Feedback" to
@@ -56,7 +61,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.
@@ -165,6 +172,8 @@ class UI_CHROMEOS_EXPORT TouchExplorationController
const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event);
ui::EventRewriteStatus InTwoToOneFinger(
const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event);
+ ui::EventRewriteStatus InCornerPassthrough(
+ const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event);
ui::EventRewriteStatus InPassthrough(
const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event);
ui::EventRewriteStatus InGestureInProgress(
@@ -176,12 +185,21 @@ class UI_CHROMEOS_EXPORT TouchExplorationController
ui::EventRewriteStatus InSlideGesture(
const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event);
- // This timer is started every time we get the first press event, and
- // it fires after the double-click timeout elapses (300 ms by default).
+ // This timer is started every time we get the first press event and the
+ // finger is not in the corner of the screen.
+ // It fires after the double-click timeout elapses (300 ms by default).
// If the user taps and releases within 300 ms and doesn't press again,
- // we treat that as a single mouse move (touch exploration) event.
+ // we treat that as a single mouse move (touch exploration) event. If the user
+ // completes a swipe gesture within 300 ms, then the gesture is processed.
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
+ // 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);
@@ -285,6 +303,11 @@ class UI_CHROMEOS_EXPORT TouchExplorationController
// happens until all fingers are up.
TWO_TO_ONE_FINGER,
+ // 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 is in TWO_TO_ONE_FINGER with two fingers down and presses
// a third finger, every finger and touch event is passed through until
// all fingers are released.
@@ -309,6 +332,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
@@ -355,7 +380,10 @@ class UI_CHROMEOS_EXPORT TouchExplorationController
// the location and id of the touch release is from here.
scoped_ptr<ui::TouchEvent> last_two_to_one_;
- // A timer to fire the mouse move event after the double-tap delay.
+ // A timer that fires after a long press delay.
+ base::OneShotTimer<TouchExplorationController> long_press_timer_;
+
+ // A timer that fires after a double tap delay.
base::OneShotTimer<TouchExplorationController> tap_timer_;
// A timer to fire an indicating sound when sliding to change volume.
@@ -381,6 +409,10 @@ class UI_CHROMEOS_EXPORT TouchExplorationController
// This toggles whether VLOGS are turned on or not.
bool VLOG_on_;
+ // 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);
};

Powered by Google App Engine
This is Rietveld 408576698