| 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; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 62 |
| 62 typedef base::Callback<void(const AccessibilityStatusEventDetails&)> | 63 typedef base::Callback<void(const AccessibilityStatusEventDetails&)> |
| 63 AccessibilityStatusCallback; | 64 AccessibilityStatusCallback; |
| 64 | 65 |
| 65 typedef base::CallbackList<void(const AccessibilityStatusEventDetails&)> | 66 typedef base::CallbackList<void(const AccessibilityStatusEventDetails&)> |
| 66 AccessibilityStatusCallbackList; | 67 AccessibilityStatusCallbackList; |
| 67 | 68 |
| 68 typedef AccessibilityStatusCallbackList::Subscription | 69 typedef AccessibilityStatusCallbackList::Subscription |
| 69 AccessibilityStatusSubscription; | 70 AccessibilityStatusSubscription; |
| 70 | 71 |
| 72 class ChromeVoxPanelWidgetObserver; |
| 73 |
| 71 // AccessibilityManager changes the statuses of accessibility features | 74 // AccessibilityManager changes the statuses of accessibility features |
| 72 // watching profile notifications and pref-changes. | 75 // watching profile notifications and pref-changes. |
| 73 // TODO(yoshiki): merge MagnificationManager with AccessibilityManager. | 76 // TODO(yoshiki): merge MagnificationManager with AccessibilityManager. |
| 74 class AccessibilityManager | 77 class AccessibilityManager |
| 75 : public content::NotificationObserver, | 78 : public content::NotificationObserver, |
| 76 public extensions::api::braille_display_private::BrailleObserver, | 79 public extensions::api::braille_display_private::BrailleObserver, |
| 77 public ash::SessionStateObserver, | 80 public ash::SessionStateObserver, |
| 78 public ash::ShellObserver, | 81 public ash::ShellObserver, |
| 79 public input_method::InputMethodManager::Observer { | 82 public input_method::InputMethodManager::Observer { |
| 80 public: | 83 public: |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 AccessibilityStatusEventDetails& details); | 196 AccessibilityStatusEventDetails& details); |
| 194 | 197 |
| 195 // Notify accessibility when locale changes occur. | 198 // Notify accessibility when locale changes occur. |
| 196 void OnLocaleChanged(); | 199 void OnLocaleChanged(); |
| 197 | 200 |
| 198 // Plays an earcon. Earcons are brief and distinctive sounds that indicate | 201 // 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 | 202 // when their mapped event has occurred. The sound key enums can be found in |
| 200 // chromeos/audio/chromeos_sounds.h. | 203 // chromeos/audio/chromeos_sounds.h. |
| 201 void PlayEarcon(int sound_key); | 204 void PlayEarcon(int sound_key); |
| 202 | 205 |
| 206 // Get work area insets due to accessibility overlays on one of the |
| 207 // screen edges. |
| 208 gfx::Insets GetWorkAreaInsets(aura::Window* root_window) const; |
| 209 |
| 210 // Called by our widget observer when the ChromeVoxPanel is closing. |
| 211 void OnChromeVoxPanelClosing(); |
| 212 |
| 203 // Profile having the a11y context. | 213 // Profile having the a11y context. |
| 204 Profile* profile() { return profile_; } | 214 Profile* profile() { return profile_; } |
| 205 | 215 |
| 206 protected: | 216 protected: |
| 207 AccessibilityManager(); | 217 AccessibilityManager(); |
| 208 ~AccessibilityManager() override; | 218 ~AccessibilityManager() override; |
| 209 | 219 |
| 210 private: | 220 private: |
| 211 void LoadChromeVox(); | 221 void LoadChromeVox(); |
| 212 void LoadChromeVoxToUserScreen(const base::Closure& done_cb); | 222 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_; | 296 bool system_sounds_enabled_; |
| 287 | 297 |
| 288 AccessibilityStatusCallbackList callback_list_; | 298 AccessibilityStatusCallbackList callback_list_; |
| 289 | 299 |
| 290 bool braille_display_connected_; | 300 bool braille_display_connected_; |
| 291 ScopedObserver<extensions::api::braille_display_private::BrailleController, | 301 ScopedObserver<extensions::api::braille_display_private::BrailleController, |
| 292 AccessibilityManager> scoped_braille_observer_; | 302 AccessibilityManager> scoped_braille_observer_; |
| 293 | 303 |
| 294 bool braille_ime_current_; | 304 bool braille_ime_current_; |
| 295 | 305 |
| 306 ChromeVoxPanel* chromevox_panel_; |
| 307 ChromeVoxPanelWidgetObserver* chromevox_panel_widget_observer_; |
| 308 |
| 296 base::WeakPtrFactory<AccessibilityManager> weak_ptr_factory_; | 309 base::WeakPtrFactory<AccessibilityManager> weak_ptr_factory_; |
| 297 | 310 |
| 298 DISALLOW_COPY_AND_ASSIGN(AccessibilityManager); | 311 DISALLOW_COPY_AND_ASSIGN(AccessibilityManager); |
| 299 }; | 312 }; |
| 300 | 313 |
| 301 } // namespace chromeos | 314 } // namespace chromeos |
| 302 | 315 |
| 303 #endif // CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_ACCESSIBILITY_MANAGER_H_ | 316 #endif // CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_ACCESSIBILITY_MANAGER_H_ |
| OLD | NEW |