summaryrefslogtreecommitdiffstats
path: root/extensions/browser/process_manager_delegate.h
blob: 7cc48c0af74ee81ab9db0e1eddc88bcbe1580e10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef EXTENSIONS_BROWSER_PROCESS_MANAGER_DELEGATE_H_
#define EXTENSIONS_BROWSER_PROCESS_MANAGER_DELEGATE_H_

namespace content {
class BrowserContext;
};

namespace extensions {

// Customization of ProcessManager for the extension system embedder.
class ProcessManagerDelegate {
 public:
  virtual ~ProcessManagerDelegate() {}

  // Returns true if the embedder allows background pages for the given
  // |context|.
  virtual bool IsBackgroundPageAllowed(
      content::BrowserContext* context) const = 0;

  // Returns true if the embedder wishes to defer starting up the renderers for
  // extension background pages. If the embedder returns true it must call
  // ProcessManager::MaybeCreateStartupBackgroundHosts() when it is ready. See
  // ChromeProcessManagerDelegate for examples of how this is useful.
  virtual bool DeferCreatingStartupBackgroundHosts(
      content::BrowserContext* context) const = 0;
};

}  // namespace extensions

#endif  // EXTENSIONS_BROWSER_PROCESS_MANAGER_DELEGATE_H_