| 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 #include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" | 5 #include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/chromeos/accessibility_util.h" | 10 #include "chrome/browser/chromeos/accessibility_util.h" |
| 11 #include "chrome/browser/extensions/extension_accessibility_api.h" | 11 #include "chrome/browser/extensions/extension_accessibility_api.h" |
| 12 #include "chrome/browser/prefs/pref_service.h" | 12 #include "chrome/browser/prefs/pref_service.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/browser/profiles/profile_manager.h" | 14 #include "chrome/browser/profiles/profile_manager.h" |
| 15 #include "chrome/common/chrome_notification_types.h" | 15 #include "chrome/common/chrome_notification_types.h" |
| 16 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
| 17 #include "content/public/browser/notification_registrar.h" | 17 #include "content/public/browser/notification_registrar.h" |
| 18 #include "content/public/browser/notification_service.h" | 18 #include "content/public/browser/notification_service.h" |
| 19 #include "grit/generated_resources.h" | 19 #include "grit/generated_resources.h" |
| 20 #include "ui/base/l10n/l10n_util.h" | 20 #include "ui/base/l10n/l10n_util.h" |
| 21 #include "ui/base/models/accelerator.h" | 21 #include "ui/base/models/accelerator.h" |
| 22 #include "views/view.h" | 22 #include "views/view.h" |
| 23 | 23 |
| 24 namespace chromeos { | 24 namespace chromeos { |
| 25 | 25 |
| 26 scoped_ptr<ui::Accelerator> WizardAccessibilityHelper::accelerator_; | |
| 27 | |
| 28 // static | 26 // static |
| 29 ui::Accelerator WizardAccessibilityHelper::GetAccelerator() { | 27 ui::Accelerator WizardAccessibilityHelper::GetAccelerator() { |
| 30 if (!WizardAccessibilityHelper::accelerator_.get()) | 28 return ui::Accelerator(ui::VKEY_Z, false, true, true); |
| 31 WizardAccessibilityHelper::accelerator_.reset( | |
| 32 new ui::Accelerator(ui::VKEY_Z, false, true, true)); | |
| 33 return *(WizardAccessibilityHelper::accelerator_.get()); | |
| 34 } | 29 } |
| 35 | 30 |
| 36 // static | 31 // static |
| 37 WizardAccessibilityHelper* WizardAccessibilityHelper::GetInstance() { | 32 WizardAccessibilityHelper* WizardAccessibilityHelper::GetInstance() { |
| 38 return Singleton<WizardAccessibilityHelper>::get(); | 33 return Singleton<WizardAccessibilityHelper>::get(); |
| 39 } | 34 } |
| 40 | 35 |
| 41 WizardAccessibilityHelper::WizardAccessibilityHelper() { | 36 WizardAccessibilityHelper::WizardAccessibilityHelper() { |
| 42 accessibility_handler_.reset(new WizardAccessibilityHandler()); | 37 accessibility_handler_.reset(new WizardAccessibilityHandler()); |
| 43 profile_ = ProfileManager::GetDefaultProfile(); | 38 profile_ = ProfileManager::GetDefaultProfile(); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 if (registered_notifications_) | 105 if (registered_notifications_) |
| 111 UnregisterNotifications(); | 106 UnregisterNotifications(); |
| 112 } | 107 } |
| 113 } | 108 } |
| 114 | 109 |
| 115 void WizardAccessibilityHelper::SetAccessibilityEnabled(bool enabled) { | 110 void WizardAccessibilityHelper::SetAccessibilityEnabled(bool enabled) { |
| 116 accessibility::EnableAccessibility(enabled, NULL); | 111 accessibility::EnableAccessibility(enabled, NULL); |
| 117 } | 112 } |
| 118 | 113 |
| 119 } // namespace chromeos | 114 } // namespace chromeos |
| OLD | NEW |