| 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 "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "base/prefs/pref_service_factory.h" | 8 #include "base/prefs/pref_service_factory.h" |
| 9 #include "base/prefs/testing_pref_store.h" | 9 #include "base/prefs/testing_pref_store.h" |
| 10 #include "components/pref_registry/pref_registry_syncable.h" | 10 #include "components/pref_registry/pref_registry_syncable.h" |
| 11 #include "components/user_prefs/user_prefs.h" | 11 #include "components/user_prefs/user_prefs.h" |
| 12 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
| 13 #include "extensions/browser/api/extensions_api_client.h" | 13 #include "extensions/browser/api/extensions_api_client.h" |
| 14 #include "extensions/browser/api/generated_api_registration.h" | 14 #include "extensions/browser/api/generated_api_registration.h" |
| 15 #include "extensions/browser/app_sorting.h" | 15 #include "extensions/browser/app_sorting.h" |
| 16 #include "extensions/browser/event_router.h" | 16 #include "extensions/browser/event_router.h" |
| 17 #include "extensions/browser/extension_function_registry.h" | 17 #include "extensions/browser/extension_function_registry.h" |
| 18 #include "extensions/browser/extension_prefs.h" | 18 #include "extensions/browser/extension_prefs.h" |
| 19 #include "extensions/browser/null_app_sorting.h" | 19 #include "extensions/browser/null_app_sorting.h" |
| 20 #include "extensions/shell/browser/api/generated_api_registration.h" | |
| 21 #include "extensions/shell/browser/shell_extension_host_delegate.h" | 20 #include "extensions/shell/browser/shell_extension_host_delegate.h" |
| 22 #include "extensions/shell/browser/shell_extension_system_factory.h" | 21 #include "extensions/shell/browser/shell_extension_system_factory.h" |
| 23 #include "extensions/shell/browser/shell_runtime_api_delegate.h" | 22 #include "extensions/shell/browser/shell_runtime_api_delegate.h" |
| 24 | 23 |
| 25 using content::BrowserContext; | 24 using content::BrowserContext; |
| 26 using content::BrowserThread; | 25 using content::BrowserThread; |
| 27 | 26 |
| 28 namespace extensions { | 27 namespace extensions { |
| 29 namespace { | 28 namespace { |
| 30 | 29 |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 | 175 |
| 177 ExtensionSystemProvider* | 176 ExtensionSystemProvider* |
| 178 ShellExtensionsBrowserClient::GetExtensionSystemFactory() { | 177 ShellExtensionsBrowserClient::GetExtensionSystemFactory() { |
| 179 return ShellExtensionSystemFactory::GetInstance(); | 178 return ShellExtensionSystemFactory::GetInstance(); |
| 180 } | 179 } |
| 181 | 180 |
| 182 void ShellExtensionsBrowserClient::RegisterExtensionFunctions( | 181 void ShellExtensionsBrowserClient::RegisterExtensionFunctions( |
| 183 ExtensionFunctionRegistry* registry) const { | 182 ExtensionFunctionRegistry* registry) const { |
| 184 // Register core extension-system APIs. | 183 // Register core extension-system APIs. |
| 185 core_api::GeneratedFunctionRegistry::RegisterAll(registry); | 184 core_api::GeneratedFunctionRegistry::RegisterAll(registry); |
| 186 | |
| 187 // Register chrome.shell APIs. | |
| 188 shell_api::GeneratedFunctionRegistry::RegisterAll(registry); | |
| 189 } | 185 } |
| 190 | 186 |
| 191 scoped_ptr<RuntimeAPIDelegate> | 187 scoped_ptr<RuntimeAPIDelegate> |
| 192 ShellExtensionsBrowserClient::CreateRuntimeAPIDelegate( | 188 ShellExtensionsBrowserClient::CreateRuntimeAPIDelegate( |
| 193 content::BrowserContext* context) const { | 189 content::BrowserContext* context) const { |
| 194 return scoped_ptr<RuntimeAPIDelegate>(new ShellRuntimeAPIDelegate()); | 190 return scoped_ptr<RuntimeAPIDelegate>(new ShellRuntimeAPIDelegate()); |
| 195 } | 191 } |
| 196 | 192 |
| 197 ComponentExtensionResourceManager* | 193 ComponentExtensionResourceManager* |
| 198 ShellExtensionsBrowserClient::GetComponentExtensionResourceManager() { | 194 ShellExtensionsBrowserClient::GetComponentExtensionResourceManager() { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 215 | 211 |
| 216 scoped_ptr<Event> event(new Event(event_name, args.Pass())); | 212 scoped_ptr<Event> event(new Event(event_name, args.Pass())); |
| 217 EventRouter::Get(browser_context_)->BroadcastEvent(event.Pass()); | 213 EventRouter::Get(browser_context_)->BroadcastEvent(event.Pass()); |
| 218 } | 214 } |
| 219 | 215 |
| 220 net::NetLog* ShellExtensionsBrowserClient::GetNetLog() { | 216 net::NetLog* ShellExtensionsBrowserClient::GetNetLog() { |
| 221 return NULL; | 217 return NULL; |
| 222 } | 218 } |
| 223 | 219 |
| 224 } // namespace extensions | 220 } // namespace extensions |
| OLD | NEW |