2020-01-13 22:55:58 +00:00
|
|
|
// Copyright 2019 Slack Technologies, Inc. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2021-11-22 07:34:31 +00:00
|
|
|
#ifndef ELECTRON_SHELL_BROWSER_EXTENSIONS_ELECTRON_PROCESS_MANAGER_DELEGATE_H_
|
|
|
|
#define ELECTRON_SHELL_BROWSER_EXTENSIONS_ELECTRON_PROCESS_MANAGER_DELEGATE_H_
|
2020-01-13 22:55:58 +00:00
|
|
|
|
|
|
|
#include "base/compiler_specific.h"
|
|
|
|
#include "content/public/browser/notification_observer.h"
|
|
|
|
#include "content/public/browser/notification_registrar.h"
|
|
|
|
#include "extensions/browser/process_manager_delegate.h"
|
|
|
|
|
|
|
|
class Browser;
|
|
|
|
class Profile;
|
|
|
|
|
|
|
|
namespace extensions {
|
|
|
|
|
|
|
|
// Support for ProcessManager. Controls cases where Electron wishes to disallow
|
|
|
|
// extension background pages or defer their creation.
|
|
|
|
class ElectronProcessManagerDelegate : public ProcessManagerDelegate {
|
|
|
|
public:
|
|
|
|
ElectronProcessManagerDelegate();
|
|
|
|
~ElectronProcessManagerDelegate() override;
|
|
|
|
|
2021-11-03 11:41:45 +00:00
|
|
|
// disable copy
|
|
|
|
ElectronProcessManagerDelegate(const ElectronProcessManagerDelegate&) =
|
|
|
|
delete;
|
|
|
|
ElectronProcessManagerDelegate& operator=(
|
|
|
|
const ElectronProcessManagerDelegate&) = delete;
|
|
|
|
|
2020-01-13 22:55:58 +00:00
|
|
|
// ProcessManagerDelegate implementation:
|
|
|
|
bool AreBackgroundPagesAllowedForContext(
|
|
|
|
content::BrowserContext* context) const override;
|
|
|
|
bool IsExtensionBackgroundPageAllowed(
|
|
|
|
content::BrowserContext* context,
|
|
|
|
const Extension& extension) const override;
|
|
|
|
bool DeferCreatingStartupBackgroundHosts(
|
|
|
|
content::BrowserContext* context) const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace extensions
|
|
|
|
|
2021-11-22 07:34:31 +00:00
|
|
|
#endif // ELECTRON_SHELL_BROWSER_EXTENSIONS_ELECTRON_PROCESS_MANAGER_DELEGATE_H_
|