2017-08-04 00:55:19 +02:00
|
|
|
// Copyright 2017 the Chromium Embedded Framework Authors. Portions copyright
|
|
|
|
// 2013 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 CEF_LIBCEF_BROWSER_EXTENSIONS_EXTENSION_BACKGROUND_HOST_H_
|
|
|
|
#define CEF_LIBCEF_BROWSER_EXTENSIONS_EXTENSION_BACKGROUND_HOST_H_
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
2023-01-30 18:43:54 +01:00
|
|
|
#include "base/functional/callback_forward.h"
|
2017-08-04 00:55:19 +02:00
|
|
|
#include "extensions/browser/extension_host.h"
|
|
|
|
|
2020-09-22 21:54:02 +02:00
|
|
|
class AlloyBrowserHostImpl;
|
2017-08-04 00:55:19 +02:00
|
|
|
|
|
|
|
namespace content {
|
|
|
|
class WebContents;
|
|
|
|
} // namespace content
|
|
|
|
|
|
|
|
namespace extensions {
|
|
|
|
|
|
|
|
// The ExtensionHost for a background page. This is a thin wrapper around the
|
|
|
|
// ExtensionHost base class to support CEF-specific constructor. Object lifespan
|
|
|
|
// is managed by ProcessManager.
|
|
|
|
class CefExtensionBackgroundHost : public ExtensionHost {
|
|
|
|
public:
|
2020-09-22 21:54:02 +02:00
|
|
|
CefExtensionBackgroundHost(AlloyBrowserHostImpl* browser,
|
2017-08-04 00:55:19 +02:00
|
|
|
base::OnceClosure deleted_callback,
|
|
|
|
const Extension* extension,
|
|
|
|
content::WebContents* host_contents,
|
|
|
|
const GURL& url,
|
2021-04-21 00:52:34 +02:00
|
|
|
mojom::ViewType host_type);
|
2021-12-06 21:40:25 +01:00
|
|
|
|
|
|
|
CefExtensionBackgroundHost(const CefExtensionBackgroundHost&) = delete;
|
|
|
|
CefExtensionBackgroundHost& operator=(const CefExtensionBackgroundHost&) =
|
|
|
|
delete;
|
|
|
|
|
2017-08-04 00:55:19 +02:00
|
|
|
~CefExtensionBackgroundHost() override;
|
|
|
|
|
|
|
|
// content::WebContentsDelegate methods:
|
2021-07-23 18:40:13 +02:00
|
|
|
bool ShouldAllowRendererInitiatedCrossProcessNavigation(
|
|
|
|
bool is_main_frame_navigation) override;
|
2017-08-04 00:55:19 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
// Callback that will be executed on host deletion.
|
|
|
|
base::OnceClosure deleted_callback_;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace extensions
|
|
|
|
|
|
|
|
#endif // CEF_LIBCEF_BROWSER_EXTENSIONS_EXTENSION_BACKGROUND_HOST_H_
|