Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Side by Side Diff: extensions/shell/browser/shell_extensions_browser_client.cc

Issue 660333003: Add support for app_shell-only extension APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: (shell-identity) rebase Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/browser/updater/null_extension_cache.h" 20 #include "extensions/browser/updater/null_extension_cache.h"
21 #include "extensions/browser/url_request_util.h" 21 #include "extensions/browser/url_request_util.h"
22 #include "extensions/shell/browser/api/generated_api_registration.h"
22 #include "extensions/shell/browser/shell_extension_host_delegate.h" 23 #include "extensions/shell/browser/shell_extension_host_delegate.h"
23 #include "extensions/shell/browser/shell_extension_system_factory.h" 24 #include "extensions/shell/browser/shell_extension_system_factory.h"
24 #include "extensions/shell/browser/shell_runtime_api_delegate.h" 25 #include "extensions/shell/browser/shell_runtime_api_delegate.h"
25 26
26 using content::BrowserContext; 27 using content::BrowserContext;
27 using content::BrowserThread; 28 using content::BrowserThread;
28 29
29 namespace extensions { 30 namespace extensions {
30 namespace { 31 namespace {
31 32
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 181
181 ExtensionSystemProvider* 182 ExtensionSystemProvider*
182 ShellExtensionsBrowserClient::GetExtensionSystemFactory() { 183 ShellExtensionsBrowserClient::GetExtensionSystemFactory() {
183 return ShellExtensionSystemFactory::GetInstance(); 184 return ShellExtensionSystemFactory::GetInstance();
184 } 185 }
185 186
186 void ShellExtensionsBrowserClient::RegisterExtensionFunctions( 187 void ShellExtensionsBrowserClient::RegisterExtensionFunctions(
187 ExtensionFunctionRegistry* registry) const { 188 ExtensionFunctionRegistry* registry) const {
188 // Register core extension-system APIs. 189 // Register core extension-system APIs.
189 core_api::GeneratedFunctionRegistry::RegisterAll(registry); 190 core_api::GeneratedFunctionRegistry::RegisterAll(registry);
191
192 // app_shell-only APIs.
193 shell_api::GeneratedFunctionRegistry::RegisterAll(registry);
190 } 194 }
191 195
192 scoped_ptr<RuntimeAPIDelegate> 196 scoped_ptr<RuntimeAPIDelegate>
193 ShellExtensionsBrowserClient::CreateRuntimeAPIDelegate( 197 ShellExtensionsBrowserClient::CreateRuntimeAPIDelegate(
194 content::BrowserContext* context) const { 198 content::BrowserContext* context) const {
195 return scoped_ptr<RuntimeAPIDelegate>(new ShellRuntimeAPIDelegate()); 199 return scoped_ptr<RuntimeAPIDelegate>(new ShellRuntimeAPIDelegate());
196 } 200 }
197 201
198 ComponentExtensionResourceManager* 202 ComponentExtensionResourceManager*
199 ShellExtensionsBrowserClient::GetComponentExtensionResourceManager() { 203 ShellExtensionsBrowserClient::GetComponentExtensionResourceManager() {
(...skipping 29 matching lines...) Expand all
229 bool ShellExtensionsBrowserClient::IsBackgroundUpdateAllowed() { 233 bool ShellExtensionsBrowserClient::IsBackgroundUpdateAllowed() {
230 return true; 234 return true;
231 } 235 }
232 236
233 bool ShellExtensionsBrowserClient::IsMinBrowserVersionSupported( 237 bool ShellExtensionsBrowserClient::IsMinBrowserVersionSupported(
234 const std::string& min_version) { 238 const std::string& min_version) {
235 return true; 239 return true;
236 } 240 }
237 241
238 } // namespace extensions 242 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698