| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
| 11 #include "chrome/browser/chromeos/login/wizard_accessibility_handler.h" | 11 #include "chrome/browser/chromeos/login/wizard_accessibility_handler.h" |
| 12 #include "content/public/browser/notification_registrar.h" | 12 #include "content/public/browser/notification_registrar.h" |
| 13 #include "ui/base/keycodes/keyboard_codes.h" | 13 #include "ui/base/keycodes/keyboard_codes.h" |
| 14 #include "ui/base/models/accelerator.h" |
| 14 | 15 |
| 15 class Profile; | 16 class Profile; |
| 16 namespace views { | 17 namespace views { |
| 17 class Accelerator; | |
| 18 class View; | 18 class View; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace chromeos { | 21 namespace chromeos { |
| 22 | 22 |
| 23 // Class that provides convenience methods to enable accessibility for a | 23 // Class that provides convenience methods to enable accessibility for a |
| 24 // specified View. | 24 // specified View. |
| 25 class WizardAccessibilityHelper { | 25 class WizardAccessibilityHelper { |
| 26 public: | 26 public: |
| 27 // Get Singleton instance of WizardAccessibilityHelper. | 27 // Get Singleton instance of WizardAccessibilityHelper. |
| 28 static WizardAccessibilityHelper* GetInstance(); | 28 static WizardAccessibilityHelper* GetInstance(); |
| 29 | 29 |
| 30 // Get accelerator for enabling accessibility. | 30 // Get accelerator for enabling accessibility. |
| 31 static views::Accelerator GetAccelerator(); | 31 static ui::Accelerator GetAccelerator(); |
| 32 | 32 |
| 33 // Speak the given text if the accessibility pref is already set. |queue| | 33 // Speak the given text if the accessibility pref is already set. |queue| |
| 34 // specifies whether this utterance will be queued or spoken immediately. | 34 // specifies whether this utterance will be queued or spoken immediately. |
| 35 // |interruptible| specified whether this utterance can be flushed by a | 35 // |interruptible| specified whether this utterance can be flushed by a |
| 36 // subsequent utterance. | 36 // subsequent utterance. |
| 37 // TODO (chaitanyag): Change API to use string16 instead of char*. | 37 // TODO (chaitanyag): Change API to use string16 instead of char*. |
| 38 void MaybeSpeak(const char* str, bool queue, bool interruptible); | 38 void MaybeSpeak(const char* str, bool queue, bool interruptible); |
| 39 | 39 |
| 40 // Unregisters all accessibility notifications | 40 // Unregisters all accessibility notifications |
| 41 void UnregisterNotifications(); | 41 void UnregisterNotifications(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 52 WizardAccessibilityHelper(); | 52 WizardAccessibilityHelper(); |
| 53 | 53 |
| 54 virtual ~WizardAccessibilityHelper(); | 54 virtual ~WizardAccessibilityHelper(); |
| 55 | 55 |
| 56 void RegisterNotifications(); | 56 void RegisterNotifications(); |
| 57 | 57 |
| 58 bool IsAccessibilityEnabled(); | 58 bool IsAccessibilityEnabled(); |
| 59 | 59 |
| 60 void SetAccessibilityEnabled(bool); | 60 void SetAccessibilityEnabled(bool); |
| 61 | 61 |
| 62 static scoped_ptr<views::Accelerator> accelerator_; | 62 static scoped_ptr<ui::Accelerator> accelerator_; |
| 63 | 63 |
| 64 scoped_ptr<WizardAccessibilityHandler> accessibility_handler_; | 64 scoped_ptr<WizardAccessibilityHandler> accessibility_handler_; |
| 65 | 65 |
| 66 Profile* profile_; | 66 Profile* profile_; |
| 67 | 67 |
| 68 // Used for tracking registrations to accessibility notifications. | 68 // Used for tracking registrations to accessibility notifications. |
| 69 content::NotificationRegistrar registrar_; | 69 content::NotificationRegistrar registrar_; |
| 70 | 70 |
| 71 bool registered_notifications_; | 71 bool registered_notifications_; |
| 72 | 72 |
| 73 DISALLOW_COPY_AND_ASSIGN(WizardAccessibilityHelper); | 73 DISALLOW_COPY_AND_ASSIGN(WizardAccessibilityHelper); |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 } // namespace chromeos | 76 } // namespace chromeos |
| 77 | 77 |
| 78 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_ACCESSIBILITY_HELPER_H_ | 78 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_ACCESSIBILITY_HELPER_H_ |
| OLD | NEW |