| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/shell/browser/shell_extensions_browser_client.h" | 5 #include "extensions/shell/browser/shell_extensions_browser_client.h" |
| 6 | 6 |
| 7 #include "content/public/browser/browser_context.h" | 7 #include "content/public/browser/browser_context.h" |
| 8 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
| 9 #include "content/public/browser/render_frame_host.h" |
| 9 #include "extensions/browser/api/extensions_api_client.h" | 10 #include "extensions/browser/api/extensions_api_client.h" |
| 10 #include "extensions/browser/api/generated_api_registration.h" | 11 #include "extensions/browser/api/generated_api_registration.h" |
| 11 #include "extensions/browser/app_sorting.h" | 12 #include "extensions/browser/app_sorting.h" |
| 12 #include "extensions/browser/event_router.h" | 13 #include "extensions/browser/event_router.h" |
| 13 #include "extensions/browser/extension_function_registry.h" | 14 #include "extensions/browser/extension_function_registry.h" |
| 15 #include "extensions/browser/mojo/service_registration.h" |
| 14 #include "extensions/browser/null_app_sorting.h" | 16 #include "extensions/browser/null_app_sorting.h" |
| 15 #include "extensions/browser/updater/null_extension_cache.h" | 17 #include "extensions/browser/updater/null_extension_cache.h" |
| 16 #include "extensions/browser/url_request_util.h" | 18 #include "extensions/browser/url_request_util.h" |
| 17 #include "extensions/shell/browser/api/generated_api_registration.h" | 19 #include "extensions/shell/browser/api/generated_api_registration.h" |
| 18 #include "extensions/shell/browser/shell_extension_host_delegate.h" | 20 #include "extensions/shell/browser/shell_extension_host_delegate.h" |
| 19 #include "extensions/shell/browser/shell_extension_system_factory.h" | 21 #include "extensions/shell/browser/shell_extension_system_factory.h" |
| 20 #include "extensions/shell/browser/shell_extensions_api_client.h" | 22 #include "extensions/shell/browser/shell_extensions_api_client.h" |
| 21 #include "extensions/shell/browser/shell_runtime_api_delegate.h" | 23 #include "extensions/shell/browser/shell_runtime_api_delegate.h" |
| 22 | 24 |
| 23 #if defined(OS_CHROMEOS) | 25 #if defined(OS_CHROMEOS) |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 | 176 |
| 175 void ShellExtensionsBrowserClient::RegisterExtensionFunctions( | 177 void ShellExtensionsBrowserClient::RegisterExtensionFunctions( |
| 176 ExtensionFunctionRegistry* registry) const { | 178 ExtensionFunctionRegistry* registry) const { |
| 177 // Register core extension-system APIs. | 179 // Register core extension-system APIs. |
| 178 core_api::GeneratedFunctionRegistry::RegisterAll(registry); | 180 core_api::GeneratedFunctionRegistry::RegisterAll(registry); |
| 179 | 181 |
| 180 // app_shell-only APIs. | 182 // app_shell-only APIs. |
| 181 shell::api::GeneratedFunctionRegistry::RegisterAll(registry); | 183 shell::api::GeneratedFunctionRegistry::RegisterAll(registry); |
| 182 } | 184 } |
| 183 | 185 |
| 186 void ShellExtensionsBrowserClient::RegisterMojoServices( |
| 187 content::RenderFrameHost* render_frame_host, |
| 188 const Extension* extension) const { |
| 189 RegisterServicesForFrame(render_frame_host, extension); |
| 190 } |
| 191 |
| 184 scoped_ptr<RuntimeAPIDelegate> | 192 scoped_ptr<RuntimeAPIDelegate> |
| 185 ShellExtensionsBrowserClient::CreateRuntimeAPIDelegate( | 193 ShellExtensionsBrowserClient::CreateRuntimeAPIDelegate( |
| 186 content::BrowserContext* context) const { | 194 content::BrowserContext* context) const { |
| 187 return scoped_ptr<RuntimeAPIDelegate>(new ShellRuntimeAPIDelegate()); | 195 return scoped_ptr<RuntimeAPIDelegate>(new ShellRuntimeAPIDelegate()); |
| 188 } | 196 } |
| 189 | 197 |
| 190 const ComponentExtensionResourceManager* | 198 const ComponentExtensionResourceManager* |
| 191 ShellExtensionsBrowserClient::GetComponentExtensionResourceManager() { | 199 ShellExtensionsBrowserClient::GetComponentExtensionResourceManager() { |
| 192 return NULL; | 200 return NULL; |
| 193 } | 201 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 const std::string& min_version) { | 234 const std::string& min_version) { |
| 227 return true; | 235 return true; |
| 228 } | 236 } |
| 229 | 237 |
| 230 void ShellExtensionsBrowserClient::SetAPIClientForTest( | 238 void ShellExtensionsBrowserClient::SetAPIClientForTest( |
| 231 ExtensionsAPIClient* api_client) { | 239 ExtensionsAPIClient* api_client) { |
| 232 api_client_.reset(api_client); | 240 api_client_.reset(api_client); |
| 233 } | 241 } |
| 234 | 242 |
| 235 } // namespace extensions | 243 } // namespace extensions |
| OLD | NEW |