| 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/accessibility_delegate.h" | 10 #include "ash/accessibility_delegate.h" |
| 11 #include "ash/session_state_observer.h" | 11 #include "ash/session_state_observer.h" |
| 12 #include "base/callback_list.h" | 12 #include "base/callback_list.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/prefs/pref_change_registrar.h" | 14 #include "base/prefs/pref_change_registrar.h" |
| 15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" | 16 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" |
| 17 #include "chrome/browser/extensions/api/braille_display_private/braille_controll
er.h" | 17 #include "chrome/browser/extensions/api/braille_display_private/braille_controll
er.h" |
| 18 #include "chromeos/ime/input_method_manager.h" |
| 18 #include "content/public/browser/notification_observer.h" | 19 #include "content/public/browser/notification_observer.h" |
| 19 #include "content/public/browser/notification_registrar.h" | 20 #include "content/public/browser/notification_registrar.h" |
| 20 #include "extensions/browser/event_router.h" | 21 #include "extensions/browser/event_router.h" |
| 21 #include "extensions/browser/extension_system.h" | 22 #include "extensions/browser/extension_system.h" |
| 22 | 23 |
| 23 namespace content { | 24 namespace content { |
| 24 class RenderViewHost; | 25 class RenderViewHost; |
| 25 } | 26 } |
| 26 class Profile; | 27 class Profile; |
| 27 | 28 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 60 |
| 60 typedef base::CallbackList<void(const AccessibilityStatusEventDetails&)> | 61 typedef base::CallbackList<void(const AccessibilityStatusEventDetails&)> |
| 61 AccessibilityStatusCallbackList; | 62 AccessibilityStatusCallbackList; |
| 62 | 63 |
| 63 typedef AccessibilityStatusCallbackList::Subscription | 64 typedef AccessibilityStatusCallbackList::Subscription |
| 64 AccessibilityStatusSubscription; | 65 AccessibilityStatusSubscription; |
| 65 | 66 |
| 66 // AccessibilityManager changes the statuses of accessibility features | 67 // AccessibilityManager changes the statuses of accessibility features |
| 67 // watching profile notifications and pref-changes. | 68 // watching profile notifications and pref-changes. |
| 68 // TODO(yoshiki): merge MagnificationManager with AccessibilityManager. | 69 // TODO(yoshiki): merge MagnificationManager with AccessibilityManager. |
| 69 class AccessibilityManager : public content::NotificationObserver, | 70 class AccessibilityManager |
| 70 extensions::api::braille_display_private::BrailleObserver, | 71 : public content::NotificationObserver, |
| 71 public ash::SessionStateObserver { | 72 public extensions::api::braille_display_private::BrailleObserver, |
| 73 public input_method::InputMethodManager::Observer, |
| 74 public ash::SessionStateObserver { |
| 72 public: | 75 public: |
| 73 // Creates an instance of AccessibilityManager, this should be called once, | 76 // Creates an instance of AccessibilityManager, this should be called once, |
| 74 // because only one instance should exist at the same time. | 77 // because only one instance should exist at the same time. |
| 75 static void Initialize(); | 78 static void Initialize(); |
| 76 // Deletes the existing instance of AccessibilityManager. | 79 // Deletes the existing instance of AccessibilityManager. |
| 77 static void Shutdown(); | 80 static void Shutdown(); |
| 78 // Returns the existing instance. If there is no instance, returns NULL. | 81 // Returns the existing instance. If there is no instance, returns NULL. |
| 79 static AccessibilityManager* Get(); | 82 static AccessibilityManager* Get(); |
| 80 | 83 |
| 81 // On a user's first login into a device, any a11y features enabled/disabled | 84 // On a user's first login into a device, any a11y features enabled/disabled |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 virtual void Observe(int type, | 212 virtual void Observe(int type, |
| 210 const content::NotificationSource& source, | 213 const content::NotificationSource& source, |
| 211 const content::NotificationDetails& details) OVERRIDE; | 214 const content::NotificationDetails& details) OVERRIDE; |
| 212 | 215 |
| 213 // extensions::api::braille_display_private::BrailleObserver implementation. | 216 // extensions::api::braille_display_private::BrailleObserver implementation. |
| 214 // Enables spoken feedback if a braille display becomes available. | 217 // Enables spoken feedback if a braille display becomes available. |
| 215 virtual void OnDisplayStateChanged( | 218 virtual void OnDisplayStateChanged( |
| 216 const extensions::api::braille_display_private::DisplayState& | 219 const extensions::api::braille_display_private::DisplayState& |
| 217 display_state) OVERRIDE; | 220 display_state) OVERRIDE; |
| 218 | 221 |
| 222 // Overridden from InputMethodManager::Observer. |
| 223 virtual void InputMethodChanged(input_method::InputMethodManager* manager, |
| 224 bool show_message) OVERRIDE; |
| 225 |
| 226 |
| 219 // Profile which has the current a11y context. | 227 // Profile which has the current a11y context. |
| 220 Profile* profile_; | 228 Profile* profile_; |
| 221 | 229 |
| 222 // Profile which ChromeVox is currently loaded to. If NULL, ChromeVox is not | 230 // Profile which ChromeVox is currently loaded to. If NULL, ChromeVox is not |
| 223 // loaded to any profile. | 231 // loaded to any profile. |
| 224 bool chrome_vox_loaded_on_lock_screen_; | 232 bool chrome_vox_loaded_on_lock_screen_; |
| 225 bool chrome_vox_loaded_on_user_screen_; | 233 bool chrome_vox_loaded_on_user_screen_; |
| 226 | 234 |
| 227 content::NotificationRegistrar notification_registrar_; | 235 content::NotificationRegistrar notification_registrar_; |
| 228 scoped_ptr<PrefChangeRegistrar> pref_change_registrar_; | 236 scoped_ptr<PrefChangeRegistrar> pref_change_registrar_; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 253 bool system_sounds_enabled_; | 261 bool system_sounds_enabled_; |
| 254 | 262 |
| 255 AccessibilityStatusCallbackList callback_list_; | 263 AccessibilityStatusCallbackList callback_list_; |
| 256 | 264 |
| 257 DISALLOW_COPY_AND_ASSIGN(AccessibilityManager); | 265 DISALLOW_COPY_AND_ASSIGN(AccessibilityManager); |
| 258 }; | 266 }; |
| 259 | 267 |
| 260 } // namespace chromeos | 268 } // namespace chromeos |
| 261 | 269 |
| 262 #endif // CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_ACCESSIBILITY_MANAGER_H_ | 270 #endif // CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_ACCESSIBILITY_MANAGER_H_ |
| OLD | NEW |