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 "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
11 #include "base/callback_list.h" | 12 #include "base/callback_list.h" |
12 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
13 #include "base/prefs/pref_change_registrar.h" | 14 #include "base/prefs/pref_change_registrar.h" |
14 #include "base/scoped_observer.h" | 15 #include "base/scoped_observer.h" |
15 #include "base/time/time.h" | 16 #include "base/time/time.h" |
16 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" | 17 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" |
17 #include "chrome/browser/extensions/api/braille_display_private/braille_controll
er.h" | 18 #include "chrome/browser/extensions/api/braille_display_private/braille_controll
er.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 #include "ui/base/ime/chromeos/input_method_manager.h" | 23 #include "ui/base/ime/chromeos/input_method_manager.h" |
23 #include "ui/chromeos/accessibility_types.h" | 24 #include "ui/chromeos/accessibility_types.h" |
24 | 25 |
25 #if !defined(USE_ATHENA) | |
26 #include "ash/session/session_state_observer.h" | |
27 #endif | |
28 | |
29 namespace content { | 26 namespace content { |
30 class RenderViewHost; | 27 class RenderViewHost; |
31 } | 28 } |
32 class Profile; | 29 class Profile; |
33 | 30 |
34 namespace chromeos { | 31 namespace chromeos { |
35 | 32 |
36 enum AccessibilityNotificationType { | 33 enum AccessibilityNotificationType { |
37 ACCESSIBILITY_MANAGER_SHUTDOWN, | 34 ACCESSIBILITY_MANAGER_SHUTDOWN, |
38 ACCESSIBILITY_TOGGLE_HIGH_CONTRAST_MODE, | 35 ACCESSIBILITY_TOGGLE_HIGH_CONTRAST_MODE, |
(...skipping 30 matching lines...) Expand all Loading... |
69 | 66 |
70 typedef AccessibilityStatusCallbackList::Subscription | 67 typedef AccessibilityStatusCallbackList::Subscription |
71 AccessibilityStatusSubscription; | 68 AccessibilityStatusSubscription; |
72 | 69 |
73 // AccessibilityManager changes the statuses of accessibility features | 70 // AccessibilityManager changes the statuses of accessibility features |
74 // watching profile notifications and pref-changes. | 71 // watching profile notifications and pref-changes. |
75 // TODO(yoshiki): merge MagnificationManager with AccessibilityManager. | 72 // TODO(yoshiki): merge MagnificationManager with AccessibilityManager. |
76 class AccessibilityManager | 73 class AccessibilityManager |
77 : public content::NotificationObserver, | 74 : public content::NotificationObserver, |
78 public extensions::api::braille_display_private::BrailleObserver, | 75 public extensions::api::braille_display_private::BrailleObserver, |
79 #if !defined(USE_ATHENA) | |
80 public ash::SessionStateObserver, | 76 public ash::SessionStateObserver, |
81 #endif | |
82 public input_method::InputMethodManager::Observer { | 77 public input_method::InputMethodManager::Observer { |
83 public: | 78 public: |
84 // Creates an instance of AccessibilityManager, this should be called once, | 79 // Creates an instance of AccessibilityManager, this should be called once, |
85 // because only one instance should exist at the same time. | 80 // because only one instance should exist at the same time. |
86 static void Initialize(); | 81 static void Initialize(); |
87 // Deletes the existing instance of AccessibilityManager. | 82 // Deletes the existing instance of AccessibilityManager. |
88 static void Shutdown(); | 83 static void Shutdown(); |
89 // Returns the existing instance. If there is no instance, returns NULL. | 84 // Returns the existing instance. If there is no instance, returns NULL. |
90 static AccessibilityManager* Get(); | 85 static AccessibilityManager* Get(); |
91 | 86 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 154 |
160 // Enables or disables the virtual keyboard. | 155 // Enables or disables the virtual keyboard. |
161 void EnableVirtualKeyboard(bool enabled); | 156 void EnableVirtualKeyboard(bool enabled); |
162 // Returns true if the virtual keyboard is enabled, otherwise false. | 157 // Returns true if the virtual keyboard is enabled, otherwise false. |
163 bool IsVirtualKeyboardEnabled(); | 158 bool IsVirtualKeyboardEnabled(); |
164 | 159 |
165 // Returns true if a braille display is connected to the system, otherwise | 160 // Returns true if a braille display is connected to the system, otherwise |
166 // false. | 161 // false. |
167 bool IsBrailleDisplayConnected() const; | 162 bool IsBrailleDisplayConnected() const; |
168 | 163 |
169 #if !defined(USE_ATHENA) | |
170 // SessionStateObserver overrides: | 164 // SessionStateObserver overrides: |
171 virtual void ActiveUserChanged(const std::string& user_id) override; | 165 virtual void ActiveUserChanged(const std::string& user_id) override; |
172 #endif | |
173 | 166 |
174 void SetProfileForTest(Profile* profile); | 167 void SetProfileForTest(Profile* profile); |
175 | 168 |
176 static void SetBrailleControllerForTest( | 169 static void SetBrailleControllerForTest( |
177 extensions::api::braille_display_private::BrailleController* controller); | 170 extensions::api::braille_display_private::BrailleController* controller); |
178 | 171 |
179 // Enables/disables system sounds. | 172 // Enables/disables system sounds. |
180 void EnableSystemSounds(bool system_sounds_enabled); | 173 void EnableSystemSounds(bool system_sounds_enabled); |
181 | 174 |
182 // Initiates play of shutdown sound and returns it's duration. | 175 // Initiates play of shutdown sound and returns it's duration. |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 Profile* profile_; | 247 Profile* profile_; |
255 | 248 |
256 // Profile which ChromeVox is currently loaded to. If NULL, ChromeVox is not | 249 // Profile which ChromeVox is currently loaded to. If NULL, ChromeVox is not |
257 // loaded to any profile. | 250 // loaded to any profile. |
258 bool chrome_vox_loaded_on_lock_screen_; | 251 bool chrome_vox_loaded_on_lock_screen_; |
259 bool chrome_vox_loaded_on_user_screen_; | 252 bool chrome_vox_loaded_on_user_screen_; |
260 | 253 |
261 content::NotificationRegistrar notification_registrar_; | 254 content::NotificationRegistrar notification_registrar_; |
262 scoped_ptr<PrefChangeRegistrar> pref_change_registrar_; | 255 scoped_ptr<PrefChangeRegistrar> pref_change_registrar_; |
263 scoped_ptr<PrefChangeRegistrar> local_state_pref_change_registrar_; | 256 scoped_ptr<PrefChangeRegistrar> local_state_pref_change_registrar_; |
264 #if !defined(USE_ATHENA) | |
265 scoped_ptr<ash::ScopedSessionStateObserver> session_state_observer_; | 257 scoped_ptr<ash::ScopedSessionStateObserver> session_state_observer_; |
266 #endif | |
267 | 258 |
268 PrefHandler large_cursor_pref_handler_; | 259 PrefHandler large_cursor_pref_handler_; |
269 PrefHandler spoken_feedback_pref_handler_; | 260 PrefHandler spoken_feedback_pref_handler_; |
270 PrefHandler high_contrast_pref_handler_; | 261 PrefHandler high_contrast_pref_handler_; |
271 PrefHandler autoclick_pref_handler_; | 262 PrefHandler autoclick_pref_handler_; |
272 PrefHandler autoclick_delay_pref_handler_; | 263 PrefHandler autoclick_delay_pref_handler_; |
273 PrefHandler virtual_keyboard_pref_handler_; | 264 PrefHandler virtual_keyboard_pref_handler_; |
274 | 265 |
275 bool large_cursor_enabled_; | 266 bool large_cursor_enabled_; |
276 bool sticky_keys_enabled_; | 267 bool sticky_keys_enabled_; |
(...skipping 18 matching lines...) Expand all Loading... |
295 bool braille_ime_current_; | 286 bool braille_ime_current_; |
296 | 287 |
297 base::WeakPtrFactory<AccessibilityManager> weak_ptr_factory_; | 288 base::WeakPtrFactory<AccessibilityManager> weak_ptr_factory_; |
298 | 289 |
299 DISALLOW_COPY_AND_ASSIGN(AccessibilityManager); | 290 DISALLOW_COPY_AND_ASSIGN(AccessibilityManager); |
300 }; | 291 }; |
301 | 292 |
302 } // namespace chromeos | 293 } // namespace chromeos |
303 | 294 |
304 #endif // CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_ACCESSIBILITY_MANAGER_H_ | 295 #endif // CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_ACCESSIBILITY_MANAGER_H_ |
OLD | NEW |