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-inl.h" | 8 #include "base/stl_util-inl.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/extensions/extension_accessibility_api.h" | 10 #include "chrome/browser/extensions/extension_accessibility_api.h" |
| 11 #include "chrome/browser/extensions/extension_service.h" |
11 #include "chrome/browser/prefs/pref_service.h" | 12 #include "chrome/browser/prefs/pref_service.h" |
12 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/browser/profiles/profile_manager.h" | 14 #include "chrome/browser/profiles/profile_manager.h" |
14 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
15 #include "content/common/notification_registrar.h" | 16 #include "content/common/notification_registrar.h" |
16 #include "content/common/notification_service.h" | 17 #include "content/common/notification_service.h" |
17 #include "grit/generated_resources.h" | 18 #include "grit/generated_resources.h" |
18 #include "ui/base/l10n/l10n_util.h" | 19 #include "ui/base/l10n/l10n_util.h" |
19 #include "views/accelerator.h" | 20 #include "views/accelerator.h" |
20 #include "views/view.h" | 21 #include "views/view.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 } | 108 } |
108 } | 109 } |
109 | 110 |
110 void WizardAccessibilityHelper::SetAccessibilityEnabled(bool enabled) { | 111 void WizardAccessibilityHelper::SetAccessibilityEnabled(bool enabled) { |
111 bool doSpeak = (IsAccessibilityEnabled() != enabled); | 112 bool doSpeak = (IsAccessibilityEnabled() != enabled); |
112 if (g_browser_process) { | 113 if (g_browser_process) { |
113 PrefService* prefService = g_browser_process->local_state(); | 114 PrefService* prefService = g_browser_process->local_state(); |
114 prefService->SetBoolean(prefs::kAccessibilityEnabled, enabled); | 115 prefService->SetBoolean(prefs::kAccessibilityEnabled, enabled); |
115 prefService->ScheduleSavePersistentPrefs(); | 116 prefService->ScheduleSavePersistentPrefs(); |
116 } | 117 } |
117 ExtensionAccessibilityEventRouter::GetInstance()-> | 118 profile_->GetExtensionService()->accessibility_event_router()-> |
118 SetAccessibilityEnabled(enabled); | 119 SetAccessibilityEnabled(enabled); |
119 if (doSpeak) { | 120 if (doSpeak) { |
120 accessibility_handler_->Speak(enabled ? | 121 accessibility_handler_->Speak(enabled ? |
121 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_ACCESS_ENABLED).c_str() : | 122 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_ACCESS_ENABLED).c_str() : |
122 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_ACCESS_DISABLED).c_str(), | 123 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_ACCESS_DISABLED).c_str(), |
123 false, true); | 124 false, true); |
124 } | 125 } |
125 } | 126 } |
126 | 127 |
127 } // namespace chromeos | 128 } // namespace chromeos |
OLD | NEW |