| 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/common/accessibility_types.h" | 10 #include "ash/common/accessibility_types.h" |
| 11 #include "ash/common/session/session_state_observer.h" | |
| 12 #include "ash/common/shell_observer.h" | 11 #include "ash/common/shell_observer.h" |
| 13 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
| 14 #include "base/callback_list.h" | 13 #include "base/callback_list.h" |
| 15 #include "base/macros.h" | 14 #include "base/macros.h" |
| 16 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 17 #include "base/scoped_observer.h" | 16 #include "base/scoped_observer.h" |
| 18 #include "base/time/time.h" | 17 #include "base/time/time.h" |
| 19 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" | 18 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" |
| 20 #include "chrome/browser/chromeos/accessibility/chromevox_panel.h" | 19 #include "chrome/browser/chromeos/accessibility/chromevox_panel.h" |
| 21 #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" |
| 22 #include "components/prefs/pref_change_registrar.h" | 21 #include "components/prefs/pref_change_registrar.h" |
| 22 #include "components/user_manager/user_manager.h" |
| 23 #include "content/public/browser/notification_observer.h" | 23 #include "content/public/browser/notification_observer.h" |
| 24 #include "content/public/browser/notification_registrar.h" | 24 #include "content/public/browser/notification_registrar.h" |
| 25 #include "extensions/browser/event_router.h" | 25 #include "extensions/browser/event_router.h" |
| 26 #include "extensions/browser/extension_system.h" | 26 #include "extensions/browser/extension_system.h" |
| 27 #include "ui/base/ime/chromeos/input_method_manager.h" | 27 #include "ui/base/ime/chromeos/input_method_manager.h" |
| 28 | 28 |
| 29 class Profile; | 29 class Profile; |
| 30 | 30 |
| 31 namespace gfx { | 31 namespace gfx { |
| 32 class Rect; | 32 class Rect; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 // used. | 85 // used. |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 // AccessibilityManager changes the statuses of accessibility features | 88 // AccessibilityManager changes the statuses of accessibility features |
| 89 // watching profile notifications and pref-changes. | 89 // watching profile notifications and pref-changes. |
| 90 // TODO(yoshiki): merge MagnificationManager with AccessibilityManager. | 90 // TODO(yoshiki): merge MagnificationManager with AccessibilityManager. |
| 91 class AccessibilityManager | 91 class AccessibilityManager |
| 92 : public content::NotificationObserver, | 92 : public content::NotificationObserver, |
| 93 public extensions::api::braille_display_private::BrailleObserver, | 93 public extensions::api::braille_display_private::BrailleObserver, |
| 94 public extensions::ExtensionRegistryObserver, | 94 public extensions::ExtensionRegistryObserver, |
| 95 public ash::SessionStateObserver, | 95 public user_manager::UserManager::UserSessionStateObserver, |
| 96 public ash::ShellObserver, | 96 public ash::ShellObserver, |
| 97 public input_method::InputMethodManager::Observer { | 97 public input_method::InputMethodManager::Observer { |
| 98 public: | 98 public: |
| 99 // Creates an instance of AccessibilityManager, this should be called once, | 99 // Creates an instance of AccessibilityManager, this should be called once, |
| 100 // because only one instance should exist at the same time. | 100 // because only one instance should exist at the same time. |
| 101 static void Initialize(); | 101 static void Initialize(); |
| 102 // Deletes the existing instance of AccessibilityManager. | 102 // Deletes the existing instance of AccessibilityManager. |
| 103 static void Shutdown(); | 103 static void Shutdown(); |
| 104 // Returns the existing instance. If there is no instance, returns NULL. | 104 // Returns the existing instance. If there is no instance, returns NULL. |
| 105 static AccessibilityManager* Get(); | 105 static AccessibilityManager* Get(); |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 // Invoked to enable or disable switch access. | 209 // Invoked to enable or disable switch access. |
| 210 void SetSwitchAccessEnabled(bool enabled); | 210 void SetSwitchAccessEnabled(bool enabled); |
| 211 | 211 |
| 212 // Returns if switch access is enabled. | 212 // Returns if switch access is enabled. |
| 213 bool IsSwitchAccessEnabled() const; | 213 bool IsSwitchAccessEnabled() const; |
| 214 | 214 |
| 215 // Returns true if a braille display is connected to the system, otherwise | 215 // Returns true if a braille display is connected to the system, otherwise |
| 216 // false. | 216 // false. |
| 217 bool IsBrailleDisplayConnected() const; | 217 bool IsBrailleDisplayConnected() const; |
| 218 | 218 |
| 219 // SessionStateObserver overrides: | 219 // user_manager::UserManager::UserSessionStateObserver overrides: |
| 220 void ActiveUserChanged(const AccountId& account_id) override; | 220 void ActiveUserChanged(const user_manager::User* active_user) override; |
| 221 | 221 |
| 222 // ShellObserver overrides: | 222 // ShellObserver overrides: |
| 223 void OnAppTerminating() override; | |
| 224 void OnFullscreenStateChanged(bool is_fullscreen, | 223 void OnFullscreenStateChanged(bool is_fullscreen, |
| 225 ash::WmWindow* root_window) override; | 224 ash::WmWindow* root_window) override; |
| 226 | 225 |
| 227 void SetProfileForTest(Profile* profile); | 226 void SetProfileForTest(Profile* profile); |
| 228 | 227 |
| 229 static void SetBrailleControllerForTest( | 228 static void SetBrailleControllerForTest( |
| 230 extensions::api::braille_display_private::BrailleController* controller); | 229 extensions::api::braille_display_private::BrailleController* controller); |
| 231 | 230 |
| 232 // Enables/disables system sounds. | 231 // Enables/disables system sounds. |
| 233 void EnableSystemSounds(bool system_sounds_enabled); | 232 void EnableSystemSounds(bool system_sounds_enabled); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 void InputMethodChanged(input_method::InputMethodManager* manager, | 347 void InputMethodChanged(input_method::InputMethodManager* manager, |
| 349 Profile* profile, | 348 Profile* profile, |
| 350 bool show_message) override; | 349 bool show_message) override; |
| 351 | 350 |
| 352 // Profile which has the current a11y context. | 351 // Profile which has the current a11y context. |
| 353 Profile* profile_; | 352 Profile* profile_; |
| 354 | 353 |
| 355 content::NotificationRegistrar notification_registrar_; | 354 content::NotificationRegistrar notification_registrar_; |
| 356 std::unique_ptr<PrefChangeRegistrar> pref_change_registrar_; | 355 std::unique_ptr<PrefChangeRegistrar> pref_change_registrar_; |
| 357 std::unique_ptr<PrefChangeRegistrar> local_state_pref_change_registrar_; | 356 std::unique_ptr<PrefChangeRegistrar> local_state_pref_change_registrar_; |
| 358 std::unique_ptr<ash::ScopedSessionStateObserver> session_state_observer_; | 357 std::unique_ptr<user_manager::ScopedUserSessionStateObserver> |
| 358 session_state_observer_; |
| 359 | 359 |
| 360 PrefHandler large_cursor_pref_handler_; | 360 PrefHandler large_cursor_pref_handler_; |
| 361 PrefHandler spoken_feedback_pref_handler_; | 361 PrefHandler spoken_feedback_pref_handler_; |
| 362 PrefHandler high_contrast_pref_handler_; | 362 PrefHandler high_contrast_pref_handler_; |
| 363 PrefHandler autoclick_pref_handler_; | 363 PrefHandler autoclick_pref_handler_; |
| 364 PrefHandler autoclick_delay_pref_handler_; | 364 PrefHandler autoclick_delay_pref_handler_; |
| 365 PrefHandler virtual_keyboard_pref_handler_; | 365 PrefHandler virtual_keyboard_pref_handler_; |
| 366 PrefHandler mono_audio_pref_handler_; | 366 PrefHandler mono_audio_pref_handler_; |
| 367 PrefHandler caret_highlight_pref_handler_; | 367 PrefHandler caret_highlight_pref_handler_; |
| 368 PrefHandler cursor_highlight_pref_handler_; | 368 PrefHandler cursor_highlight_pref_handler_; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 std::unique_ptr<AccessibilityExtensionLoader> switch_access_loader_; | 422 std::unique_ptr<AccessibilityExtensionLoader> switch_access_loader_; |
| 423 | 423 |
| 424 base::WeakPtrFactory<AccessibilityManager> weak_ptr_factory_; | 424 base::WeakPtrFactory<AccessibilityManager> weak_ptr_factory_; |
| 425 | 425 |
| 426 DISALLOW_COPY_AND_ASSIGN(AccessibilityManager); | 426 DISALLOW_COPY_AND_ASSIGN(AccessibilityManager); |
| 427 }; | 427 }; |
| 428 | 428 |
| 429 } // namespace chromeos | 429 } // namespace chromeos |
| 430 | 430 |
| 431 #endif // CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_ACCESSIBILITY_MANAGER_H_ | 431 #endif // CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_ACCESSIBILITY_MANAGER_H_ |
| OLD | NEW |