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

Side by Side Diff: extensions/browser/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
« no previous file with comments | « extensions/DEPS ('k') | extensions/browser/process_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 EXTENSIONS_BROWSER_EXTENSIONS_BROWSER_CLIENT_H_ 5 #ifndef EXTENSIONS_BROWSER_EXTENSIONS_BROWSER_CLIENT_H_
6 #define EXTENSIONS_BROWSER_EXTENSIONS_BROWSER_CLIENT_H_ 6 #define EXTENSIONS_BROWSER_EXTENSIONS_BROWSER_CLIENT_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 23 matching lines...) Expand all
34 34
35 class ApiActivityMonitor; 35 class ApiActivityMonitor;
36 class AppSorting; 36 class AppSorting;
37 class ComponentExtensionResourceManager; 37 class ComponentExtensionResourceManager;
38 class Extension; 38 class Extension;
39 class ExtensionHostDelegate; 39 class ExtensionHostDelegate;
40 class ExtensionPrefsObserver; 40 class ExtensionPrefsObserver;
41 class ExtensionSystem; 41 class ExtensionSystem;
42 class ExtensionSystemProvider; 42 class ExtensionSystemProvider;
43 class InfoMap; 43 class InfoMap;
44 class ProcessManagerDelegate;
44 class RuntimeAPIDelegate; 45 class RuntimeAPIDelegate;
45 46
46 // Interface to allow the extensions module to make browser-process-specific 47 // Interface to allow the extensions module to make browser-process-specific
47 // queries of the embedder. Should be Set() once in the browser process. 48 // queries of the embedder. Should be Set() once in the browser process.
48 // 49 //
49 // NOTE: Methods that do not require knowledge of browser concepts should be 50 // NOTE: Methods that do not require knowledge of browser concepts should be
50 // added in ExtensionsClient (extensions/common/extensions_client.h) even if 51 // added in ExtensionsClient (extensions/common/extensions_client.h) even if
51 // they are only used in the browser process. 52 // they are only used in the browser process.
52 class ExtensionsBrowserClient { 53 class ExtensionsBrowserClient {
53 public: 54 public:
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 virtual PrefService* GetPrefServiceForContext( 127 virtual PrefService* GetPrefServiceForContext(
127 content::BrowserContext* context) = 0; 128 content::BrowserContext* context) = 0;
128 129
129 // Populates a list of ExtensionPrefs observers to be attached to each 130 // Populates a list of ExtensionPrefs observers to be attached to each
130 // BrowserContext's ExtensionPrefs upon construction. These observers 131 // BrowserContext's ExtensionPrefs upon construction. These observers
131 // are not owned by ExtensionPrefs. 132 // are not owned by ExtensionPrefs.
132 virtual void GetEarlyExtensionPrefsObservers( 133 virtual void GetEarlyExtensionPrefsObservers(
133 content::BrowserContext* context, 134 content::BrowserContext* context,
134 std::vector<ExtensionPrefsObserver*>* observers) const = 0; 135 std::vector<ExtensionPrefsObserver*>* observers) const = 0;
135 136
136 // Returns true if loading background pages should be deferred. 137 // Returns the ProcessManagerDelegate shared across all BrowserContexts. May
137 virtual bool DeferLoadingBackgroundHosts( 138 // return NULL in tests or for simple embedders.
138 content::BrowserContext* context) const = 0; 139 virtual ProcessManagerDelegate* GetProcessManagerDelegate() const = 0;
139
140 virtual bool IsBackgroundPageAllowed(
141 content::BrowserContext* context) const = 0;
142 140
143 // Creates a new ExtensionHostDelegate instance. 141 // Creates a new ExtensionHostDelegate instance.
144 virtual scoped_ptr<ExtensionHostDelegate> CreateExtensionHostDelegate() = 0; 142 virtual scoped_ptr<ExtensionHostDelegate> CreateExtensionHostDelegate() = 0;
145 143
146 // Returns true if the client version has updated since the last run. Called 144 // Returns true if the client version has updated since the last run. Called
147 // once each time the extensions system is loaded per browser_context. The 145 // once each time the extensions system is loaded per browser_context. The
148 // implementation may wish to use the BrowserContext to record the current 146 // implementation may wish to use the BrowserContext to record the current
149 // version for later comparison. 147 // version for later comparison.
150 virtual bool DidVersionUpdate(content::BrowserContext* context) = 0; 148 virtual bool DidVersionUpdate(content::BrowserContext* context) = 0;
151 149
(...skipping 30 matching lines...) Expand all
182 // Returns the single instance of |this|. 180 // Returns the single instance of |this|.
183 static ExtensionsBrowserClient* Get(); 181 static ExtensionsBrowserClient* Get();
184 182
185 // Initialize the single instance. 183 // Initialize the single instance.
186 static void Set(ExtensionsBrowserClient* client); 184 static void Set(ExtensionsBrowserClient* client);
187 }; 185 };
188 186
189 } // namespace extensions 187 } // namespace extensions
190 188
191 #endif // EXTENSIONS_BROWSER_EXTENSIONS_BROWSER_CLIENT_H_ 189 #endif // EXTENSIONS_BROWSER_EXTENSIONS_BROWSER_CLIENT_H_
OLDNEW
« no previous file with comments | « extensions/DEPS ('k') | extensions/browser/process_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698