[email protected] | 6b54fda | 2014-07-22 02:13:47 | [diff] [blame] | 1 | // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef EXTENSIONS_BROWSER_PROCESS_MANAGER_DELEGATE_H_ |
| 6 | #define EXTENSIONS_BROWSER_PROCESS_MANAGER_DELEGATE_H_ |
| 7 | |
| 8 | namespace content { |
| 9 | class BrowserContext; |
Nico Weber | 210c0bc | 2019-02-11 22:01:09 | [diff] [blame^] | 10 | } |
[email protected] | 6b54fda | 2014-07-22 02:13:47 | [diff] [blame] | 11 | |
| 12 | namespace extensions { |
| 13 | |
achuith | d3da4f0 | 2017-03-23 20:05:29 | [diff] [blame] | 14 | class Extension; |
| 15 | |
[email protected] | 6b54fda | 2014-07-22 02:13:47 | [diff] [blame] | 16 | // Customization of ProcessManager for the extension system embedder. |
| 17 | class ProcessManagerDelegate { |
| 18 | public: |
| 19 | virtual ~ProcessManagerDelegate() {} |
| 20 | |
| 21 | // Returns true if the embedder allows background pages for the given |
| 22 | // |context|. |
achuith | d3da4f0 | 2017-03-23 20:05:29 | [diff] [blame] | 23 | virtual bool AreBackgroundPagesAllowedForContext( |
[email protected] | 6b54fda | 2014-07-22 02:13:47 | [diff] [blame] | 24 | content::BrowserContext* context) const = 0; |
| 25 | |
achuith | d3da4f0 | 2017-03-23 20:05:29 | [diff] [blame] | 26 | // Returns true if the embedder allows background pages for the given |
| 27 | // |context|, and a given |extension|. |
| 28 | virtual bool IsExtensionBackgroundPageAllowed( |
| 29 | content::BrowserContext* context, |
| 30 | const Extension& extension) const = 0; |
| 31 | |
[email protected] | 6b54fda | 2014-07-22 02:13:47 | [diff] [blame] | 32 | // Returns true if the embedder wishes to defer starting up the renderers for |
| 33 | // extension background pages. If the embedder returns true it must call |
| 34 | // ProcessManager::MaybeCreateStartupBackgroundHosts() when it is ready. See |
| 35 | // ChromeProcessManagerDelegate for examples of how this is useful. |
| 36 | virtual bool DeferCreatingStartupBackgroundHosts( |
| 37 | content::BrowserContext* context) const = 0; |
| 38 | }; |
| 39 | |
| 40 | } // namespace extensions |
| 41 | |
| 42 | #endif // EXTENSIONS_BROWSER_PROCESS_MANAGER_DELEGATE_H_ |