electron/shell/browser/extensions/electron_extension_host_delegate.cc
electron-roller[bot] 43ed763f18
chore: bump chromium to 133.0.6846.0 (main) (#44665)
* chore: bump chromium in DEPS to 133.0.6836.0

* chore: bump chromium in DEPS to 133.0.6838.0

* chore: update patches

* 6006096: [Sync ESB] Integrate Chrome Toast UI

https://chromium-review.googlesource.com/c/chromium/src/+/6006096

* Confine enable_device_bound_sessions buildflag to //net

https://chromium-review.googlesource.com/c/chromium/src/+/6014679

* revert [api] Delete deprecated struct FastApiTypedArray

 https://chromium-review.googlesource.com/c/v8/v8/+/5982984
Also
https://chromium-review.googlesource.com/c/v8/v8/+/5979766/1

* fixup revert [api] Delete deprecated struct FastApiTypedArray

* Migrate remaining NOTREACHED()s in chrome/

https://chromium-review.googlesource.com/c/chromium/src/+/5998172

* [Reland][Extensions] Remove ExtensionHostDelegate::GetJavaScriptDialogManager()

https://chromium-review.googlesource.com/c/chromium/src/+/6020106

* Remove NOTREACHED_IN_MIGRATION()

https://chromium-review.googlesource.com/c/chromium/src/+/6021996

* Remove Lock screen apps [#8] : remove lock screen extension

https://chromium-review.googlesource.com/c/chromium/src/+/6005846

* Reland "Add CrashReporterClient::GetProductInfo(ProductInfo*)"

https://chromium-review.googlesource.com/c/chromium/src/+/6012631

* Ozone/Wayland: remove lacros specific window states

https://chromium-review.googlesource.com/c/chromium/src/+/6011215

* chore: bump chromium in DEPS to 133.0.6840.0

* chore: bump chromium in DEPS to 133.0.6841.0

* chore: bump chromium in DEPS to 133.0.6844.0

* implement virtual WebContents::CanUserEnterFullscreen

* OnSearchifyStateChange -> OnSearchifyStarted

* regen libc++ filenames

* chore: bump chromium in DEPS to 133.0.6846.0

* chore: update patches

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Samuel Maddock <smaddock@slack-corp.com>
2024-11-19 19:52:20 -08:00

69 lines
2.3 KiB
C++

// 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.
#include "shell/browser/extensions/electron_extension_host_delegate.h"
#include <memory>
#include <string>
#include <utility>
#include "extensions/browser/media_capture_util.h"
#include "shell/browser/api/electron_api_web_contents.h"
#include "shell/browser/extensions/electron_extension_web_contents_observer.h"
#include "v8/include/v8.h"
namespace extensions {
ElectronExtensionHostDelegate::ElectronExtensionHostDelegate() = default;
ElectronExtensionHostDelegate::~ElectronExtensionHostDelegate() = default;
void ElectronExtensionHostDelegate::OnExtensionHostCreated(
content::WebContents* web_contents) {
ElectronExtensionWebContentsObserver::CreateForWebContents(web_contents);
v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::HandleScope scope(isolate);
electron::api::WebContents::FromOrCreate(isolate, web_contents);
}
void ElectronExtensionHostDelegate::CreateTab(
std::unique_ptr<content::WebContents> web_contents,
const std::string& extension_id,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& window_features,
bool user_gesture) {
// TODO(jamescook): Should app_shell support opening popup windows?
NOTREACHED();
}
void ElectronExtensionHostDelegate::ProcessMediaAccessRequest(
content::WebContents* web_contents,
const content::MediaStreamRequest& request,
content::MediaResponseCallback callback,
const Extension* extension) {
// Allow access to the microphone and/or camera.
media_capture_util::GrantMediaStreamRequest(web_contents, request,
std::move(callback), extension);
}
bool ElectronExtensionHostDelegate::CheckMediaAccessPermission(
content::RenderFrameHost* render_frame_host,
const url::Origin& security_origin,
blink::mojom::MediaStreamType type,
const Extension* extension) {
media_capture_util::VerifyMediaAccessPermission(type, extension);
return true;
}
content::PictureInPictureResult
ElectronExtensionHostDelegate::EnterPictureInPicture(
content::WebContents* web_contents) {
NOTREACHED();
}
void ElectronExtensionHostDelegate::ExitPictureInPicture() {
NOTREACHED();
}
} // namespace extensions