| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "chrome/browser/accessibility/accessibility_extension_api.h" | 10 #include "chrome/browser/accessibility/accessibility_extension_api.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 profile->GetExtensionService(); | 110 profile->GetExtensionService(); |
| 111 FilePath path = FilePath(extension_misc::kAccessExtensionPath) | 111 FilePath path = FilePath(extension_misc::kAccessExtensionPath) |
| 112 .AppendASCII(extension_misc::kChromeVoxDirectoryName); | 112 .AppendASCII(extension_misc::kChromeVoxDirectoryName); |
| 113 if (enabled) { // Load ChromeVox | 113 if (enabled) { // Load ChromeVox |
| 114 const Extension* extension = | 114 const Extension* extension = |
| 115 extension_service->component_loader()->Add(IDR_CHROMEVOX_MANIFEST, | 115 extension_service->component_loader()->Add(IDR_CHROMEVOX_MANIFEST, |
| 116 path); | 116 path); |
| 117 | 117 |
| 118 if (login_web_ui) { | 118 if (login_web_ui) { |
| 119 RenderViewHost* render_view_host = | 119 RenderViewHost* render_view_host = |
| 120 login_web_ui->tab_contents()->GetRenderViewHost(); | 120 login_web_ui->web_contents()->GetRenderViewHost(); |
| 121 // Set a flag to tell ChromeVox that it's just been enabled, | 121 // Set a flag to tell ChromeVox that it's just been enabled, |
| 122 // so that it won't interrupt our speech feedback enabled message. | 122 // so that it won't interrupt our speech feedback enabled message. |
| 123 ExtensionMsg_ExecuteCode_Params params; | 123 ExtensionMsg_ExecuteCode_Params params; |
| 124 params.request_id = 0; | 124 params.request_id = 0; |
| 125 params.extension_id = extension->id(); | 125 params.extension_id = extension->id(); |
| 126 params.is_javascript = true; | 126 params.is_javascript = true; |
| 127 params.code = "window.INJECTED_AFTER_LOAD = true;"; | 127 params.code = "window.INJECTED_AFTER_LOAD = true;"; |
| 128 params.all_frames = true; | 128 params.all_frames = true; |
| 129 params.in_main_world = false; | 129 params.in_main_world = false; |
| 130 render_view_host->Send(new ExtensionMsg_ExecuteCode( | 130 render_view_host->Send(new ExtensionMsg_ExecuteCode( |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 return false; | 175 return false; |
| 176 } | 176 } |
| 177 PrefService* prefs = g_browser_process->local_state(); | 177 PrefService* prefs = g_browser_process->local_state(); |
| 178 bool accessibility_enabled = prefs && | 178 bool accessibility_enabled = prefs && |
| 179 prefs->GetBoolean(prefs::kSpokenFeedbackEnabled); | 179 prefs->GetBoolean(prefs::kSpokenFeedbackEnabled); |
| 180 return accessibility_enabled; | 180 return accessibility_enabled; |
| 181 } | 181 } |
| 182 | 182 |
| 183 } // namespace accessibility | 183 } // namespace accessibility |
| 184 } // namespace chromeos | 184 } // namespace chromeos |
| OLD | NEW |