| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 extensions::ExtensionSystem::Get(profile)->extension_service(); | 220 extensions::ExtensionSystem::Get(profile)->extension_service(); |
| 221 if (render_view_host) { | 221 if (render_view_host) { |
| 222 // Wrap the passed in callback to inject the content script. | 222 // Wrap the passed in callback to inject the content script. |
| 223 done_cb = base::Bind( | 223 done_cb = base::Bind( |
| 224 &InjectChromeVoxContentScript, | 224 &InjectChromeVoxContentScript, |
| 225 extension_service, | 225 extension_service, |
| 226 render_view_host->GetProcess()->GetID(), | 226 render_view_host->GetProcess()->GetID(), |
| 227 render_view_host->GetRoutingID(), | 227 render_view_host->GetRoutingID(), |
| 228 done_cb); | 228 done_cb); |
| 229 } | 229 } |
| 230 | 230 extension_service->component_loader()->AddChromeVoxExtension(done_cb); |
| 231 extension_service->component_loader()->AddComponentFromDir( | |
| 232 GetChromeVoxPath(), extension_misc::kChromeVoxExtensionId, done_cb); | |
| 233 } | 231 } |
| 234 | 232 |
| 235 void InjectChromeVoxContentScript( | 233 void InjectChromeVoxContentScript( |
| 236 ExtensionService* extension_service, | 234 ExtensionService* extension_service, |
| 237 int render_process_id, | 235 int render_process_id, |
| 238 int render_view_id, | 236 int render_view_id, |
| 239 const base::Closure& done_cb) { | 237 const base::Closure& done_cb) { |
| 240 // Make sure to always run |done_cb|. ChromeVox was loaded even if we end up | 238 // Make sure to always run |done_cb|. ChromeVox was loaded even if we end up |
| 241 // not injecting into this particular render view. | 239 // not injecting into this particular render view. |
| 242 base::ScopedClosureRunner done_runner(done_cb); | 240 base::ScopedClosureRunner done_runner(done_cb); |
| (...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1543 content::BrowserContext* context) { | 1541 content::BrowserContext* context) { |
| 1544 keyboard_listener_extension_id_ = id; | 1542 keyboard_listener_extension_id_ = id; |
| 1545 | 1543 |
| 1546 extensions::ExtensionRegistry* registry = | 1544 extensions::ExtensionRegistry* registry = |
| 1547 extensions::ExtensionRegistry::Get(context); | 1545 extensions::ExtensionRegistry::Get(context); |
| 1548 if (!extension_registry_observer_.IsObserving(registry) && !id.empty()) | 1546 if (!extension_registry_observer_.IsObserving(registry) && !id.empty()) |
| 1549 extension_registry_observer_.Add(registry); | 1547 extension_registry_observer_.Add(registry); |
| 1550 } | 1548 } |
| 1551 | 1549 |
| 1552 } // namespace chromeos | 1550 } // namespace chromeos |
| OLD | NEW |