| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_manager.h" | 5 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| 6 | 6 |
| 7 #include "ash/audio/sounds.h" | 7 #include "ash/audio/sounds.h" |
| 8 #include "ash/autoclick/autoclick_controller.h" | 8 #include "ash/autoclick/autoclick_controller.h" |
| 9 #include "ash/high_contrast/high_contrast_controller.h" | 9 #include "ash/high_contrast/high_contrast_controller.h" |
| 10 #include "ash/metrics/user_metrics_recorder.h" | 10 #include "ash/metrics/user_metrics_recorder.h" |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 int render_process_id_; | 150 int render_process_id_; |
| 151 int render_view_id_; | 151 int render_view_id_; |
| 152 std::queue<extensions::ExtensionResource> resources_; | 152 std::queue<extensions::ExtensionResource> resources_; |
| 153 }; | 153 }; |
| 154 | 154 |
| 155 void LoadChromeVoxExtension(Profile* profile, | 155 void LoadChromeVoxExtension(Profile* profile, |
| 156 RenderViewHost* render_view_host) { | 156 RenderViewHost* render_view_host) { |
| 157 ExtensionService* extension_service = | 157 ExtensionService* extension_service = |
| 158 extensions::ExtensionSystem::Get(profile)->extension_service(); | 158 extensions::ExtensionSystem::Get(profile)->extension_service(); |
| 159 base::FilePath path = GetChromeVoxPath(); | 159 base::FilePath path = GetChromeVoxPath(); |
| 160 int idr = profile->IsGuestSession() ? |
| 161 IDR_CHROMEVOX_GUEST_MANIFEST : IDR_CHROMEVOX_MANIFEST; |
| 160 std::string extension_id = | 162 std::string extension_id = |
| 161 extension_service->component_loader()->Add(IDR_CHROMEVOX_MANIFEST, | 163 extension_service->component_loader()->Add(idr, path); |
| 162 path); | |
| 163 if (render_view_host) { | 164 if (render_view_host) { |
| 164 ExtensionService* extension_service = | 165 ExtensionService* extension_service = |
| 165 extensions::ExtensionSystem::Get(profile)->extension_service(); | 166 extensions::ExtensionSystem::Get(profile)->extension_service(); |
| 166 const extensions::Extension* extension = | 167 const extensions::Extension* extension = |
| 167 extension_service->extensions()->GetByID(extension_id); | 168 extension_service->extensions()->GetByID(extension_id); |
| 168 | 169 |
| 169 // Set a flag to tell ChromeVox that it's just been enabled, | 170 // Set a flag to tell ChromeVox that it's just been enabled, |
| 170 // so that it won't interrupt our speech feedback enabled message. | 171 // so that it won't interrupt our speech feedback enabled message. |
| 171 ExtensionMsg_ExecuteCode_Params params; | 172 ExtensionMsg_ExecuteCode_Params params; |
| 172 params.request_id = 0; | 173 params.request_id = 0; |
| (...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 951 | 952 |
| 952 void AccessibilityManager::PostUnloadChromeVox(Profile* profile) { | 953 void AccessibilityManager::PostUnloadChromeVox(Profile* profile) { |
| 953 // Do any teardown work needed immediately after ChromeVox actually unloads. | 954 // Do any teardown work needed immediately after ChromeVox actually unloads. |
| 954 if (system_sounds_enabled_) { | 955 if (system_sounds_enabled_) { |
| 955 ash::PlaySystemSound(SOUND_SPOKEN_FEEDBACK_DISABLED, | 956 ash::PlaySystemSound(SOUND_SPOKEN_FEEDBACK_DISABLED, |
| 956 false /* honor_spoken_feedback */); | 957 false /* honor_spoken_feedback */); |
| 957 } | 958 } |
| 958 } | 959 } |
| 959 | 960 |
| 960 } // namespace chromeos | 961 } // namespace chromeos |
| OLD | NEW |