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 |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "extensions/browser/extension_prefs_observer.h" |
12 | 13 |
13 class ExtensionFunctionRegistry; | 14 class ExtensionFunctionRegistry; |
14 class PrefService; | 15 class PrefService; |
15 | 16 |
16 namespace base { | 17 namespace base { |
17 class CommandLine; | 18 class CommandLine; |
18 } | 19 } |
19 | 20 |
20 namespace content { | 21 namespace content { |
21 class BrowserContext; | 22 class BrowserContext; |
22 class WebContents; | 23 class WebContents; |
23 } | 24 } |
24 | 25 |
25 namespace extensions { | 26 namespace extensions { |
26 | 27 |
27 class ApiActivityMonitor; | 28 class ApiActivityMonitor; |
28 class AppSorting; | 29 class AppSorting; |
29 class Extension; | 30 class Extension; |
30 class ExtensionHostDelegate; | 31 class ExtensionHostDelegate; |
| 32 class ExtensionPrefsObserver; |
31 class ExtensionSystem; | 33 class ExtensionSystem; |
32 class ExtensionSystemProvider; | 34 class ExtensionSystemProvider; |
33 | 35 |
34 // Interface to allow the extensions module to make browser-process-specific | 36 // Interface to allow the extensions module to make browser-process-specific |
35 // queries of the embedder. Should be Set() once in the browser process. | 37 // queries of the embedder. Should be Set() once in the browser process. |
36 // | 38 // |
37 // NOTE: Methods that do not require knowledge of browser concepts should be | 39 // NOTE: Methods that do not require knowledge of browser concepts should be |
38 // added in ExtensionsClient (extensions/common/extensions_client.h) even if | 40 // added in ExtensionsClient (extensions/common/extensions_client.h) even if |
39 // they are only used in the browser process. | 41 // they are only used in the browser process. |
40 class ExtensionsBrowserClient { | 42 class ExtensionsBrowserClient { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 // Returns true if |extension| can see events and data from another | 85 // Returns true if |extension| can see events and data from another |
84 // sub-profile (incognito to original profile, or vice versa). | 86 // sub-profile (incognito to original profile, or vice versa). |
85 virtual bool CanExtensionCrossIncognito( | 87 virtual bool CanExtensionCrossIncognito( |
86 const extensions::Extension* extension, | 88 const extensions::Extension* extension, |
87 content::BrowserContext* context) const = 0; | 89 content::BrowserContext* context) const = 0; |
88 | 90 |
89 // Returns the PrefService associated with |context|. | 91 // Returns the PrefService associated with |context|. |
90 virtual PrefService* GetPrefServiceForContext( | 92 virtual PrefService* GetPrefServiceForContext( |
91 content::BrowserContext* context) = 0; | 93 content::BrowserContext* context) = 0; |
92 | 94 |
| 95 // Populates a list of ExtensionPrefs observers to be attached to each |
| 96 // BrowserContext's ExtensionPrefs upon construction. These observers |
| 97 // are not owned by ExtensionPrefs. |
| 98 virtual void GetEarlyExtensionPrefsObservers( |
| 99 content::BrowserContext* context, |
| 100 std::vector<ExtensionPrefsObserver*>* observers) const = 0; |
| 101 |
93 // Returns true if loading background pages should be deferred. | 102 // Returns true if loading background pages should be deferred. |
94 virtual bool DeferLoadingBackgroundHosts( | 103 virtual bool DeferLoadingBackgroundHosts( |
95 content::BrowserContext* context) const = 0; | 104 content::BrowserContext* context) const = 0; |
96 | 105 |
97 virtual bool IsBackgroundPageAllowed( | 106 virtual bool IsBackgroundPageAllowed( |
98 content::BrowserContext* context) const = 0; | 107 content::BrowserContext* context) const = 0; |
99 | 108 |
100 // Creates a new ExtensionHostDelegate instance. | 109 // Creates a new ExtensionHostDelegate instance. |
101 virtual scoped_ptr<ExtensionHostDelegate> CreateExtensionHostDelegate() = 0; | 110 virtual scoped_ptr<ExtensionHostDelegate> CreateExtensionHostDelegate() = 0; |
102 | 111 |
(...skipping 29 matching lines...) Expand all Loading... |
132 // Returns the single instance of |this|. | 141 // Returns the single instance of |this|. |
133 static ExtensionsBrowserClient* Get(); | 142 static ExtensionsBrowserClient* Get(); |
134 | 143 |
135 // Initialize the single instance. | 144 // Initialize the single instance. |
136 static void Set(ExtensionsBrowserClient* client); | 145 static void Set(ExtensionsBrowserClient* client); |
137 }; | 146 }; |
138 | 147 |
139 } // namespace extensions | 148 } // namespace extensions |
140 | 149 |
141 #endif // EXTENSIONS_BROWSER_EXTENSIONS_BROWSER_CLIENT_H_ | 150 #endif // EXTENSIONS_BROWSER_EXTENSIONS_BROWSER_CLIENT_H_ |
OLD | NEW |