| 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 "app/keyboard_codes.h" | 9 #include "base/keyboard_codes.h" |
| 10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
| 11 #include "base/singleton.h" | 11 #include "base/singleton.h" |
| 12 #include "chrome/browser/chromeos/login/wizard_accessibility_handler.h" | 12 #include "chrome/browser/chromeos/login/wizard_accessibility_handler.h" |
| 13 #include "chrome/browser/views/accessible_view_helper.h" | 13 #include "chrome/browser/views/accessible_view_helper.h" |
| 14 #include "chrome/common/notification_registrar.h" | 14 #include "chrome/common/notification_registrar.h" |
| 15 | 15 |
| 16 class Profile; | 16 class Profile; |
| 17 namespace views { | 17 namespace views { |
| 18 class View; | 18 class View; |
| 19 } | 19 } |
| 20 | 20 |
| 21 // Class that provides convenience methods to enable accessibility for a | 21 // Class that provides convenience methods to enable accessibility for a |
| 22 // specified View. | 22 // specified View. |
| 23 class WizardAccessibilityHelper { | 23 class WizardAccessibilityHelper { |
| 24 public: | 24 public: |
| 25 // Get Singleton instance of WizardAccessibilityHelper. | 25 // Get Singleton instance of WizardAccessibilityHelper. |
| 26 static WizardAccessibilityHelper* GetInstance(); | 26 static WizardAccessibilityHelper* GetInstance(); |
| 27 | 27 |
| 28 // Enables Accessibility by setting the accessibility pref and | 28 // Enables Accessibility by setting the accessibility pref and |
| 29 // registering the specified view_tree to raise UI notifications. | 29 // registering the specified view_tree to raise UI notifications. |
| 30 void EnableAccessibility(views::View* view_tree, Profile* profile); | 30 void EnableAccessibility(views::View* view_tree, Profile* profile); |
| 31 | 31 |
| 32 // Enabled accessibility for the specified view_tree if the | 32 // Enabled accessibility for the specified view_tree if the |
| 33 // accessibility pref is already set. | 33 // accessibility pref is already set. |
| 34 void MaybeEnableAccessibility(views::View* view_tree, Profile* profile); | 34 void MaybeEnableAccessibility(views::View* view_tree, Profile* profile); |
| 35 | 35 |
| 36 // Keyboard accelerator key to enable accessibility. | 36 // Keyboard accelerator key to enable accessibility. |
| 37 static const app::KeyboardCode accelerator = app::VKEY_Z; | 37 static const base::KeyboardCode accelerator = base::VKEY_Z; |
| 38 | 38 |
| 39 private: | 39 private: |
| 40 friend struct DefaultSingletonTraits<WizardAccessibilityHelper>; | 40 friend struct DefaultSingletonTraits<WizardAccessibilityHelper>; |
| 41 WizardAccessibilityHelper(); | 41 WizardAccessibilityHelper(); |
| 42 ~WizardAccessibilityHelper() {} | 42 ~WizardAccessibilityHelper() {} |
| 43 | 43 |
| 44 scoped_ptr<AccessibleViewHelper> accessible_view_helper_; | 44 scoped_ptr<AccessibleViewHelper> accessible_view_helper_; |
| 45 | 45 |
| 46 scoped_ptr<WizardAccessibilityHandler> accessibility_handler_; | 46 scoped_ptr<WizardAccessibilityHandler> accessibility_handler_; |
| 47 | 47 |
| 48 // Used for tracking registrations to accessibility notifications. | 48 // Used for tracking registrations to accessibility notifications. |
| 49 NotificationRegistrar registrar_; | 49 NotificationRegistrar registrar_; |
| 50 | 50 |
| 51 DISALLOW_COPY_AND_ASSIGN(WizardAccessibilityHelper); | 51 DISALLOW_COPY_AND_ASSIGN(WizardAccessibilityHelper); |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_ACCESSIBILITY_HELPER_H_ | 54 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_ACCESSIBILITY_HELPER_H_ |
| OLD | NEW |