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/system/accessibility_observer.h" | 11 #include "ash/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_accessibility_enabler.h" |
14 #include "ui/chromeos/touch_exploration_controller.h" | 14 #include "ui/chromeos/touch_exploration_controller.h" |
15 #include "ui/display/display_observer.h" | 15 #include "ui/display/display_observer.h" |
| 16 #include "ui/keyboard/keyboard_controller_observer.h" |
16 #include "ui/wm/public/activation_change_observer.h" | 17 #include "ui/wm/public/activation_change_observer.h" |
17 | 18 |
18 namespace chromeos { | 19 namespace chromeos { |
19 class CrasAudioHandler; | 20 class CrasAudioHandler; |
20 } | 21 } |
21 | 22 |
22 namespace ash { | 23 namespace ash { |
23 class RootWindowController; | 24 class RootWindowController; |
24 | 25 |
25 // Responsible for initializing TouchExplorationController when spoken | 26 // Responsible for initializing TouchExplorationController when spoken |
26 // feedback is on for ChromeOS only. This class implements | 27 // feedback is on for ChromeOS only. This class implements |
27 // TouchExplorationControllerDelegate which allows touch gestures to manipulate | 28 // TouchExplorationControllerDelegate which allows touch gestures to manipulate |
28 // the system. | 29 // the system. |
29 class ASH_EXPORT AshTouchExplorationManager | 30 class ASH_EXPORT AshTouchExplorationManager |
30 : public AccessibilityObserver, | 31 : public AccessibilityObserver, |
31 public ui::TouchExplorationControllerDelegate, | 32 public ui::TouchExplorationControllerDelegate, |
32 public ui::TouchAccessibilityEnablerDelegate, | 33 public ui::TouchAccessibilityEnablerDelegate, |
33 public display::DisplayObserver, | 34 public display::DisplayObserver, |
34 public aura::client::ActivationChangeObserver { | 35 public aura::client::ActivationChangeObserver, |
| 36 public keyboard::KeyboardControllerObserver { |
35 public: | 37 public: |
36 explicit AshTouchExplorationManager( | 38 explicit AshTouchExplorationManager( |
37 RootWindowController* root_window_controller); | 39 RootWindowController* root_window_controller); |
38 ~AshTouchExplorationManager() override; | 40 ~AshTouchExplorationManager() override; |
39 | 41 |
40 // AccessibilityObserver overrides: | 42 // AccessibilityObserver overrides: |
41 void OnAccessibilityModeChanged( | 43 void OnAccessibilityModeChanged( |
42 AccessibilityNotificationVisibility notify) override; | 44 AccessibilityNotificationVisibility notify) override; |
43 | 45 |
44 // TouchExplorationControllerDelegate overrides: | 46 // TouchExplorationControllerDelegate overrides: |
(...skipping 19 matching lines...) Expand all Loading... |
64 void OnWindowActivated( | 66 void OnWindowActivated( |
65 aura::client::ActivationChangeObserver::ActivationReason reason, | 67 aura::client::ActivationChangeObserver::ActivationReason reason, |
66 aura::Window* gained_active, | 68 aura::Window* gained_active, |
67 aura::Window* lost_active) override; | 69 aura::Window* lost_active) override; |
68 | 70 |
69 // Update the touch exploration controller so that synthesized touch | 71 // Update the touch exploration controller so that synthesized touch |
70 // events are anchored at this point. | 72 // events are anchored at this point. |
71 void SetTouchAccessibilityAnchorPoint(const gfx::Point& anchor_point); | 73 void SetTouchAccessibilityAnchorPoint(const gfx::Point& anchor_point); |
72 | 74 |
73 private: | 75 private: |
| 76 // keyboard::KeyboardControllerObserver overrides: |
| 77 void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override; |
| 78 void OnKeyboardClosed() override; |
| 79 |
74 void UpdateTouchExplorationState(); | 80 void UpdateTouchExplorationState(); |
75 bool VolumeAdjustSoundEnabled(); | 81 bool VolumeAdjustSoundEnabled(); |
76 | 82 |
77 std::unique_ptr<ui::TouchExplorationController> touch_exploration_controller_; | 83 std::unique_ptr<ui::TouchExplorationController> touch_exploration_controller_; |
78 std::unique_ptr<ui::TouchAccessibilityEnabler> touch_accessibility_enabler_; | 84 std::unique_ptr<ui::TouchAccessibilityEnabler> touch_accessibility_enabler_; |
79 RootWindowController* root_window_controller_; | 85 RootWindowController* root_window_controller_; |
80 chromeos::CrasAudioHandler* audio_handler_; | 86 chromeos::CrasAudioHandler* audio_handler_; |
81 const bool enable_chromevox_arc_support_; | 87 const bool enable_chromevox_arc_support_; |
82 | 88 |
83 DISALLOW_COPY_AND_ASSIGN(AshTouchExplorationManager); | 89 DISALLOW_COPY_AND_ASSIGN(AshTouchExplorationManager); |
84 }; | 90 }; |
85 | 91 |
86 } // namespace ash | 92 } // namespace ash |
87 | 93 |
88 #endif // ASH_TOUCH_EXPLORATION_MANAGER_CHROMEOS_H_ | 94 #endif // ASH_TOUCH_EXPLORATION_MANAGER_CHROMEOS_H_ |
OLD | NEW |