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

Side by Side Diff: ash/ash_touch_exploration_manager_chromeos.h

Issue 2584063002: Re-land: Toggle spoken feedback if two fingers are held down. (Closed)
Patch Set: Only toggle spoken feedback on CFM devices Created 4 years 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
« no previous file with comments | « no previous file | ash/ash_touch_exploration_manager_chromeos.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ASH_TOUCH_EXPLORATION_MANAGER_CHROMEOS_H_ 5 #ifndef ASH_TOUCH_EXPLORATION_MANAGER_CHROMEOS_H_
6 #define ASH_TOUCH_EXPLORATION_MANAGER_CHROMEOS_H_ 6 #define ASH_TOUCH_EXPLORATION_MANAGER_CHROMEOS_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "ash/ash_export.h" 10 #include "ash/ash_export.h"
11 #include "ash/common/system/accessibility_observer.h" 11 #include "ash/common/system/accessibility_observer.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "ui/chromeos/touch_accessibility_enabler.h"
13 #include "ui/chromeos/touch_exploration_controller.h" 14 #include "ui/chromeos/touch_exploration_controller.h"
14 #include "ui/display/display_observer.h" 15 #include "ui/display/display_observer.h"
15 #include "ui/wm/public/activation_change_observer.h" 16 #include "ui/wm/public/activation_change_observer.h"
16 17
17 namespace chromeos { 18 namespace chromeos {
18 class CrasAudioHandler; 19 class CrasAudioHandler;
19 } 20 }
20 21
21 namespace ash { 22 namespace ash {
22 class RootWindowController; 23 class RootWindowController;
23 24
24 // Responsible for initializing TouchExplorationController when spoken 25 // Responsible for initializing TouchExplorationController when spoken
25 // feedback is on for ChromeOS only. This class implements 26 // feedback is on for ChromeOS only. This class implements
26 // TouchExplorationControllerDelegate which allows touch gestures to manipulate 27 // TouchExplorationControllerDelegate which allows touch gestures to manipulate
27 // the system. 28 // the system.
28 class ASH_EXPORT AshTouchExplorationManager 29 class ASH_EXPORT AshTouchExplorationManager
29 : public AccessibilityObserver, 30 : public AccessibilityObserver,
30 public ui::TouchExplorationControllerDelegate, 31 public ui::TouchExplorationControllerDelegate,
32 public ui::TouchAccessibilityEnablerDelegate,
31 public display::DisplayObserver, 33 public display::DisplayObserver,
32 public aura::client::ActivationChangeObserver { 34 public aura::client::ActivationChangeObserver {
33 public: 35 public:
34 explicit AshTouchExplorationManager( 36 explicit AshTouchExplorationManager(
35 RootWindowController* root_window_controller); 37 RootWindowController* root_window_controller);
36 ~AshTouchExplorationManager() override; 38 ~AshTouchExplorationManager() override;
37 39
38 // AccessibilityObserver overrides: 40 // AccessibilityObserver overrides:
39 void OnAccessibilityModeChanged( 41 void OnAccessibilityModeChanged(
40 AccessibilityNotificationVisibility notify) override; 42 AccessibilityNotificationVisibility notify) override;
41 43
42 // TouchExplorationControllerDelegate overrides: 44 // TouchExplorationControllerDelegate overrides:
43 void SetOutputLevel(int volume) override; 45 void SetOutputLevel(int volume) override;
44 void SilenceSpokenFeedback() override; 46 void SilenceSpokenFeedback() override;
45 void PlayVolumeAdjustEarcon() override; 47 void PlayVolumeAdjustEarcon() override;
46 void PlayPassthroughEarcon() override; 48 void PlayPassthroughEarcon() override;
47 void PlayExitScreenEarcon() override; 49 void PlayExitScreenEarcon() override;
48 void PlayEnterScreenEarcon() override; 50 void PlayEnterScreenEarcon() override;
49 void HandleAccessibilityGesture(ui::AXGesture gesture) override; 51 void HandleAccessibilityGesture(ui::AXGesture gesture) override;
50 52
51 // display::DisplayObserver overrides: 53 // display::DisplayObserver overrides:
52 void OnDisplayMetricsChanged(const display::Display& display, 54 void OnDisplayMetricsChanged(const display::Display& display,
53 uint32_t changed_metrics) override; 55 uint32_t changed_metrics) override;
54 56
57 // TouchAccessibilityEnablerDelegate overrides:
58 void PlaySpokenFeedbackToggleCountdown(int tick_count) override;
59 void ToggleSpokenFeedback() override;
60
55 // aura::client::ActivationChangeObserver overrides: 61 // aura::client::ActivationChangeObserver overrides:
56 void OnWindowActivated( 62 void OnWindowActivated(
57 aura::client::ActivationChangeObserver::ActivationReason reason, 63 aura::client::ActivationChangeObserver::ActivationReason reason,
58 aura::Window* gained_active, 64 aura::Window* gained_active,
59 aura::Window* lost_active) override; 65 aura::Window* lost_active) override;
60 66
61 // Update the touch exploration controller so that synthesized touch 67 // Update the touch exploration controller so that synthesized touch
62 // events are anchored at this point. 68 // events are anchored at this point.
63 void SetTouchAccessibilityAnchorPoint(const gfx::Point& anchor_point); 69 void SetTouchAccessibilityAnchorPoint(const gfx::Point& anchor_point);
64 70
65 private: 71 private:
66 void UpdateTouchExplorationState(); 72 void UpdateTouchExplorationState();
67 bool VolumeAdjustSoundEnabled(); 73 bool VolumeAdjustSoundEnabled();
68 74
69 std::unique_ptr<ui::TouchExplorationController> touch_exploration_controller_; 75 std::unique_ptr<ui::TouchExplorationController> touch_exploration_controller_;
76 std::unique_ptr<ui::TouchAccessibilityEnabler> touch_accessibility_enabler_;
70 RootWindowController* root_window_controller_; 77 RootWindowController* root_window_controller_;
71 chromeos::CrasAudioHandler* audio_handler_; 78 chromeos::CrasAudioHandler* audio_handler_;
72 79
73 DISALLOW_COPY_AND_ASSIGN(AshTouchExplorationManager); 80 DISALLOW_COPY_AND_ASSIGN(AshTouchExplorationManager);
74 }; 81 };
75 82
76 } // namespace ash 83 } // namespace ash
77 84
78 #endif // ASH_TOUCH_EXPLORATION_MANAGER_CHROMEOS_H_ 85 #endif // ASH_TOUCH_EXPLORATION_MANAGER_CHROMEOS_H_
OLDNEW
« no previous file with comments | « no previous file | ash/ash_touch_exploration_manager_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698