| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_LOGIN_WIZARD_ACCESSIBILITY_HELPER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_ACCESSIBILITY_HELPER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_ACCESSIBILITY_HELPER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_ACCESSIBILITY_HELPER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 public: | 30 public: |
| 31 // Get Singleton instance of WizardAccessibilityHelper. | 31 // Get Singleton instance of WizardAccessibilityHelper. |
| 32 static WizardAccessibilityHelper* GetInstance(); | 32 static WizardAccessibilityHelper* GetInstance(); |
| 33 | 33 |
| 34 // Get accelerator for enabling accessibility. | 34 // Get accelerator for enabling accessibility. |
| 35 static views::Accelerator GetAccelerator(); | 35 static views::Accelerator GetAccelerator(); |
| 36 | 36 |
| 37 // Enables Accessibility by setting the accessibility pref and registers | 37 // Enables Accessibility by setting the accessibility pref and registers |
| 38 // all views in the view buffer to raise accessibility notifications, | 38 // all views in the view buffer to raise accessibility notifications, |
| 39 // including the specified |view_tree|. | 39 // including the specified |view_tree|. |
| 40 void EnableAccessibility(views::View* view_tree); | 40 void EnableAccessibilityForView(views::View* view_tree); |
| 41 | 41 |
| 42 // Enables accessibility for the specified |view_tree| if the | 42 // Enables accessibility for the specified |view_tree| if the |
| 43 // accessibility pref is already set. Otherwise the |view_tree| is | 43 // accessibility pref is already set. Otherwise the |view_tree| is |
| 44 // added to a view buffer so that accessibility can be enabled for it | 44 // added to a view buffer so that accessibility can be enabled for it |
| 45 // later when requested. | 45 // later when requested. |
| 46 void MaybeEnableAccessibility(views::View* view_tree); | 46 void MaybeEnableAccessibility(views::View* view_tree); |
| 47 | 47 |
| 48 // Speak the given text if the accessibility pref is already set. |queue| | 48 // Speak the given text if the accessibility pref is already set. |queue| |
| 49 // specifies whether this utterance will be queued or spoken immediately. | 49 // specifies whether this utterance will be queued or spoken immediately. |
| 50 // |interruptible| specified whether this utterance can be flushed by a | 50 // |interruptible| specified whether this utterance can be flushed by a |
| 51 // subsequent utterance. | 51 // subsequent utterance. |
| 52 void MaybeSpeak(const char* str, bool queue, bool interruptible); | 52 void MaybeSpeak(const char* str, bool queue, bool interruptible); |
| 53 | 53 |
| 54 // Unregisters all accessibility notifications | 54 // Unregisters all accessibility notifications |
| 55 void UnregisterNotifications(); | 55 void UnregisterNotifications(); |
| 56 | 56 |
| 57 // Toggles accessibility support. If |view_tree| is null, only the |
| 58 // access preference setting is toggled. |view_tree| has no effect while |
| 59 // disabling accessibility. |
| 60 void ToggleAccessibility(views::View* view_tree); |
| 61 |
| 57 private: | 62 private: |
| 58 friend struct DefaultSingletonTraits<WizardAccessibilityHelper>; | 63 friend struct DefaultSingletonTraits<WizardAccessibilityHelper>; |
| 59 | 64 |
| 60 WizardAccessibilityHelper(); | 65 WizardAccessibilityHelper(); |
| 61 | 66 |
| 62 virtual ~WizardAccessibilityHelper() {} | 67 virtual ~WizardAccessibilityHelper() {} |
| 63 | 68 |
| 64 void RegisterNotifications(); | 69 void RegisterNotifications(); |
| 65 | 70 |
| 71 bool IsAccessibilityEnabled(); |
| 72 |
| 73 void SetAccessibilityEnabled(bool); |
| 74 |
| 66 static scoped_ptr<views::Accelerator> accelerator_; | 75 static scoped_ptr<views::Accelerator> accelerator_; |
| 67 | 76 |
| 68 void AddViewToBuffer(views::View* view_tree); | 77 void AddViewToBuffer(views::View* view_tree); |
| 69 | 78 |
| 70 std::map<views::View*, bool> views_buffer_; | 79 std::map<views::View*, bool> views_buffer_; |
| 71 | 80 |
| 72 std::vector<AccessibleViewHelper*> accessible_view_helpers_; | 81 std::vector<AccessibleViewHelper*> accessible_view_helpers_; |
| 73 | 82 |
| 74 scoped_ptr<WizardAccessibilityHandler> accessibility_handler_; | 83 scoped_ptr<WizardAccessibilityHandler> accessibility_handler_; |
| 75 | 84 |
| 76 Profile* profile_; | 85 Profile* profile_; |
| 77 | 86 |
| 78 // Used for tracking registrations to accessibility notifications. | 87 // Used for tracking registrations to accessibility notifications. |
| 79 NotificationRegistrar registrar_; | 88 NotificationRegistrar registrar_; |
| 80 | 89 |
| 81 bool registered_notifications_; | 90 bool registered_notifications_; |
| 82 | 91 |
| 83 DISALLOW_COPY_AND_ASSIGN(WizardAccessibilityHelper); | 92 DISALLOW_COPY_AND_ASSIGN(WizardAccessibilityHelper); |
| 84 }; | 93 }; |
| 85 | 94 |
| 86 } // namespace chromeos | 95 } // namespace chromeos |
| 87 | 96 |
| 88 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_ACCESSIBILITY_HELPER_H_ | 97 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_ACCESSIBILITY_HELPER_H_ |
| OLD | NEW |