OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_ACCESSIBILITY_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_ACCESSIBILITY_MANAGER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_ACCESSIBILITY_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_ACCESSIBILITY_MANAGER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "ash/session/session_state_observer.h" | 10 #include "ash/session/session_state_observer.h" |
11 #include "ash/shell_observer.h" | 11 #include "ash/shell_observer.h" |
12 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
13 #include "base/callback_list.h" | 13 #include "base/callback_list.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "base/prefs/pref_change_registrar.h" | 15 #include "base/prefs/pref_change_registrar.h" |
16 #include "base/scoped_observer.h" | 16 #include "base/scoped_observer.h" |
17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
18 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" | 18 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" |
| 19 #include "chrome/browser/chromeos/accessibility/chromevox_panel.h" |
19 #include "chrome/browser/extensions/api/braille_display_private/braille_controll
er.h" | 20 #include "chrome/browser/extensions/api/braille_display_private/braille_controll
er.h" |
20 #include "content/public/browser/notification_observer.h" | 21 #include "content/public/browser/notification_observer.h" |
21 #include "content/public/browser/notification_registrar.h" | 22 #include "content/public/browser/notification_registrar.h" |
22 #include "extensions/browser/event_router.h" | 23 #include "extensions/browser/event_router.h" |
23 #include "extensions/browser/extension_system.h" | 24 #include "extensions/browser/extension_system.h" |
24 #include "ui/base/ime/chromeos/input_method_manager.h" | 25 #include "ui/base/ime/chromeos/input_method_manager.h" |
25 #include "ui/chromeos/accessibility_types.h" | 26 #include "ui/chromeos/accessibility_types.h" |
26 | 27 |
27 namespace content { | 28 namespace content { |
28 class RenderViewHost; | 29 class RenderViewHost; |
29 } | 30 } |
| 31 |
30 class Profile; | 32 class Profile; |
31 | 33 |
32 namespace chromeos { | 34 namespace chromeos { |
33 | 35 |
34 enum AccessibilityNotificationType { | 36 enum AccessibilityNotificationType { |
35 ACCESSIBILITY_MANAGER_SHUTDOWN, | 37 ACCESSIBILITY_MANAGER_SHUTDOWN, |
36 ACCESSIBILITY_TOGGLE_HIGH_CONTRAST_MODE, | 38 ACCESSIBILITY_TOGGLE_HIGH_CONTRAST_MODE, |
37 ACCESSIBILITY_TOGGLE_LARGE_CURSOR, | 39 ACCESSIBILITY_TOGGLE_LARGE_CURSOR, |
38 ACCESSIBILITY_TOGGLE_SCREEN_MAGNIFIER, | 40 ACCESSIBILITY_TOGGLE_SCREEN_MAGNIFIER, |
39 ACCESSIBILITY_TOGGLE_SPOKEN_FEEDBACK, | 41 ACCESSIBILITY_TOGGLE_SPOKEN_FEEDBACK, |
(...skipping 21 matching lines...) Expand all Loading... |
61 | 63 |
62 typedef base::Callback<void(const AccessibilityStatusEventDetails&)> | 64 typedef base::Callback<void(const AccessibilityStatusEventDetails&)> |
63 AccessibilityStatusCallback; | 65 AccessibilityStatusCallback; |
64 | 66 |
65 typedef base::CallbackList<void(const AccessibilityStatusEventDetails&)> | 67 typedef base::CallbackList<void(const AccessibilityStatusEventDetails&)> |
66 AccessibilityStatusCallbackList; | 68 AccessibilityStatusCallbackList; |
67 | 69 |
68 typedef AccessibilityStatusCallbackList::Subscription | 70 typedef AccessibilityStatusCallbackList::Subscription |
69 AccessibilityStatusSubscription; | 71 AccessibilityStatusSubscription; |
70 | 72 |
| 73 class ChromeVoxPanelWidgetObserver; |
| 74 |
71 // AccessibilityManager changes the statuses of accessibility features | 75 // AccessibilityManager changes the statuses of accessibility features |
72 // watching profile notifications and pref-changes. | 76 // watching profile notifications and pref-changes. |
73 // TODO(yoshiki): merge MagnificationManager with AccessibilityManager. | 77 // TODO(yoshiki): merge MagnificationManager with AccessibilityManager. |
74 class AccessibilityManager | 78 class AccessibilityManager |
75 : public content::NotificationObserver, | 79 : public content::NotificationObserver, |
76 public extensions::api::braille_display_private::BrailleObserver, | 80 public extensions::api::braille_display_private::BrailleObserver, |
77 public ash::SessionStateObserver, | 81 public ash::SessionStateObserver, |
78 public ash::ShellObserver, | 82 public ash::ShellObserver, |
79 public input_method::InputMethodManager::Observer { | 83 public input_method::InputMethodManager::Observer { |
80 public: | 84 public: |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 AccessibilityStatusEventDetails& details); | 197 AccessibilityStatusEventDetails& details); |
194 | 198 |
195 // Notify accessibility when locale changes occur. | 199 // Notify accessibility when locale changes occur. |
196 void OnLocaleChanged(); | 200 void OnLocaleChanged(); |
197 | 201 |
198 // Plays an earcon. Earcons are brief and distinctive sounds that indicate | 202 // Plays an earcon. Earcons are brief and distinctive sounds that indicate |
199 // when their mapped event has occurred. The sound key enums can be found in | 203 // when their mapped event has occurred. The sound key enums can be found in |
200 // chromeos/audio/chromeos_sounds.h. | 204 // chromeos/audio/chromeos_sounds.h. |
201 void PlayEarcon(int sound_key); | 205 void PlayEarcon(int sound_key); |
202 | 206 |
| 207 // Called by our widget observer when the ChromeVoxPanel is closing. |
| 208 void OnChromeVoxPanelClosing(); |
| 209 void OnChromeVoxPanelDestroying(); |
| 210 |
203 // Profile having the a11y context. | 211 // Profile having the a11y context. |
204 Profile* profile() { return profile_; } | 212 Profile* profile() { return profile_; } |
205 | 213 |
206 protected: | 214 protected: |
207 AccessibilityManager(); | 215 AccessibilityManager(); |
208 ~AccessibilityManager() override; | 216 ~AccessibilityManager() override; |
209 | 217 |
210 private: | 218 private: |
211 void LoadChromeVox(); | 219 void LoadChromeVox(); |
212 void LoadChromeVoxToUserScreen(const base::Closure& done_cb); | 220 void LoadChromeVoxToUserScreen(const base::Closure& done_cb); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 bool system_sounds_enabled_; | 294 bool system_sounds_enabled_; |
287 | 295 |
288 AccessibilityStatusCallbackList callback_list_; | 296 AccessibilityStatusCallbackList callback_list_; |
289 | 297 |
290 bool braille_display_connected_; | 298 bool braille_display_connected_; |
291 ScopedObserver<extensions::api::braille_display_private::BrailleController, | 299 ScopedObserver<extensions::api::braille_display_private::BrailleController, |
292 AccessibilityManager> scoped_braille_observer_; | 300 AccessibilityManager> scoped_braille_observer_; |
293 | 301 |
294 bool braille_ime_current_; | 302 bool braille_ime_current_; |
295 | 303 |
| 304 ChromeVoxPanel* chromevox_panel_; |
| 305 scoped_ptr<ChromeVoxPanelWidgetObserver> chromevox_panel_widget_observer_; |
| 306 |
296 base::WeakPtrFactory<AccessibilityManager> weak_ptr_factory_; | 307 base::WeakPtrFactory<AccessibilityManager> weak_ptr_factory_; |
297 | 308 |
298 DISALLOW_COPY_AND_ASSIGN(AccessibilityManager); | 309 DISALLOW_COPY_AND_ASSIGN(AccessibilityManager); |
299 }; | 310 }; |
300 | 311 |
301 } // namespace chromeos | 312 } // namespace chromeos |
302 | 313 |
303 #endif // CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_ACCESSIBILITY_MANAGER_H_ | 314 #endif // CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_ACCESSIBILITY_MANAGER_H_ |
OLD | NEW |