| OLD | NEW |
| 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_exploration_controller.h" | 13 #include "ui/chromeos/touch_exploration_controller.h" |
| 14 #include "ui/display/display_observer.h" |
| 14 #include "ui/wm/public/activation_change_observer.h" | 15 #include "ui/wm/public/activation_change_observer.h" |
| 15 | 16 |
| 16 namespace chromeos { | 17 namespace chromeos { |
| 17 class CrasAudioHandler; | 18 class CrasAudioHandler; |
| 18 } | 19 } |
| 19 | 20 |
| 20 namespace ash { | 21 namespace ash { |
| 21 class RootWindowController; | 22 class RootWindowController; |
| 22 | 23 |
| 23 // Responsible for initializing TouchExplorationController when spoken | 24 // Responsible for initializing TouchExplorationController when spoken |
| 24 // feedback is on for ChromeOS only. This class implements | 25 // feedback is on for ChromeOS only. This class implements |
| 25 // TouchExplorationControllerDelegate which allows touch gestures to manipulate | 26 // TouchExplorationControllerDelegate which allows touch gestures to manipulate |
| 26 // the system. | 27 // the system. |
| 27 class ASH_EXPORT AshTouchExplorationManager | 28 class ASH_EXPORT AshTouchExplorationManager |
| 28 : public AccessibilityObserver, | 29 : public AccessibilityObserver, |
| 29 public ui::TouchExplorationControllerDelegate, | 30 public ui::TouchExplorationControllerDelegate, |
| 31 public display::DisplayObserver, |
| 30 public aura::client::ActivationChangeObserver { | 32 public aura::client::ActivationChangeObserver { |
| 31 public: | 33 public: |
| 32 explicit AshTouchExplorationManager( | 34 explicit AshTouchExplorationManager( |
| 33 RootWindowController* root_window_controller); | 35 RootWindowController* root_window_controller); |
| 34 ~AshTouchExplorationManager() override; | 36 ~AshTouchExplorationManager() override; |
| 35 | 37 |
| 36 // AccessibilityObserver overrides: | 38 // AccessibilityObserver overrides: |
| 37 void OnAccessibilityModeChanged( | 39 void OnAccessibilityModeChanged( |
| 38 AccessibilityNotificationVisibility notify) override; | 40 AccessibilityNotificationVisibility notify) override; |
| 39 | 41 |
| 40 // TouchExplorationControllerDelegate overrides: | 42 // TouchExplorationControllerDelegate overrides: |
| 41 void SetOutputLevel(int volume) override; | 43 void SetOutputLevel(int volume) override; |
| 42 void SilenceSpokenFeedback() override; | 44 void SilenceSpokenFeedback() override; |
| 43 void PlayVolumeAdjustEarcon() override; | 45 void PlayVolumeAdjustEarcon() override; |
| 44 void PlayPassthroughEarcon() override; | 46 void PlayPassthroughEarcon() override; |
| 45 void PlayExitScreenEarcon() override; | 47 void PlayExitScreenEarcon() override; |
| 46 void PlayEnterScreenEarcon() override; | 48 void PlayEnterScreenEarcon() override; |
| 47 void HandleAccessibilityGesture(ui::AXGesture gesture) override; | 49 void HandleAccessibilityGesture(ui::AXGesture gesture) override; |
| 48 | 50 |
| 51 // display::DisplayObserver overrides: |
| 52 void OnDisplayMetricsChanged(const display::Display& display, |
| 53 uint32_t changed_metrics) override; |
| 54 |
| 49 // aura::client::ActivationChangeObserver overrides: | 55 // aura::client::ActivationChangeObserver overrides: |
| 50 void OnWindowActivated( | 56 void OnWindowActivated( |
| 51 aura::client::ActivationChangeObserver::ActivationReason reason, | 57 aura::client::ActivationChangeObserver::ActivationReason reason, |
| 52 aura::Window* gained_active, | 58 aura::Window* gained_active, |
| 53 aura::Window* lost_active) override; | 59 aura::Window* lost_active) override; |
| 54 | 60 |
| 55 // Update the touch exploration controller so that synthesized touch | 61 // Update the touch exploration controller so that synthesized touch |
| 56 // events are anchored at this point. | 62 // events are anchored at this point. |
| 57 void SetTouchAccessibilityAnchorPoint(const gfx::Point& anchor_point); | 63 void SetTouchAccessibilityAnchorPoint(const gfx::Point& anchor_point); |
| 58 | 64 |
| 59 private: | 65 private: |
| 60 void UpdateTouchExplorationState(); | 66 void UpdateTouchExplorationState(); |
| 61 bool VolumeAdjustSoundEnabled(); | 67 bool VolumeAdjustSoundEnabled(); |
| 62 | 68 |
| 63 std::unique_ptr<ui::TouchExplorationController> touch_exploration_controller_; | 69 std::unique_ptr<ui::TouchExplorationController> touch_exploration_controller_; |
| 64 RootWindowController* root_window_controller_; | 70 RootWindowController* root_window_controller_; |
| 65 chromeos::CrasAudioHandler* audio_handler_; | 71 chromeos::CrasAudioHandler* audio_handler_; |
| 66 | 72 |
| 67 DISALLOW_COPY_AND_ASSIGN(AshTouchExplorationManager); | 73 DISALLOW_COPY_AND_ASSIGN(AshTouchExplorationManager); |
| 68 }; | 74 }; |
| 69 | 75 |
| 70 } // namespace ash | 76 } // namespace ash |
| 71 | 77 |
| 72 #endif // ASH_TOUCH_EXPLORATION_MANAGER_CHROMEOS_H_ | 78 #endif // ASH_TOUCH_EXPLORATION_MANAGER_CHROMEOS_H_ |
| OLD | NEW |