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 "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 | 9 |
10 class CommandLine; | 10 class CommandLine; |
11 class PrefService; | 11 class PrefService; |
12 | 12 |
13 namespace content { | 13 namespace content { |
14 class BrowserContext; | 14 class BrowserContext; |
15 class JavaScriptDialogManager; | 15 class JavaScriptDialogManager; |
| 16 class WebContents; |
16 } | 17 } |
17 | 18 |
18 namespace extensions { | 19 namespace extensions { |
19 | 20 |
20 class AppSorting; | 21 class AppSorting; |
21 | 22 |
22 // Interface to allow the extensions module to make browser-process-specific | 23 // Interface to allow the extensions module to make browser-process-specific |
23 // queries of the embedder. Should be Set() once in the browser process. | 24 // queries of the embedder. Should be Set() once in the browser process. |
24 // | 25 // |
25 // NOTE: Methods that do not require knowledge of browser concepts should be | 26 // NOTE: Methods that do not require knowledge of browser concepts should be |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 virtual PrefService* GetPrefServiceForContext( | 65 virtual PrefService* GetPrefServiceForContext( |
65 content::BrowserContext* context) = 0; | 66 content::BrowserContext* context) = 0; |
66 | 67 |
67 // Returns true if loading background pages should be deferred. | 68 // Returns true if loading background pages should be deferred. |
68 virtual bool DeferLoadingBackgroundHosts( | 69 virtual bool DeferLoadingBackgroundHosts( |
69 content::BrowserContext* context) const = 0; | 70 content::BrowserContext* context) const = 0; |
70 | 71 |
71 virtual bool IsBackgroundPageAllowed( | 72 virtual bool IsBackgroundPageAllowed( |
72 content::BrowserContext* context) const = 0; | 73 content::BrowserContext* context) const = 0; |
73 | 74 |
| 75 // Called after the hosting |web_contents| for an extension is created. The |
| 76 // implementation may wish to add preference observers to |web_contents|. |
| 77 virtual void OnExtensionHostCreated(content::WebContents* web_contents) = 0; |
| 78 |
74 // Returns true if the client version has updated since the last run. Called | 79 // Returns true if the client version has updated since the last run. Called |
75 // once each time the extensions system is loaded per browser_context. The | 80 // once each time the extensions system is loaded per browser_context. The |
76 // implementation may wish to use the BrowserContext to record the current | 81 // implementation may wish to use the BrowserContext to record the current |
77 // version for later comparison. | 82 // version for later comparison. |
78 virtual bool DidVersionUpdate(content::BrowserContext* context) = 0; | 83 virtual bool DidVersionUpdate(content::BrowserContext* context) = 0; |
79 | 84 |
80 // Creates a new AppSorting instance. | 85 // Creates a new AppSorting instance. |
81 virtual scoped_ptr<AppSorting> CreateAppSorting() = 0; | 86 virtual scoped_ptr<AppSorting> CreateAppSorting() = 0; |
82 | 87 |
83 // Return true if the system is run in forced app mode. | 88 // Return true if the system is run in forced app mode. |
84 virtual bool IsRunningInForcedAppMode() = 0; | 89 virtual bool IsRunningInForcedAppMode() = 0; |
85 | 90 |
86 // Returns the embedder's JavaScriptDialogManager or NULL if the embedder | 91 // Returns the embedder's JavaScriptDialogManager or NULL if the embedder |
87 // does not support JavaScript dialogs. | 92 // does not support JavaScript dialogs. |
88 virtual content::JavaScriptDialogManager* GetJavaScriptDialogManager() = 0; | 93 virtual content::JavaScriptDialogManager* GetJavaScriptDialogManager() = 0; |
89 | 94 |
90 // Returns the single instance of |this|. | 95 // Returns the single instance of |this|. |
91 static ExtensionsBrowserClient* Get(); | 96 static ExtensionsBrowserClient* Get(); |
92 | 97 |
93 // Initialize the single instance. | 98 // Initialize the single instance. |
94 static void Set(ExtensionsBrowserClient* client); | 99 static void Set(ExtensionsBrowserClient* client); |
95 }; | 100 }; |
96 | 101 |
97 } // namespace extensions | 102 } // namespace extensions |
98 | 103 |
99 #endif // EXTENSIONS_BROWSER_EXTENSIONS_BROWSER_CLIENT_H_ | 104 #endif // EXTENSIONS_BROWSER_EXTENSIONS_BROWSER_CLIENT_H_ |
OLD | NEW |