OLD | NEW |
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 Loading... |
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; | |
45 class RuntimeAPIDelegate; | 44 class RuntimeAPIDelegate; |
46 | 45 |
47 // Interface to allow the extensions module to make browser-process-specific | 46 // Interface to allow the extensions module to make browser-process-specific |
48 // queries of the embedder. Should be Set() once in the browser process. | 47 // queries of the embedder. Should be Set() once in the browser process. |
49 // | 48 // |
50 // NOTE: Methods that do not require knowledge of browser concepts should be | 49 // NOTE: Methods that do not require knowledge of browser concepts should be |
51 // added in ExtensionsClient (extensions/common/extensions_client.h) even if | 50 // added in ExtensionsClient (extensions/common/extensions_client.h) even if |
52 // they are only used in the browser process. | 51 // they are only used in the browser process. |
53 class ExtensionsBrowserClient { | 52 class ExtensionsBrowserClient { |
54 public: | 53 public: |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 virtual PrefService* GetPrefServiceForContext( | 126 virtual PrefService* GetPrefServiceForContext( |
128 content::BrowserContext* context) = 0; | 127 content::BrowserContext* context) = 0; |
129 | 128 |
130 // Populates a list of ExtensionPrefs observers to be attached to each | 129 // Populates a list of ExtensionPrefs observers to be attached to each |
131 // BrowserContext's ExtensionPrefs upon construction. These observers | 130 // BrowserContext's ExtensionPrefs upon construction. These observers |
132 // are not owned by ExtensionPrefs. | 131 // are not owned by ExtensionPrefs. |
133 virtual void GetEarlyExtensionPrefsObservers( | 132 virtual void GetEarlyExtensionPrefsObservers( |
134 content::BrowserContext* context, | 133 content::BrowserContext* context, |
135 std::vector<ExtensionPrefsObserver*>* observers) const = 0; | 134 std::vector<ExtensionPrefsObserver*>* observers) const = 0; |
136 | 135 |
137 // Returns the ProcessManagerDelegate shared across all BrowserContexts. May | 136 // Returns true if loading background pages should be deferred. |
138 // return NULL in tests or for simple embedders. | 137 virtual bool DeferLoadingBackgroundHosts( |
139 virtual ProcessManagerDelegate* GetProcessManagerDelegate() const = 0; | 138 content::BrowserContext* context) const = 0; |
| 139 |
| 140 virtual bool IsBackgroundPageAllowed( |
| 141 content::BrowserContext* context) const = 0; |
140 | 142 |
141 // Creates a new ExtensionHostDelegate instance. | 143 // Creates a new ExtensionHostDelegate instance. |
142 virtual scoped_ptr<ExtensionHostDelegate> CreateExtensionHostDelegate() = 0; | 144 virtual scoped_ptr<ExtensionHostDelegate> CreateExtensionHostDelegate() = 0; |
143 | 145 |
144 // Returns true if the client version has updated since the last run. Called | 146 // Returns true if the client version has updated since the last run. Called |
145 // once each time the extensions system is loaded per browser_context. The | 147 // once each time the extensions system is loaded per browser_context. The |
146 // implementation may wish to use the BrowserContext to record the current | 148 // implementation may wish to use the BrowserContext to record the current |
147 // version for later comparison. | 149 // version for later comparison. |
148 virtual bool DidVersionUpdate(content::BrowserContext* context) = 0; | 150 virtual bool DidVersionUpdate(content::BrowserContext* context) = 0; |
149 | 151 |
(...skipping 30 matching lines...) Expand all Loading... |
180 // Returns the single instance of |this|. | 182 // Returns the single instance of |this|. |
181 static ExtensionsBrowserClient* Get(); | 183 static ExtensionsBrowserClient* Get(); |
182 | 184 |
183 // Initialize the single instance. | 185 // Initialize the single instance. |
184 static void Set(ExtensionsBrowserClient* client); | 186 static void Set(ExtensionsBrowserClient* client); |
185 }; | 187 }; |
186 | 188 |
187 } // namespace extensions | 189 } // namespace extensions |
188 | 190 |
189 #endif // EXTENSIONS_BROWSER_EXTENSIONS_BROWSER_CLIENT_H_ | 191 #endif // EXTENSIONS_BROWSER_EXTENSIONS_BROWSER_CLIENT_H_ |
OLD | NEW |