2019-07-24 23:01:08 +00:00
|
|
|
// 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.
|
|
|
|
|
2021-11-22 07:34:31 +00:00
|
|
|
#ifndef ELECTRON_SHELL_BROWSER_EXTENSIONS_ELECTRON_EXTENSION_HOST_DELEGATE_H_
|
|
|
|
#define ELECTRON_SHELL_BROWSER_EXTENSIONS_ELECTRON_EXTENSION_HOST_DELEGATE_H_
|
2019-07-24 23:01:08 +00:00
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "extensions/browser/extension_host_delegate.h"
|
|
|
|
|
|
|
|
namespace extensions {
|
|
|
|
|
|
|
|
// A minimal ExtensionHostDelegate.
|
2020-02-03 22:01:10 +00:00
|
|
|
class ElectronExtensionHostDelegate : public ExtensionHostDelegate {
|
2019-07-24 23:01:08 +00:00
|
|
|
public:
|
2020-02-03 22:01:10 +00:00
|
|
|
ElectronExtensionHostDelegate();
|
|
|
|
~ElectronExtensionHostDelegate() override;
|
2019-07-24 23:01:08 +00:00
|
|
|
|
2021-11-03 11:41:45 +00:00
|
|
|
// disable copy
|
|
|
|
ElectronExtensionHostDelegate(const ElectronExtensionHostDelegate&) = delete;
|
|
|
|
ElectronExtensionHostDelegate& operator=(
|
|
|
|
const ElectronExtensionHostDelegate&) = delete;
|
|
|
|
|
2019-07-24 23:01:08 +00:00
|
|
|
// ExtensionHostDelegate implementation.
|
|
|
|
void OnExtensionHostCreated(content::WebContents* web_contents) override;
|
2021-03-04 17:27:05 +00:00
|
|
|
void OnMainFrameCreatedForBackgroundPage(ExtensionHost* host) override;
|
2019-07-24 23:01:08 +00:00
|
|
|
content::JavaScriptDialogManager* GetJavaScriptDialogManager() override;
|
|
|
|
void CreateTab(std::unique_ptr<content::WebContents> web_contents,
|
|
|
|
const std::string& extension_id,
|
|
|
|
WindowOpenDisposition disposition,
|
|
|
|
const gfx::Rect& initial_rect,
|
|
|
|
bool user_gesture) override;
|
|
|
|
void ProcessMediaAccessRequest(content::WebContents* web_contents,
|
|
|
|
const content::MediaStreamRequest& request,
|
|
|
|
content::MediaResponseCallback callback,
|
|
|
|
const Extension* extension) override;
|
|
|
|
bool CheckMediaAccessPermission(content::RenderFrameHost* render_frame_host,
|
|
|
|
const GURL& security_origin,
|
|
|
|
blink::mojom::MediaStreamType type,
|
|
|
|
const Extension* extension) override;
|
|
|
|
content::PictureInPictureResult EnterPictureInPicture(
|
|
|
|
content::WebContents* web_contents,
|
|
|
|
const viz::SurfaceId& surface_id,
|
|
|
|
const gfx::Size& natural_size) override;
|
|
|
|
void ExitPictureInPicture() override;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace extensions
|
|
|
|
|
2021-11-22 07:34:31 +00:00
|
|
|
#endif // ELECTRON_SHELL_BROWSER_EXTENSIONS_ELECTRON_EXTENSION_HOST_DELEGATE_H_
|