| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 #include "content/public/browser/render_process_host.h" | 55 #include "content/public/browser/render_process_host.h" |
| 56 #include "content/public/browser/render_view_host.h" | 56 #include "content/public/browser/render_view_host.h" |
| 57 #include "content/public/browser/web_contents.h" | 57 #include "content/public/browser/web_contents.h" |
| 58 #include "content/public/browser/web_ui.h" | 58 #include "content/public/browser/web_ui.h" |
| 59 #include "extensions/browser/extension_registry.h" | 59 #include "extensions/browser/extension_registry.h" |
| 60 #include "extensions/browser/extension_system.h" | 60 #include "extensions/browser/extension_system.h" |
| 61 #include "extensions/browser/file_reader.h" | 61 #include "extensions/browser/file_reader.h" |
| 62 #include "extensions/common/extension.h" | 62 #include "extensions/common/extension.h" |
| 63 #include "extensions/common/extension_messages.h" | 63 #include "extensions/common/extension_messages.h" |
| 64 #include "extensions/common/extension_resource.h" | 64 #include "extensions/common/extension_resource.h" |
| 65 #include "extensions/common/host_id.h" |
| 65 #include "media/audio/sounds/sounds_manager.h" | 66 #include "media/audio/sounds/sounds_manager.h" |
| 66 #include "ui/base/ime/chromeos/input_method_manager.h" | 67 #include "ui/base/ime/chromeos/input_method_manager.h" |
| 67 #include "ui/base/resource/resource_bundle.h" | 68 #include "ui/base/resource/resource_bundle.h" |
| 68 #include "ui/keyboard/keyboard_controller.h" | 69 #include "ui/keyboard/keyboard_controller.h" |
| 69 #include "ui/keyboard/keyboard_util.h" | 70 #include "ui/keyboard/keyboard_util.h" |
| 70 | 71 |
| 71 using content::BrowserThread; | 72 using content::BrowserThread; |
| 72 using content::RenderViewHost; | 73 using content::RenderViewHost; |
| 73 using extensions::api::braille_display_private::BrailleController; | 74 using extensions::api::braille_display_private::BrailleController; |
| 74 using extensions::api::braille_display_private::DisplayState; | 75 using extensions::api::braille_display_private::DisplayState; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 scoped_refptr<FileReader> reader(new FileReader(resource, base::Bind( | 129 scoped_refptr<FileReader> reader(new FileReader(resource, base::Bind( |
| 129 &ContentScriptLoader::OnFileLoaded, base::Unretained(this)))); | 130 &ContentScriptLoader::OnFileLoaded, base::Unretained(this)))); |
| 130 reader->Start(); | 131 reader->Start(); |
| 131 } | 132 } |
| 132 | 133 |
| 133 private: | 134 private: |
| 134 void OnFileLoaded(bool success, const std::string& data) { | 135 void OnFileLoaded(bool success, const std::string& data) { |
| 135 if (success) { | 136 if (success) { |
| 136 ExtensionMsg_ExecuteCode_Params params; | 137 ExtensionMsg_ExecuteCode_Params params; |
| 137 params.request_id = 0; | 138 params.request_id = 0; |
| 138 params.extension_id = extension_id_; | 139 params.host_type = HostID::EXTENSIONS, |
| 140 params.host_id = extension_id_; |
| 139 params.is_javascript = true; | 141 params.is_javascript = true; |
| 140 params.code = data; | 142 params.code = data; |
| 141 params.run_at = extensions::UserScript::DOCUMENT_IDLE; | 143 params.run_at = extensions::UserScript::DOCUMENT_IDLE; |
| 142 params.all_frames = true; | 144 params.all_frames = true; |
| 143 params.match_about_blank = false; | 145 params.match_about_blank = false; |
| 144 params.in_main_world = false; | 146 params.in_main_world = false; |
| 145 | 147 |
| 146 RenderViewHost* render_view_host = | 148 RenderViewHost* render_view_host = |
| 147 RenderViewHost::FromID(render_process_id_, render_view_id_); | 149 RenderViewHost::FromID(render_process_id_, render_view_id_); |
| 148 if (render_view_host) { | 150 if (render_view_host) { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 return; | 199 return; |
| 198 const extensions::Extension* extension = | 200 const extensions::Extension* extension = |
| 199 extensions::ExtensionRegistry::Get(extension_service->profile()) | 201 extensions::ExtensionRegistry::Get(extension_service->profile()) |
| 200 ->enabled_extensions() | 202 ->enabled_extensions() |
| 201 .GetByID(extension_misc::kChromeVoxExtensionId); | 203 .GetByID(extension_misc::kChromeVoxExtensionId); |
| 202 | 204 |
| 203 // Set a flag to tell ChromeVox that it's just been enabled, | 205 // Set a flag to tell ChromeVox that it's just been enabled, |
| 204 // so that it won't interrupt our speech feedback enabled message. | 206 // so that it won't interrupt our speech feedback enabled message. |
| 205 ExtensionMsg_ExecuteCode_Params params; | 207 ExtensionMsg_ExecuteCode_Params params; |
| 206 params.request_id = 0; | 208 params.request_id = 0; |
| 207 params.extension_id = extension->id(); | 209 params.host_type = HostID::EXTENSIONS; |
| 210 params.host_id = extension->id(); |
| 208 params.is_javascript = true; | 211 params.is_javascript = true; |
| 209 params.code = "window.INJECTED_AFTER_LOAD = true;"; | 212 params.code = "window.INJECTED_AFTER_LOAD = true;"; |
| 210 params.run_at = extensions::UserScript::DOCUMENT_IDLE; | 213 params.run_at = extensions::UserScript::DOCUMENT_IDLE; |
| 211 params.all_frames = true; | 214 params.all_frames = true; |
| 212 params.match_about_blank = false; | 215 params.match_about_blank = false; |
| 213 params.in_main_world = false; | 216 params.in_main_world = false; |
| 214 render_view_host->Send(new ExtensionMsg_ExecuteCode( | 217 render_view_host->Send(new ExtensionMsg_ExecuteCode( |
| 215 render_view_host->GetRoutingID(), params)); | 218 render_view_host->GetRoutingID(), params)); |
| 216 | 219 |
| 217 // Inject ChromeVox' content scripts. | 220 // Inject ChromeVox' content scripts. |
| (...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1110 void AccessibilityManager::PostUnloadChromeVox(Profile* profile) { | 1113 void AccessibilityManager::PostUnloadChromeVox(Profile* profile) { |
| 1111 // Do any teardown work needed immediately after ChromeVox actually unloads. | 1114 // Do any teardown work needed immediately after ChromeVox actually unloads. |
| 1112 if (system_sounds_enabled_) | 1115 if (system_sounds_enabled_) |
| 1113 ash::PlaySystemSoundAlways(SOUND_SPOKEN_FEEDBACK_DISABLED); | 1116 ash::PlaySystemSoundAlways(SOUND_SPOKEN_FEEDBACK_DISABLED); |
| 1114 // Clear the accessibility focus ring. | 1117 // Clear the accessibility focus ring. |
| 1115 AccessibilityFocusRingController::GetInstance()->SetFocusRing( | 1118 AccessibilityFocusRingController::GetInstance()->SetFocusRing( |
| 1116 std::vector<gfx::Rect>()); | 1119 std::vector<gfx::Rect>()); |
| 1117 } | 1120 } |
| 1118 | 1121 |
| 1119 } // namespace chromeos | 1122 } // namespace chromeos |
| OLD | NEW |