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

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

Issue 2476843003: Toggle spoken feedback if two fingers are held down. (Closed)
Patch Set: Send events from TouchExplorationController to TouchAccessibilityEnabler Created 4 years, 1 month 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"
11 #include "ui/accessibility/ax_enums.h" 11 #include "ui/accessibility/ax_enums.h"
12 #include "ui/chromeos/ui_chromeos_export.h" 12 #include "ui/chromeos/ui_chromeos_export.h"
13 #include "ui/events/event.h" 13 #include "ui/events/event.h"
14 #include "ui/events/event_rewriter.h" 14 #include "ui/events/event_rewriter.h"
15 #include "ui/events/gesture_detection/gesture_detector.h" 15 #include "ui/events/gesture_detection/gesture_detector.h"
16 #include "ui/events/gestures/gesture_provider_aura.h" 16 #include "ui/events/gestures/gesture_provider_aura.h"
17 #include "ui/gfx/geometry/point.h" 17 #include "ui/gfx/geometry/point.h"
18 18
19 namespace aura { 19 namespace aura {
20 class Window; 20 class Window;
21 } 21 }
22 22
23 namespace ui { 23 namespace ui {
24 24
25 class Event; 25 class Event;
26 class EventHandler; 26 class EventHandler;
27 class GestureEvent; 27 class GestureEvent;
28 class GestureProviderAura; 28 class GestureProviderAura;
29 class TouchAccessibilityEnabler;
29 class TouchEvent; 30 class TouchEvent;
30 31
31 // A delegate to handle commands in response to detected accessibility gesture 32 // A delegate to handle commands in response to detected accessibility gesture
32 // events. 33 // events.
33 class TouchExplorationControllerDelegate { 34 class TouchExplorationControllerDelegate {
34 public: 35 public:
35 virtual ~TouchExplorationControllerDelegate() {} 36 virtual ~TouchExplorationControllerDelegate() {}
36 37
37 // Takes an int from 0.0 to 100.0 that indicates the percent the volume 38 // Takes an int from 0.0 to 100.0 that indicates the percent the volume
38 // should be set to. 39 // should be set to.
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 // 175 //
175 // The caller is expected to retain ownership of instances of this class and 176 // The caller is expected to retain ownership of instances of this class and
176 // destroy them before |root_window| is destroyed. 177 // destroy them before |root_window| is destroyed.
177 class UI_CHROMEOS_EXPORT TouchExplorationController 178 class UI_CHROMEOS_EXPORT TouchExplorationController
178 : public ui::EventRewriter, 179 : public ui::EventRewriter,
179 public ui::GestureProviderAuraClient, 180 public ui::GestureProviderAuraClient,
180 public ui::GestureConsumer { 181 public ui::GestureConsumer {
181 public: 182 public:
182 explicit TouchExplorationController( 183 explicit TouchExplorationController(
183 aura::Window* root_window, 184 aura::Window* root_window,
184 ui::TouchExplorationControllerDelegate* delegate); 185 ui::TouchExplorationControllerDelegate* delegate,
186 TouchAccessibilityEnabler* touch_accessibility_enabler);
185 ~TouchExplorationController() override; 187 ~TouchExplorationController() override;
186 188
187 // Make synthesized touch events are anchored at this point. This is 189 // Make synthesized touch events are anchored at this point. This is
188 // called when the object with accessibility focus is updated via something 190 // called when the object with accessibility focus is updated via something
189 // other than touch exploration. 191 // other than touch exploration.
190 void SetTouchAccessibilityAnchorPoint(const gfx::Point& anchor_point); 192 void SetTouchAccessibilityAnchorPoint(const gfx::Point& anchor_point);
191 193
192 // Events within the exclude bounds will not be rewritten. 194 // Events within the exclude bounds will not be rewritten.
193 // |bounds| are in root window coordinates. 195 // |bounds| are in root window coordinates.
194 void SetExcludeBounds(const gfx::Rect& bounds); 196 void SetExcludeBounds(const gfx::Rect& bounds);
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 502
501 // A copy of the previous event passed. 503 // A copy of the previous event passed.
502 std::unique_ptr<ui::TouchEvent> prev_event_; 504 std::unique_ptr<ui::TouchEvent> prev_event_;
503 505
504 // This toggles whether VLOGS are turned on or not. 506 // This toggles whether VLOGS are turned on or not.
505 bool VLOG_on_; 507 bool VLOG_on_;
506 508
507 // LocatedEvents within this area should be left alone. 509 // LocatedEvents within this area should be left alone.
508 gfx::Rect exclude_bounds_; 510 gfx::Rect exclude_bounds_;
509 511
512 // Code that detects a touch-screen gesture to enable or disable
513 // accessibility. That handler is always running, whereas this is not,
514 // but events need to be sent to TouchAccessibilityEnabler before being
515 // rewritten when TouchExplorationController is running.
516 TouchAccessibilityEnabler* touch_accessibility_enabler_;
517
510 DISALLOW_COPY_AND_ASSIGN(TouchExplorationController); 518 DISALLOW_COPY_AND_ASSIGN(TouchExplorationController);
511 }; 519 };
512 520
513 } // namespace ui 521 } // namespace ui
514 522
515 #endif // UI_CHROMEOS_TOUCH_EXPLORATION_CONTROLLER_H_ 523 #endif // UI_CHROMEOS_TOUCH_EXPLORATION_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698