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

Side by Side Diff: chrome/browser/extensions/chrome_extensions_browser_client.h

Issue 381283002: Refactor code that defers extension background page loading (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase on top of chrome_browser_extensions.gypi GN changes Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 #ifndef CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSIONS_BROWSER_CLIENT_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSIONS_BROWSER_CLIENT_H_
6 #define CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSIONS_BROWSER_CLIENT_H_ 6 #define CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSIONS_BROWSER_CLIENT_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/lazy_instance.h" 12 #include "base/lazy_instance.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "chrome/browser/extensions/chrome_notification_observer.h" 14 #include "chrome/browser/extensions/chrome_notification_observer.h"
15 #include "extensions/browser/extensions_browser_client.h" 15 #include "extensions/browser/extensions_browser_client.h"
16 16
17 namespace base { 17 namespace base {
18 class CommandLine; 18 class CommandLine;
19 } 19 }
20 20
21 namespace content { 21 namespace content {
22 class BrowserContext; 22 class BrowserContext;
23 } 23 }
24 24
25 namespace extensions { 25 namespace extensions {
26 26
27 class ChromeComponentExtensionResourceManager; 27 class ChromeComponentExtensionResourceManager;
28 class ChromeExtensionsAPIClient; 28 class ChromeExtensionsAPIClient;
29 class ChromeProcessManagerDelegate;
29 class ContentSettingsPrefsObserver; 30 class ContentSettingsPrefsObserver;
30 31
31 // Implementation of extensions::BrowserClient for Chrome, which includes 32 // Implementation of extensions::BrowserClient for Chrome, which includes
32 // knowledge of Profiles, BrowserContexts and incognito. 33 // knowledge of Profiles, BrowserContexts and incognito.
33 // 34 //
34 // NOTE: Methods that do not require knowledge of browser concepts should be 35 // NOTE: Methods that do not require knowledge of browser concepts should be
35 // implemented in ChromeExtensionsClient even if they are only used in the 36 // implemented in ChromeExtensionsClient even if they are only used in the
36 // browser process (see chrome/common/extensions/chrome_extensions_client.h). 37 // browser process (see chrome/common/extensions/chrome_extensions_client.h).
37 class ChromeExtensionsBrowserClient : public ExtensionsBrowserClient { 38 class ChromeExtensionsBrowserClient : public ExtensionsBrowserClient {
38 public: 39 public:
(...skipping 30 matching lines...) Expand all
69 virtual bool AllowCrossRendererResourceLoad(net::URLRequest* request, 70 virtual bool AllowCrossRendererResourceLoad(net::URLRequest* request,
70 bool is_incognito, 71 bool is_incognito,
71 const Extension* extension, 72 const Extension* extension,
72 InfoMap* extension_info_map) 73 InfoMap* extension_info_map)
73 OVERRIDE; 74 OVERRIDE;
74 virtual PrefService* GetPrefServiceForContext( 75 virtual PrefService* GetPrefServiceForContext(
75 content::BrowserContext* context) OVERRIDE; 76 content::BrowserContext* context) OVERRIDE;
76 virtual void GetEarlyExtensionPrefsObservers( 77 virtual void GetEarlyExtensionPrefsObservers(
77 content::BrowserContext* context, 78 content::BrowserContext* context,
78 std::vector<ExtensionPrefsObserver*>* observers) const OVERRIDE; 79 std::vector<ExtensionPrefsObserver*>* observers) const OVERRIDE;
79 virtual bool DeferLoadingBackgroundHosts( 80 virtual ProcessManagerDelegate* GetProcessManagerDelegate() const OVERRIDE;
80 content::BrowserContext* context) const OVERRIDE;
81 virtual bool IsBackgroundPageAllowed(
82 content::BrowserContext* context) const OVERRIDE;
83 virtual scoped_ptr<ExtensionHostDelegate> CreateExtensionHostDelegate() 81 virtual scoped_ptr<ExtensionHostDelegate> CreateExtensionHostDelegate()
84 OVERRIDE; 82 OVERRIDE;
85 virtual bool DidVersionUpdate(content::BrowserContext* context) OVERRIDE; 83 virtual bool DidVersionUpdate(content::BrowserContext* context) OVERRIDE;
86 virtual scoped_ptr<AppSorting> CreateAppSorting() OVERRIDE; 84 virtual scoped_ptr<AppSorting> CreateAppSorting() OVERRIDE;
87 virtual bool IsRunningInForcedAppMode() OVERRIDE; 85 virtual bool IsRunningInForcedAppMode() OVERRIDE;
88 virtual ApiActivityMonitor* GetApiActivityMonitor( 86 virtual ApiActivityMonitor* GetApiActivityMonitor(
89 content::BrowserContext* context) OVERRIDE; 87 content::BrowserContext* context) OVERRIDE;
90 virtual ExtensionSystemProvider* GetExtensionSystemFactory() OVERRIDE; 88 virtual ExtensionSystemProvider* GetExtensionSystemFactory() OVERRIDE;
91 virtual void RegisterExtensionFunctions( 89 virtual void RegisterExtensionFunctions(
92 ExtensionFunctionRegistry* registry) const OVERRIDE; 90 ExtensionFunctionRegistry* registry) const OVERRIDE;
93 virtual scoped_ptr<extensions::RuntimeAPIDelegate> CreateRuntimeAPIDelegate( 91 virtual scoped_ptr<extensions::RuntimeAPIDelegate> CreateRuntimeAPIDelegate(
94 content::BrowserContext* context) const OVERRIDE; 92 content::BrowserContext* context) const OVERRIDE;
95 virtual ComponentExtensionResourceManager* 93 virtual ComponentExtensionResourceManager*
96 GetComponentExtensionResourceManager() OVERRIDE; 94 GetComponentExtensionResourceManager() OVERRIDE;
97 95
98 private: 96 private:
99 friend struct base::DefaultLazyInstanceTraits<ChromeExtensionsBrowserClient>; 97 friend struct base::DefaultLazyInstanceTraits<ChromeExtensionsBrowserClient>;
100 98
101 // Observer for Chrome-specific notifications. 99 // Observer for Chrome-specific notifications.
102 ChromeNotificationObserver notification_observer_; 100 ChromeNotificationObserver notification_observer_;
103 101
104 #if defined(ENABLE_EXTENSIONS) 102 #if defined(ENABLE_EXTENSIONS)
103 // Support for ProcessManager.
104 scoped_ptr<ChromeProcessManagerDelegate> process_manager_delegate_;
105
105 // Client for API implementations. 106 // Client for API implementations.
106 scoped_ptr<ChromeExtensionsAPIClient> api_client_; 107 scoped_ptr<ChromeExtensionsAPIClient> api_client_;
107 #endif 108 #endif
108 109
109 scoped_ptr<ChromeComponentExtensionResourceManager> resource_manager_; 110 scoped_ptr<ChromeComponentExtensionResourceManager> resource_manager_;
110 111
111 DISALLOW_COPY_AND_ASSIGN(ChromeExtensionsBrowserClient); 112 DISALLOW_COPY_AND_ASSIGN(ChromeExtensionsBrowserClient);
112 }; 113 };
113 114
114 } // namespace extensions 115 } // namespace extensions
115 116
116 #endif // CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSIONS_BROWSER_CLIENT_H_ 117 #endif // CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSIONS_BROWSER_CLIENT_H_
OLDNEW
« no previous file with comments | « apps/shell/browser/shell_extensions_browser_client.cc ('k') | chrome/browser/extensions/chrome_extensions_browser_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698