OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/accessibility/accessibility_util.h" | 5 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" |
6 | 6 |
7 #include <queue> | 7 #include <queue> |
8 | 8 |
9 #include "ash/high_contrast/high_contrast_controller.h" | 9 #include "ash/high_contrast/high_contrast_controller.h" |
10 #include "ash/magnifier/magnification_controller.h" | 10 #include "ash/magnifier/magnification_controller.h" |
11 #include "ash/magnifier/partial_magnification_controller.h" | 11 #include "ash/magnifier/partial_magnification_controller.h" |
12 #include "ash/shell.h" | 12 #include "ash/shell.h" |
13 #include "base/bind.h" | 13 #include "base/bind.h" |
14 #include "base/bind_helpers.h" | 14 #include "base/bind_helpers.h" |
15 #include "base/logging.h" | 15 #include "base/logging.h" |
16 #include "chrome/browser/accessibility/accessibility_extension_api.h" | 16 #include "chrome/browser/accessibility/accessibility_extension_api.h" |
17 #include "chrome/browser/browser_process.h" | 17 #include "chrome/browser/browser_process.h" |
18 #include "chrome/browser/extensions/component_loader.h" | 18 #include "chrome/browser/extensions/component_loader.h" |
19 #include "chrome/browser/extensions/extension_service.h" | 19 #include "chrome/browser/extensions/extension_service.h" |
| 20 #include "chrome/browser/extensions/extension_system.h" |
20 #include "chrome/browser/extensions/file_reader.h" | 21 #include "chrome/browser/extensions/file_reader.h" |
21 #include "chrome/browser/prefs/pref_service.h" | 22 #include "chrome/browser/prefs/pref_service.h" |
22 #include "chrome/browser/profiles/profile.h" | 23 #include "chrome/browser/profiles/profile.h" |
23 #include "chrome/browser/profiles/profile_manager.h" | 24 #include "chrome/browser/profiles/profile_manager.h" |
24 #include "chrome/browser/speech/extension_api/tts_extension_api_controller.h" | 25 #include "chrome/browser/speech/extension_api/tts_extension_api_controller.h" |
25 #include "chrome/common/extensions/extension.h" | 26 #include "chrome/common/extensions/extension.h" |
26 #include "chrome/common/extensions/extension_messages.h" | 27 #include "chrome/common/extensions/extension_messages.h" |
27 #include "chrome/common/extensions/extension_resource.h" | 28 #include "chrome/common/extensions/extension_resource.h" |
28 #include "chrome/common/extensions/user_script.h" | 29 #include "chrome/common/extensions/user_script.h" |
29 #include "chrome/common/pref_names.h" | 30 #include "chrome/common/pref_names.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 ExtensionAccessibilityEventRouter::GetInstance()-> | 127 ExtensionAccessibilityEventRouter::GetInstance()-> |
127 SetAccessibilityEnabled(enabled); | 128 SetAccessibilityEnabled(enabled); |
128 | 129 |
129 Speak(l10n_util::GetStringUTF8( | 130 Speak(l10n_util::GetStringUTF8( |
130 enabled ? IDS_CHROMEOS_ACC_SPOKEN_FEEDBACK_ENABLED : | 131 enabled ? IDS_CHROMEOS_ACC_SPOKEN_FEEDBACK_ENABLED : |
131 IDS_CHROMEOS_ACC_SPOKEN_FEEDBACK_DISABLED).c_str()); | 132 IDS_CHROMEOS_ACC_SPOKEN_FEEDBACK_DISABLED).c_str()); |
132 | 133 |
133 // Load/Unload ChromeVox | 134 // Load/Unload ChromeVox |
134 Profile* profile = ProfileManager::GetDefaultProfile(); | 135 Profile* profile = ProfileManager::GetDefaultProfile(); |
135 ExtensionService* extension_service = | 136 ExtensionService* extension_service = |
136 profile->GetExtensionService(); | 137 extensions::ExtensionSystem::Get(profile)->extension_service(); |
137 FilePath path = FilePath(extension_misc::kAccessExtensionPath) | 138 FilePath path = FilePath(extension_misc::kAccessExtensionPath) |
138 .AppendASCII(extension_misc::kChromeVoxDirectoryName); | 139 .AppendASCII(extension_misc::kChromeVoxDirectoryName); |
139 if (enabled) { // Load ChromeVox | 140 if (enabled) { // Load ChromeVox |
140 std::string extension_id = | 141 std::string extension_id = |
141 extension_service->component_loader()->Add(IDR_CHROMEVOX_MANIFEST, | 142 extension_service->component_loader()->Add(IDR_CHROMEVOX_MANIFEST, |
142 path); | 143 path); |
143 const extensions::Extension* extension = | 144 const extensions::Extension* extension = |
144 extension_service->extensions()->GetByID(extension_id); | 145 extension_service->extensions()->GetByID(extension_id); |
145 | 146 |
146 if (login_web_ui) { | 147 if (login_web_ui) { |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 return kScreenMagnifierOff; | 291 return kScreenMagnifierOff; |
291 } | 292 } |
292 | 293 |
293 void MaybeSpeak(const std::string& utterance) { | 294 void MaybeSpeak(const std::string& utterance) { |
294 if (IsSpokenFeedbackEnabled()) | 295 if (IsSpokenFeedbackEnabled()) |
295 Speak(utterance); | 296 Speak(utterance); |
296 } | 297 } |
297 | 298 |
298 } // namespace accessibility | 299 } // namespace accessibility |
299 } // namespace chromeos | 300 } // namespace chromeos |
OLD | NEW |