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/chromeos/accessibility/magnification_manager.h" | 18 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
19 #include "chrome/browser/extensions/component_loader.h" | 19 #include "chrome/browser/extensions/component_loader.h" |
20 #include "chrome/browser/extensions/extension_service.h" | 20 #include "chrome/browser/extensions/extension_service.h" |
| 21 #include "chrome/browser/extensions/extension_system.h" |
21 #include "chrome/browser/extensions/file_reader.h" | 22 #include "chrome/browser/extensions/file_reader.h" |
22 #include "chrome/browser/prefs/pref_service.h" | 23 #include "chrome/browser/prefs/pref_service.h" |
23 #include "chrome/browser/profiles/profile.h" | 24 #include "chrome/browser/profiles/profile.h" |
24 #include "chrome/browser/profiles/profile_manager.h" | 25 #include "chrome/browser/profiles/profile_manager.h" |
25 #include "chrome/browser/speech/extension_api/tts_extension_api_controller.h" | 26 #include "chrome/browser/speech/extension_api/tts_extension_api_controller.h" |
26 #include "chrome/browser/ui/singleton_tabs.h" | 27 #include "chrome/browser/ui/singleton_tabs.h" |
27 #include "chrome/common/extensions/extension.h" | 28 #include "chrome/common/extensions/extension.h" |
28 #include "chrome/common/extensions/extension_messages.h" | 29 #include "chrome/common/extensions/extension_messages.h" |
29 #include "chrome/common/extensions/extension_resource.h" | 30 #include "chrome/common/extensions/extension_resource.h" |
30 #include "chrome/common/extensions/user_script.h" | 31 #include "chrome/common/extensions/user_script.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 ExtensionAccessibilityEventRouter::GetInstance()-> | 128 ExtensionAccessibilityEventRouter::GetInstance()-> |
128 SetAccessibilityEnabled(enabled); | 129 SetAccessibilityEnabled(enabled); |
129 | 130 |
130 Speak(l10n_util::GetStringUTF8( | 131 Speak(l10n_util::GetStringUTF8( |
131 enabled ? IDS_CHROMEOS_ACC_SPOKEN_FEEDBACK_ENABLED : | 132 enabled ? IDS_CHROMEOS_ACC_SPOKEN_FEEDBACK_ENABLED : |
132 IDS_CHROMEOS_ACC_SPOKEN_FEEDBACK_DISABLED).c_str()); | 133 IDS_CHROMEOS_ACC_SPOKEN_FEEDBACK_DISABLED).c_str()); |
133 | 134 |
134 // Load/Unload ChromeVox | 135 // Load/Unload ChromeVox |
135 Profile* profile = ProfileManager::GetDefaultProfile(); | 136 Profile* profile = ProfileManager::GetDefaultProfile(); |
136 ExtensionService* extension_service = | 137 ExtensionService* extension_service = |
137 profile->GetExtensionService(); | 138 extensions::ExtensionSystem::Get(profile)->extension_service(); |
138 FilePath path = FilePath(extension_misc::kChromeVoxExtensionPath); | 139 FilePath path = FilePath(extension_misc::kChromeVoxExtensionPath); |
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) { |
147 RenderViewHost* render_view_host = | 148 RenderViewHost* render_view_host = |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 if (IsSpokenFeedbackEnabled()) | 279 if (IsSpokenFeedbackEnabled()) |
279 Speak(utterance); | 280 Speak(utterance); |
280 } | 281 } |
281 | 282 |
282 void ShowAccessibilityHelp(Browser* browser) { | 283 void ShowAccessibilityHelp(Browser* browser) { |
283 chrome::ShowSingletonTab(browser, GURL(chrome::kChromeAccessibilityHelpURL)); | 284 chrome::ShowSingletonTab(browser, GURL(chrome::kChromeAccessibilityHelpURL)); |
284 } | 285 } |
285 | 286 |
286 } // namespace accessibility | 287 } // namespace accessibility |
287 } // namespace chromeos | 288 } // namespace chromeos |
OLD | NEW |