| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 private: | 130 private: |
| 131 void OnFileLoaded(bool success, const std::string& data) { | 131 void OnFileLoaded(bool success, const std::string& data) { |
| 132 if (success) { | 132 if (success) { |
| 133 ExtensionMsg_ExecuteCode_Params params; | 133 ExtensionMsg_ExecuteCode_Params params; |
| 134 params.request_id = 0; | 134 params.request_id = 0; |
| 135 params.extension_id = extension_id_; | 135 params.extension_id = extension_id_; |
| 136 params.is_javascript = true; | 136 params.is_javascript = true; |
| 137 params.code = data; | 137 params.code = data; |
| 138 params.run_at = extensions::UserScript::DOCUMENT_IDLE; | 138 params.run_at = extensions::UserScript::DOCUMENT_IDLE; |
| 139 params.all_frames = true; | 139 params.all_frames = true; |
| 140 params.match_about_blank = false; |
| 140 params.in_main_world = false; | 141 params.in_main_world = false; |
| 141 | 142 |
| 142 RenderViewHost* render_view_host = | 143 RenderViewHost* render_view_host = |
| 143 RenderViewHost::FromID(render_process_id_, render_view_id_); | 144 RenderViewHost::FromID(render_process_id_, render_view_id_); |
| 144 if (render_view_host) { | 145 if (render_view_host) { |
| 145 render_view_host->Send(new ExtensionMsg_ExecuteCode( | 146 render_view_host->Send(new ExtensionMsg_ExecuteCode( |
| 146 render_view_host->GetRoutingID(), params)); | 147 render_view_host->GetRoutingID(), params)); |
| 147 } | 148 } |
| 148 } | 149 } |
| 149 Run(); | 150 Run(); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 169 | 170 |
| 170 // Set a flag to tell ChromeVox that it's just been enabled, | 171 // Set a flag to tell ChromeVox that it's just been enabled, |
| 171 // so that it won't interrupt our speech feedback enabled message. | 172 // so that it won't interrupt our speech feedback enabled message. |
| 172 ExtensionMsg_ExecuteCode_Params params; | 173 ExtensionMsg_ExecuteCode_Params params; |
| 173 params.request_id = 0; | 174 params.request_id = 0; |
| 174 params.extension_id = extension->id(); | 175 params.extension_id = extension->id(); |
| 175 params.is_javascript = true; | 176 params.is_javascript = true; |
| 176 params.code = "window.INJECTED_AFTER_LOAD = true;"; | 177 params.code = "window.INJECTED_AFTER_LOAD = true;"; |
| 177 params.run_at = extensions::UserScript::DOCUMENT_IDLE; | 178 params.run_at = extensions::UserScript::DOCUMENT_IDLE; |
| 178 params.all_frames = true; | 179 params.all_frames = true; |
| 180 params.match_about_blank = false; |
| 179 params.in_main_world = false; | 181 params.in_main_world = false; |
| 180 render_view_host->Send(new ExtensionMsg_ExecuteCode( | 182 render_view_host->Send(new ExtensionMsg_ExecuteCode( |
| 181 render_view_host->GetRoutingID(), params)); | 183 render_view_host->GetRoutingID(), params)); |
| 182 | 184 |
| 183 // Inject ChromeVox' content scripts. | 185 // Inject ChromeVox' content scripts. |
| 184 ContentScriptLoader* loader = new ContentScriptLoader( | 186 ContentScriptLoader* loader = new ContentScriptLoader( |
| 185 extension->id(), render_view_host->GetProcess()->GetID(), | 187 extension->id(), render_view_host->GetProcess()->GetID(), |
| 186 render_view_host->GetRoutingID()); | 188 render_view_host->GetRoutingID()); |
| 187 | 189 |
| 188 const extensions::UserScriptList& content_scripts = | 190 const extensions::UserScriptList& content_scripts = |
| (...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1066 chrome_vox_loaded_on_lock_screen_; | 1068 chrome_vox_loaded_on_lock_screen_; |
| 1067 } | 1069 } |
| 1068 | 1070 |
| 1069 void AccessibilityManager::PostUnloadChromeVox(Profile* profile) { | 1071 void AccessibilityManager::PostUnloadChromeVox(Profile* profile) { |
| 1070 // Do any teardown work needed immediately after ChromeVox actually unloads. | 1072 // Do any teardown work needed immediately after ChromeVox actually unloads. |
| 1071 if (system_sounds_enabled_) | 1073 if (system_sounds_enabled_) |
| 1072 ash::PlaySystemSoundAlways(SOUND_SPOKEN_FEEDBACK_DISABLED); | 1074 ash::PlaySystemSoundAlways(SOUND_SPOKEN_FEEDBACK_DISABLED); |
| 1073 } | 1075 } |
| 1074 | 1076 |
| 1075 } // namespace chromeos | 1077 } // namespace chromeos |
| OLD | NEW |