Commit d4ed7c5f authored by tapted@chromium.org's avatar tapted@chromium.org

Revert of Added multi-finger gestures to touch_exploration_controller...

Revert of Added multi-finger gestures to touch_exploration_controller (https://codereview.chromium.org/429633002/)

Reason for revert:
tree-closer ui_unittests failing on Linux Chromium OS ASan LSan Tests (3)
test TouchExplorationTest.AllFingerPermutations
failing since
http://build.chromium.org/p/chromium.memory/builders/Linux%20Chromium%20OS%20ASan%20LSan%20Tests%20%283%29/builds/2708

I don't think the failing test itself is generating output, but
there are some LOG(INFO)s that have been snuck through
with the VLOG(0) trick which might help diagnose.

Original issue's description:
> Added multi-finger gestures to touch_exploration_controller
> 
> Two fingers: up is go to top, down is read from here, left is browser back, right is browser forward.
> Three fingers: up and down map to page up/down.
> Four fingers: up is home page, down is refresh.
> 
> Three/four finger left/right mappings to be added to the CL soon!
> 
> NOTRY=true (failing android dbg tests - this is not related to Android)
> BUG=387304
> 
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=288857

TBR=dmazzoni@chromium.org,aboxhall@chromium.org,mfomitchev@chromium.org,lisayin@chromium.org,evy@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=387304

Review URL: https://codereview.chromium.org/466653002

Cr-Commit-Position: refs/heads/master@{#288914}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288914 0039d316-1c4b-4281-b951-d872f2087c98
parent 30923796
This diff is collapsed.
......@@ -55,7 +55,9 @@ class TouchExplorationControllerDelegate {
// is in touch exploration or a double-tap simulates a click, and gestures
// can be used to send high-level accessibility commands. For example, a swipe
// right would correspond to the keyboard short cut shift+search+right.
// Swipes with up to four fingers are also mapped to commands. Slide
// 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
// 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.
......@@ -87,13 +89,13 @@ class TouchExplorationControllerDelegate {
// anywhere to activate it.
//
// The user can perform swipe gestures in one of the four cardinal directions
// which will be interpreted and used to control the UI. All gestures will only
// be registered if the fingers move outside the slop, and all fingers will only
// be registered if they are completed within the grace period. If a single
// finger gesture fails to be completed within the grace period, the state
// changes to touch exploration mode. If a multi finger gesture fails to be
// completed within the grace period, the user must lift all fingers before
// completing any more actions.
// which will be interpreted and used to control the UI. The gesture will only
// be registered if the finger moves outside the slop and completed within the
// grace period. If additional fingers are added during the grace period, the
// state changes to wait for those fingers to be released, and then goes to
// touch exploration mode. If the gesture fails to be completed within the
// grace period, the state changes to touch exploration mode. Once the state has
// changed, any gestures made during the grace period are discarded.
//
// If the user double-taps, the second tap is passed through, allowing the
// user to click - however, the double-tap location is changed to the location
......@@ -169,13 +171,15 @@ 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(
const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event);
ui::EventRewriteStatus InOneFingerPassthrough(
const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event);
ui::EventRewriteStatus InGestureInProgress(
const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event);
ui::EventRewriteStatus InTouchExploreSecondPress(
const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event);
ui::EventRewriteStatus InWaitForNoFingers(
ui::EventRewriteStatus InWaitForOneFinger(
const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event);
ui::EventRewriteStatus InSlideGesture(
const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event);
......@@ -205,26 +209,22 @@ class UI_CHROMEOS_EXPORT TouchExplorationController
void ProcessGestureEvents();
void OnSwipeEvent(ui::GestureEvent* swipe_gesture);
void SideSlideControl(ui::GestureEvent* gesture);
// Dispatches the keyboard short cut Shift+Search+<arrow key>
// outside the event rewritting flow.
void DispatchShiftSearchKeyEvent(const ui::KeyboardCode third_key);
// Binds DispatchShiftSearchKeyEvent to a specific third key.
base::Closure BindShiftSearchKeyEvent(const ui::KeyboardCode third_key);
// Dispatches a single key with the given flags.
void DispatchKeyWithFlags(const ui::KeyboardCode key, int flags);
// Binds DispatchKeyWithFlags to a specific key and flags.
base::Closure BindKeyEventWithFlags(const ui::KeyboardCode key, int flags);
void DispatchShiftSearchKeyEvent(const ui::KeyboardCode direction);
scoped_ptr<ui::Event> CreateMouseMoveEvent(const gfx::PointF& location,
int flags);
void EnterTouchToMouseMode();
// Set the state to NO_FINGERS_DOWN and reset any other fields to their
// default value.
void ResetToNoFingersDown();
void PlaySoundForTimer();
// Some constants used in touch_exploration_controller:
......@@ -258,7 +258,7 @@ class UI_CHROMEOS_EXPORT TouchExplorationController
// The user was in touch explore mode and released the finger.
// If another touch press occurs within the grace period, a single
// tap click occurs. This state differs from SINGLE_TAP_RELEASED
// in that if a second tap doesn't occur within the grace period,
// In that if a second tap doesn't occur within the grace period,
// there is no mouse move dispatched.
TOUCH_EXPLORE_RELEASED,
......@@ -305,10 +305,10 @@ class UI_CHROMEOS_EXPORT TouchExplorationController
// 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
// all fingers before completing any more actions. This state is
// all fingers except before completing any more actions. This state is
// generally useful for developing new features, because it creates a
// simple way to handle a dead end in user flow.
WAIT_FOR_NO_FINGERS,
WAIT_FOR_ONE_FINGER,
// If the user is within the given bounds from an edge of the screen, not
// including corners, then the resulting movements will be interpreted as
......@@ -331,10 +331,6 @@ class UI_CHROMEOS_EXPORT TouchExplorationController
// SCREEN_CENTER.
int FindEdgesWithinBounds(gfx::Point point, float bounds);
// Set the state and modifies any variables related to the state change.
// (e.g. resetting the gesture provider).
void SetState(State new_state, const char* function_name);
void VlogState(const char* function_name);
void VlogEvent(const ui::TouchEvent& event, const char* function_name);
......@@ -342,10 +338,6 @@ class UI_CHROMEOS_EXPORT TouchExplorationController
// Gets enum name from integer value.
const char* EnumStateToString(State state);
// Maps each single/multi finger swipe to the function that dispatches
// the corresponding key events.
void InitializeSwipeGestureMaps();
aura::Window* root_window_;
// Handles volume control. Not owned.
......@@ -376,7 +368,7 @@ 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 that fires after the double-tap delay.
// A timer to fire the mouse move event after the double-tap delay.
base::OneShotTimer<TouchExplorationController> tap_timer_;
// A timer to fire an indicating sound when sliding to change volume.
......@@ -387,7 +379,7 @@ class UI_CHROMEOS_EXPORT TouchExplorationController
ui::GestureDetector::Config gesture_detector_config_;
// Gesture Handler to interpret the touch events.
scoped_ptr<ui::GestureProviderAura> gesture_provider_;
ui::GestureProviderAura gesture_provider_;
// The previous state entered.
State prev_state_;
......@@ -402,13 +394,6 @@ class UI_CHROMEOS_EXPORT TouchExplorationController
// testing, this clock is set to the simulated clock and used.
base::TickClock* tick_clock_;
// Maps the number of fingers in a swipe to the resulting functions that
// dispatch key events.
std::map<int, base::Closure> left_swipe_gestures_;
std::map<int, base::Closure> right_swipe_gestures_;
std::map<int, base::Closure> up_swipe_gestures_;
std::map<int, base::Closure> down_swipe_gestures_;
DISALLOW_COPY_AND_ASSIGN(TouchExplorationController);
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment