blob: a6a44a581dc6296c5aa380c436c616ea0fa366c9 [file] [log] [blame]
[email protected]6b54fda2014-07-22 02:13:471// 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
8namespace content {
9class BrowserContext;
Nico Weber210c0bc2019-02-11 22:01:0910}
[email protected]6b54fda2014-07-22 02:13:4711
12namespace extensions {
13
achuithd3da4f02017-03-23 20:05:2914class Extension;
15
[email protected]6b54fda2014-07-22 02:13:4716// Customization of ProcessManager for the extension system embedder.
17class ProcessManagerDelegate {
18 public:
19 virtual ~ProcessManagerDelegate() {}
20
21 // Returns true if the embedder allows background pages for the given
22 // |context|.
achuithd3da4f02017-03-23 20:05:2923 virtual bool AreBackgroundPagesAllowedForContext(
[email protected]6b54fda2014-07-22 02:13:4724 content::BrowserContext* context) const = 0;
25
achuithd3da4f02017-03-23 20:05:2926 // 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]6b54fda2014-07-22 02:13:4732 // 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_