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

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

Issue 2880043002: Implement touch exploration touch typing (Closed)
Patch Set: Add comments. Created 3 years, 6 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/macros.h" 8 #include "base/macros.h"
9 #include "base/timer/timer.h" 9 #include "base/timer/timer.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 187
188 // Make synthesized touch events are anchored at this point. This is 188 // Make synthesized touch events are anchored at this point. This is
189 // called when the object with accessibility focus is updated via something 189 // called when the object with accessibility focus is updated via something
190 // other than touch exploration. 190 // other than touch exploration.
191 void SetTouchAccessibilityAnchorPoint(const gfx::Point& anchor_point); 191 void SetTouchAccessibilityAnchorPoint(const gfx::Point& anchor_point);
192 192
193 // Events within the exclude bounds will not be rewritten. 193 // Events within the exclude bounds will not be rewritten.
194 // |bounds| are in root window coordinates. 194 // |bounds| are in root window coordinates.
195 void SetExcludeBounds(const gfx::Rect& bounds); 195 void SetExcludeBounds(const gfx::Rect& bounds);
196 196
197 // Updates |lift_activation_bounds_|. See |lift_activation_bounds_| for more
198 // information.
199 void SetLiftActivationBounds(const gfx::Rect& bounds);
200
197 private: 201 private:
198 friend class TouchExplorationControllerTestApi; 202 friend class TouchExplorationControllerTestApi;
199 203
200 // Overridden from ui::EventRewriter 204 // Overridden from ui::EventRewriter
201 ui::EventRewriteStatus RewriteEvent( 205 ui::EventRewriteStatus RewriteEvent(
202 const ui::Event& event, 206 const ui::Event& event,
203 std::unique_ptr<ui::Event>* rewritten_event) override; 207 std::unique_ptr<ui::Event>* rewritten_event) override;
204 ui::EventRewriteStatus NextDispatchEvent( 208 ui::EventRewriteStatus NextDispatchEvent(
205 const ui::Event& last_event, 209 const ui::Event& last_event,
206 std::unique_ptr<ui::Event>* new_event) override; 210 std::unique_ptr<ui::Event>* new_event) override;
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 base::Closure BindKeyEventWithFlags(const ui::KeyboardCode key, int flags); 293 base::Closure BindKeyEventWithFlags(const ui::KeyboardCode key, int flags);
290 294
291 std::unique_ptr<ui::MouseEvent> CreateMouseMoveEvent( 295 std::unique_ptr<ui::MouseEvent> CreateMouseMoveEvent(
292 const gfx::PointF& location, 296 const gfx::PointF& location,
293 int flags); 297 int flags);
294 298
295 void EnterTouchToMouseMode(); 299 void EnterTouchToMouseMode();
296 300
297 void PlaySoundForTimer(); 301 void PlaySoundForTimer();
298 302
299 void SendSimulatedClick(); 303 // Sends a simulated click, if an anchor point was set explicitly. Otherwise,
304 // sends a simulated tap at anchor point.
305 void SendSimulatedClickOrTap();
306
307 // Sends a simulated tap at anchor point.
308 void SendSimulatedTap();
309
310 // Sends a simulated tap, if the anchor point falls within lift activation
311 // bounds.
312 void MaybeSendSimulatedTapInLiftActivationBounds(const ui::TouchEvent& event);
300 313
301 // Some constants used in touch_exploration_controller: 314 // Some constants used in touch_exploration_controller:
302 315
303 // Within this many dips of the screen edge, the release event generated will 316 // Within this many dips of the screen edge, the release event generated will
304 // reset the state to NoFingersDown. 317 // reset the state to NoFingersDown.
305 const float kLeavingScreenEdge = 6; 318 const float kLeavingScreenEdge = 6;
306 319
307 // Swipe/scroll gestures within these bounds (in DIPs) will change preset 320 // Swipe/scroll gestures within these bounds (in DIPs) will change preset
308 // settings. 321 // settings.
309 const float kMaxDistanceFromEdge = 75; 322 const float kMaxDistanceFromEdge = 75;
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 520
508 // LocatedEvents within this area should be left alone. 521 // LocatedEvents within this area should be left alone.
509 gfx::Rect exclude_bounds_; 522 gfx::Rect exclude_bounds_;
510 523
511 // Code that detects a touch-screen gesture to enable or disable 524 // Code that detects a touch-screen gesture to enable or disable
512 // accessibility. That handler is always running, whereas this is not, 525 // accessibility. That handler is always running, whereas this is not,
513 // but events need to be sent to TouchAccessibilityEnabler before being 526 // but events need to be sent to TouchAccessibilityEnabler before being
514 // rewritten when TouchExplorationController is running. 527 // rewritten when TouchExplorationController is running.
515 TouchAccessibilityEnabler* touch_accessibility_enabler_; 528 TouchAccessibilityEnabler* touch_accessibility_enabler_;
516 529
530 // Any touch exploration that both starts and ends (touch pressed, and
531 // released) within this rectangle, triggers a simulated single finger tap at
532 // the anchor point on release.
533 gfx::Rect lift_activation_bounds_;
534
517 DISALLOW_COPY_AND_ASSIGN(TouchExplorationController); 535 DISALLOW_COPY_AND_ASSIGN(TouchExplorationController);
518 }; 536 };
519 537
520 } // namespace ui 538 } // namespace ui
521 539
522 #endif // UI_CHROMEOS_TOUCH_EXPLORATION_CONTROLLER_H_ 540 #endif // UI_CHROMEOS_TOUCH_EXPLORATION_CONTROLLER_H_
OLDNEW
« no previous file with comments | « ash/ash_touch_exploration_manager_chromeos.cc ('k') | ui/chromeos/touch_exploration_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698