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

Side by Side Diff: ui/chromeos/touch_exploration_controller.h

Issue 420073003: Two Finger Tap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 unified diff | Download patch
OLDNEW
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/time/tick_clock.h" 8 #include "base/time/tick_clock.h"
9 #include "base/timer/timer.h" 9 #include "base/timer/timer.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 22 matching lines...) Expand all
33 public: 33 public:
34 virtual ~TouchExplorationControllerDelegate() {} 34 virtual ~TouchExplorationControllerDelegate() {}
35 35
36 // This function should be called whenever the delegate wants to play a sound 36 // This function should be called whenever the delegate wants to play a sound
37 // when the volume adjusts. 37 // when the volume adjusts.
38 virtual void PlayVolumeAdjustSound() = 0; 38 virtual void PlayVolumeAdjustSound() = 0;
39 39
40 // Takes an int from 0.0 to 100.0 that indicates the percent the volume 40 // Takes an int from 0.0 to 100.0 that indicates the percent the volume
41 // should be set to. 41 // should be set to.
42 virtual void SetOutputLevel(int volume) = 0; 42 virtual void SetOutputLevel(int volume) = 0;
43
44 // Silences spoken feedback.
45 virtual void SilenceSpokenFeedback() = 0;
43 }; 46 };
44 47
45 // TouchExplorationController is used in tandem with "Spoken Feedback" to 48 // TouchExplorationController is used in tandem with "Spoken Feedback" to
46 // make the touch UI accessible. Gestures performed in the middle of the screen 49 // make the touch UI accessible. Gestures performed in the middle of the screen
47 // are mapped to accessiblity key shortcuts while gestures performed on the edge 50 // are mapped to accessiblity key shortcuts while gestures performed on the edge
48 // of the screen can change settings. 51 // of the screen can change settings.
49 // 52 //
50 // ** Short version ** 53 // ** Short version **
51 // 54 //
52 // At a high-level, single-finger events are used for accessibility - 55 // At a high-level, single-finger events are used for accessibility -
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 ui::EventRewriteStatus InOneFingerPassthrough( 179 ui::EventRewriteStatus InOneFingerPassthrough(
177 const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event); 180 const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event);
178 ui::EventRewriteStatus InGestureInProgress( 181 ui::EventRewriteStatus InGestureInProgress(
179 const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event); 182 const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event);
180 ui::EventRewriteStatus InTouchExploreSecondPress( 183 ui::EventRewriteStatus InTouchExploreSecondPress(
181 const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event); 184 const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event);
182 ui::EventRewriteStatus InWaitForOneFinger( 185 ui::EventRewriteStatus InWaitForOneFinger(
183 const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event); 186 const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event);
184 ui::EventRewriteStatus InSlideGesture( 187 ui::EventRewriteStatus InSlideGesture(
185 const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event); 188 const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event);
189 ui::EventRewriteStatus InTwoFingerTap(
190 const ui::TouchEvent& event, scoped_ptr<ui::Event>* rewritten_event);
186 191
187 // Returns the current time of the tick clock. 192 // Returns the current time of the tick clock.
188 base::TimeDelta Now(); 193 base::TimeDelta Now();
189 194
190 // This timer is started every time we get the first press event, and 195 // This timer is started every time we get the first press event, and
191 // it fires after the double-click timeout elapses (300 ms by default). 196 // it fires after the double-click timeout elapses (300 ms by default).
192 // If the user taps and releases within 300 ms and doesn't press again, 197 // If the user taps and releases within 300 ms and doesn't press again,
193 // we treat that as a single mouse move (touch exploration) event. 198 // we treat that as a single mouse move (touch exploration) event.
194 void StartTapTimer(); 199 void StartTapTimer();
195 void OnTapTimerFired(); 200 void OnTapTimerFired();
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 // passthrough, touch exploration, and gestures, they must release 312 // passthrough, touch exploration, and gestures, they must release
308 // all fingers except before completing any more actions. This state is 313 // all fingers except before completing any more actions. This state is
309 // generally useful for developing new features, because it creates a 314 // generally useful for developing new features, because it creates a
310 // simple way to handle a dead end in user flow. 315 // simple way to handle a dead end in user flow.
311 WAIT_FOR_ONE_FINGER, 316 WAIT_FOR_ONE_FINGER,
312 317
313 // If the user is within the given bounds from an edge of the screen, not 318 // If the user is within the given bounds from an edge of the screen, not
314 // including corners, then the resulting movements will be interpreted as 319 // including corners, then the resulting movements will be interpreted as
315 // slide gestures. 320 // slide gestures.
316 SLIDE_GESTURE, 321 SLIDE_GESTURE,
322
323 // If the user makes a two finger tap, silence spoken feedback.
324 TWO_FINGER_TAP,
317 }; 325 };
318 326
319 enum ScreenLocation { 327 enum ScreenLocation {
320 // Hot "edges" of the screen are each represented by a respective bit. 328 // Hot "edges" of the screen are each represented by a respective bit.
321 NO_EDGE = 0, 329 NO_EDGE = 0,
322 RIGHT_EDGE = 1 << 0, 330 RIGHT_EDGE = 1 << 0,
323 TOP_EDGE = 1 << 1, 331 TOP_EDGE = 1 << 1,
324 LEFT_EDGE = 1 << 2, 332 LEFT_EDGE = 1 << 2,
325 BOTTOM_EDGE = 1 << 3, 333 BOTTOM_EDGE = 1 << 3,
326 }; 334 };
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 // When touch_exploration_controller gets time relative to real time during 401 // When touch_exploration_controller gets time relative to real time during
394 // testing, this clock is set to the simulated clock and used. 402 // testing, this clock is set to the simulated clock and used.
395 base::TickClock* tick_clock_; 403 base::TickClock* tick_clock_;
396 404
397 DISALLOW_COPY_AND_ASSIGN(TouchExplorationController); 405 DISALLOW_COPY_AND_ASSIGN(TouchExplorationController);
398 }; 406 };
399 407
400 } // namespace ui 408 } // namespace ui
401 409
402 #endif // UI_CHROMEOS_TOUCH_EXPLORATION_CONTROLLER_H_ 410 #endif // UI_CHROMEOS_TOUCH_EXPLORATION_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698