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.
5 #ifndef CHROME_BROWSER_EXTENSIONS_CHROME_PROCESS_MANAGER_DELEGATE_H_
6 #define CHROME_BROWSER_EXTENSIONS_CHROME_PROCESS_MANAGER_DELEGATE_H_
8 #include "base/compiler_specific.h"
9 #include "base/macros.h"
10 #include "content/public/browser/notification_observer.h"
11 #include "content/public/browser/notification_registrar.h"
12 #include "extensions/browser/process_manager_delegate.h"
17 namespace extensions
{
19 // Support for ProcessManager. Controls cases where Chrome wishes to disallow
20 // extension background pages or defer their creation.
21 class ChromeProcessManagerDelegate
: public ProcessManagerDelegate
,
22 public content::NotificationObserver
{
24 ChromeProcessManagerDelegate();
25 ~ChromeProcessManagerDelegate() override
;
27 // ProcessManagerDelegate implementation:
28 bool IsBackgroundPageAllowed(content::BrowserContext
* context
) const override
;
29 bool DeferCreatingStartupBackgroundHosts(
30 content::BrowserContext
* context
) const override
;
32 // content::NotificationObserver implementation:
33 void Observe(int type
,
34 const content::NotificationSource
& source
,
35 const content::NotificationDetails
& details
) override
;
38 // Notification handlers.
39 void OnBrowserWindowReady(Browser
* browser
);
40 void OnProfileCreated(Profile
* profile
);
41 void OnProfileDestroyed(Profile
* profile
);
43 content::NotificationRegistrar registrar_
;
45 DISALLOW_COPY_AND_ASSIGN(ChromeProcessManagerDelegate
);
48 } // namespace extensions
50 #endif // CHROME_BROWSER_EXTENSIONS_CHROME_PROCESS_MANAGER_DELEGATE_H_