chore: bump chromium to 125.0.6412.0 (main) (#41610)

* chore: bump chromium in DEPS to 124.0.6361.0

* chore: bump chromium in DEPS to 124.0.6363.0

* chore: update patches

Manually apply printing.patch w/no code changes due to upstream shear.
Xref: 5349263

* chore: bump chromium in DEPS to 124.0.6365.0

* chore: bump chromium in DEPS to 124.0.6367.0

* update patches

* 5371735: Rename SystemGeolocationSourceMac to SystemGeolocationSourceApple

5371735

* missed a MAS bit

* chore: update windows toolchain

5350823: New toolchain for Windows 11 10.0.22621.2428 SDK | 5350823

* chore: bump chromium in DEPS to 125.0.6368.0

* fix patches

* chore: update patches

* 5232401: [PDF] Move generic utils from //chrome to //components/pdf (1/2)

5232401

* revert 5380898

* chore: bump chromium in DEPS to 125.0.6370.0

* build: use updated windows toolchain

* fix patches

* chore: update patches

* more pdf_util to components

* 5372414: [Extensions] Remove DispatcherDelegate

5372414

* fix accessibility_ui patch

* chore: bump chromium in DEPS to 125.0.6372.0

* chore: bump chromium in DEPS to 125.0.6374.0

* chore: bump chromium in DEPS to 125.0.6376.0

* chore: bump chromium in DEPS to 125.0.6378.0

* chore: bump chromium in DEPS to 125.0.6379.3

* chore: update patches (+ MAS patch changes)

* chore: update patches

* 5381159: Cleanup media::KeySystemSupportObserver
5381159

* 5382233: Reland "Web `Speech to Text` with SODA backend"
5382233

* chore: update `exclusive_access` patch

- 5367497: Add a metric for the website state when Fullscreen API is requested
  - 5367497

* chore: add build dependency

5367497: Add a metric for the website state when Fullscreen API is requested
5367497

* chore: bump chromium in DEPS to 125.0.6382.0

* chore: update libcxx filenames

* chore: update patches

* chore: bump chromium in DEPS to 125.0.6384.0

* chore: remove old patch

* 5394039: [Extensions] Change "blessed" -> "privileged" in extension feature files
5394039

* fix: remove deprecated errno constants in node/libuv

* 5362194: Return expected from ProcessMetrics CPU methods
5362194

* 5383927: Add new Pickle factory functions with explicit ownership
5383927

* 5373340: Simplify app-region/Draggable Region implementation
5373340

* 5386875: Cleanup printing preferences files
5386875

* chore: update libc++ filenames

* fix: add enterprise buildflags dep

* chore: bump chromium in DEPS to 125.0.6386.0

* chore: add build dep

* chore: update patches

* chore: bump chromium in DEPS to 125.0.6388.0

* chore: bump chromium in DEPS to 125.0.6390.0

* chore: update patches

* 4918014: preloading: Add NewTabPagePageLoadMetricsObserver
4918014

* 5401234: [PDF] Remove `PDFDocumentHelperClient::FindPdfChildFrame` API
5401234

* 5116175: Relocate Windows XPS printing feature helper methods
5116175

* fixup! 5373340: Simplify app-region/Draggable Region implementation 5373340

* fixup! chore: add build dep

* chore: remove dead code & dead patch

Was dealing with 5402805 when I realized this code is no longer possible to call. It seems like this code became dead in the previous roll (#41514).

The patch exposed a `DxdiagDx12VulkanRequested` method on Chromium's `GpuDataManagerImpl`, which we consumed only in our own `GPUInfoManager::NeedsCompleteGpuInfoCollection`. There are no other references to this method, so it and the patch can both be deleted. Yay!

* chore: bump chromium in DEPS to 125.0.6392.0

* chore: bump chromium in DEPS to 125.0.6393.0

* chore: update patches

* chore: bump chromium in DEPS to 125.0.6394.0

* chore: bump chromium in DEPS to 125.0.6396.0

* chore: bump chromium in DEPS to 125.0.6397.0

* chore: update printing.patch

Xref: 5100842

No code changes, but had to apply patch manually due to upstream code shear

* chore: update add_maximized_parameter_to_linuxui_getwindowframeprovider.patch

No manual changes; patch applied with fuzz 1

* chore: update feat_allow_code_cache_in_custom_schemes.patch

No manual changes; patch applied with fuzz 2

* chore: silence "space before tab in indent" git rebase-apply warning

* chore: e patches all

* build: update all.gn to avoid FTBFS when disabling raw_ptr

Xref: 5371737

* Rename PdfService Mojo interface to PdfHost

Xref: 5411957

* chore: bump chromium in DEPS to 125.0.6398.0

* chore: update patches

* chore: bump chromium in DEPS to 125.0.6400.0

* chore: update patches

* [media] Remove unused `GetSupportedKeySystems` from MediaClient

Xref: 5420247

* chore: update JSInjection::New call to match upstream change

Xref: 5403967

[Extensions] Wire up the renderer for multiple user script worlds

* 5362362: Derive display ID from monitor adapter ID instead of szDevice.

5362362

* 5116175: Relocate Windows XPS printing feature helper methods

5116175

* chore: add v8-sandbox.h to electron-node

* chore: update patches

* chore: update patches

* fixup! 5394039: [Extensions] Change blessed -> privileged in extension feature files

* chore: bump chromium in DEPS to 125.0.6412.0

* chore: update patches

* chore: node script/gen-libc++-filenames.js

* [FPF] Create Fingerprinting Protection ruleset service.

Refs 5420158

* Add ExclusiveAccessPermissionManager

Refs 5273787

* Preserve the PNG colorspace when decoding into a SkBitmap.

Refs 5421254

* chore: iwyu

* fix: abstract-socket compilation

* ci: bump container for node 20 support

* fixup! abstract-socket compilation

* fix: compiling nan specs

* chore: revert winreg version bump

accidental bump to 1.2.5 revealed failing app.setasdefaultprotocolclient
test suite. Should be revisited separately.

* ci: set node 20 for darwin x64 tests

* fix: broken patch export

* chore: cleanup mas_avoid_private_macos_api_usage.patch.patch

Removed code that was inadvertently put back after 5348565 removed it

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: clavin <clavin@electronjs.org>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
This commit is contained in:
electron-roller[bot] 2024-04-15 18:10:32 -04:00 committed by GitHub
parent 6aa9a003c8
commit c670e38b4b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
146 changed files with 1288 additions and 1213 deletions

View file

@ -39,7 +39,6 @@
#endif // BUILDFLAG(ENABLE_WIDEVINE)
#if BUILDFLAG(ENABLE_PDF_VIEWER)
#include "chrome/common/pdf_util.h"
#include "components/pdf/common/constants.h"
#include "pdf/pdf.h" // nogncheck
#include "shell/common/electron_constants.h"

View file

@ -1277,9 +1277,10 @@ std::vector<gin_helper::Dictionary> App::GetAppMetrics(v8::Isolate* isolate) {
auto pid_dict = gin_helper::Dictionary::CreateEmpty(isolate);
auto cpu_dict = gin_helper::Dictionary::CreateEmpty(isolate);
std::optional<double> usage =
process_metric.second->metrics->GetPlatformIndependentCPUUsage();
cpu_dict.Set("percentCPUUsage", usage.value_or(0) / processor_count);
double usage =
process_metric.second->metrics->GetPlatformIndependentCPUUsage()
.value_or(0);
cpu_dict.Set("percentCPUUsage", usage / processor_count);
#if !BUILDFLAG(IS_WIN)
cpu_dict.Set("idleWakeupsPerSecond",

View file

@ -403,8 +403,7 @@ void DesktopCapturer::UpdateSourcesList(DesktopMediaList* list) {
base::UTF8ToWide(device_name.c_str(), device_name.size(),
&wide_device_name);
const int64_t device_id =
display::win::internal::DisplayInfo::DeviceIdFromDeviceName(
wide_device_name.c_str());
base::PersistentHash(base::WideToUTF8(wide_device_name.c_str()));
source.display_id = base::NumberToString(device_id);
}
}

View file

@ -1163,7 +1163,9 @@ void WebContents::AddNewContents(
content::WebContents* WebContents::OpenURLFromTab(
content::WebContents* source,
const content::OpenURLParams& params) {
const content::OpenURLParams& params,
base::OnceCallback<void(content::NavigationHandle&)>
navigation_handle_callback) {
auto weak_this = GetWeakPtr();
if (params.disposition != WindowOpenDisposition::CURRENT_TAB) {
Emit("-new-window", params.url, "", params.disposition, "", params.referrer,
@ -2000,10 +2002,12 @@ void WebContents::MessageHost(const std::string& channel,
std::move(arguments));
}
void WebContents::UpdateDraggableRegions(
std::vector<mojom::DraggableRegionPtr> regions) {
if (owner_window() && owner_window()->has_frame())
void WebContents::DraggableRegionsChanged(
const std::vector<blink::mojom::DraggableRegionPtr>& regions,
content::WebContents* contents) {
if (owner_window() && owner_window()->has_frame()) {
return;
}
draggable_region_ = DraggableRegionsToSkRegion(regions);
}

View file

@ -13,6 +13,7 @@
#include <utility>
#include <vector>
#include "base/functional/callback_forward.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/raw_ptr_exclusion.h"
#include "base/memory/weak_ptr.h"
@ -451,7 +452,6 @@ class WebContents : public ExclusiveAccessContext,
// mojom::ElectronWebContentsUtility
void OnFirstNonEmptyLayout(content::RenderFrameHost* render_frame_host);
void UpdateDraggableRegions(std::vector<mojom::DraggableRegionPtr> regions);
void SetTemporaryZoomLevel(double level);
void DoGetZoomLevel(
electron::mojom::ElectronWebContentsUtility::DoGetZoomLevelCallback
@ -558,7 +558,9 @@ class WebContents : public ExclusiveAccessContext,
bool* was_blocked) override;
content::WebContents* OpenURLFromTab(
content::WebContents* source,
const content::OpenURLParams& params) override;
const content::OpenURLParams& params,
base::OnceCallback<void(content::NavigationHandle&)>
navigation_handle_callback) override;
void BeforeUnloadFired(content::WebContents* tab,
bool proceed,
bool* proceed_to_fire_unload) override;
@ -620,6 +622,9 @@ class WebContents : public ExclusiveAccessContext,
void OnAudioStateChanged(bool audible) override;
void UpdatePreferredSize(content::WebContents* web_contents,
const gfx::Size& pref_size) override;
void DraggableRegionsChanged(
const std::vector<blink::mojom::DraggableRegionPtr>& regions,
content::WebContents* contents) override;
// content::WebContentsObserver:
void BeforeUnloadFired(bool proceed) override;

View file

@ -28,16 +28,6 @@ GPUInfoManager::~GPUInfoManager() {
content::GpuDataManagerImpl::GetInstance()->RemoveObserver(this);
}
// Based on
// https://chromium.googlesource.com/chromium/src.git/+/69.0.3497.106/content/browser/gpu/gpu_data_manager_impl_private.cc#838
bool GPUInfoManager::NeedsCompleteGpuInfoCollection() const {
#if BUILDFLAG(IS_WIN)
return gpu_data_manager_->DxdiagDx12VulkanRequested();
#else
return false;
#endif
}
// Should be posted to the task runner
void GPUInfoManager::ProcessCompleteInfo() {
base::Value::Dict result = EnumerateGPUInfo(gpu_data_manager_->GetGPUInfo());

View file

@ -27,7 +27,6 @@ class GPUInfoManager : public content::GpuDataManagerObserver {
GPUInfoManager(const GPUInfoManager&) = delete;
GPUInfoManager& operator=(const GPUInfoManager&) = delete;
bool NeedsCompleteGpuInfoCollection() const;
void FetchCompleteInfo(gin_helper::Promise<base::Value> promise);
void FetchBasicInfo(gin_helper::Promise<base::Value> promise);
void OnGpuInfoUpdate() override;

View file

@ -305,6 +305,11 @@ UsbSystemTrayIcon* BrowserProcessImpl::usb_system_tray_icon() {
return nullptr;
}
subresource_filter::RulesetService*
BrowserProcessImpl::fingerprinting_protection_ruleset_service() {
return nullptr;
}
os_crypt_async::OSCryptAsync* BrowserProcessImpl::os_crypt_async() {
return os_crypt_async_.get();
}

View file

@ -126,6 +126,8 @@ class BrowserProcessImpl : public BrowserProcess {
const std::string& GetApplicationLocale() override;
printing::PrintJobManager* print_job_manager() override;
StartupData* startup_data() override;
subresource_filter::RulesetService*
fingerprinting_protection_ruleset_service() override;
ValueMapPrefStore* in_memory_pref_store() const {
return in_memory_pref_store_.get();

View file

@ -1494,10 +1494,10 @@ void ElectronBrowserClient::
render_frame_host.GetGlobalId()));
#endif
#if BUILDFLAG(ENABLE_PDF_VIEWER)
associated_registry.AddInterface<pdf::mojom::PdfService>(base::BindRepeating(
associated_registry.AddInterface<pdf::mojom::PdfHost>(base::BindRepeating(
[](content::RenderFrameHost* render_frame_host,
mojo::PendingAssociatedReceiver<pdf::mojom::PdfService> receiver) {
pdf::PDFDocumentHelper::BindPdfService(
mojo::PendingAssociatedReceiver<pdf::mojom::PdfHost> receiver) {
pdf::PDFDocumentHelper::BindPdfHost(
std::move(receiver), render_frame_host,
std::make_unique<ElectronPDFDocumentHelperClient>());
},

View file

@ -10,7 +10,7 @@
#include "base/apple/foundation_util.h"
#include "base/path_service.h"
#include "services/device/public/cpp/geolocation/geolocation_system_permission_manager.h"
#include "services/device/public/cpp/geolocation/system_geolocation_source_mac.h"
#include "services/device/public/cpp/geolocation/system_geolocation_source_apple.h"
#include "shell/browser/browser_process_impl.h"
#include "shell/browser/mac/electron_application.h"
#include "shell/browser/mac/electron_application_delegate.h"
@ -36,8 +36,8 @@ void ElectronBrowserMainParts::PreCreateMainMessageLoop() {
if (!device::GeolocationSystemPermissionManager::GetInstance()) {
device::GeolocationSystemPermissionManager::SetInstance(
device::SystemGeolocationSourceMac::
CreateGeolocationSystemPermissionManagerOnMac());
device::SystemGeolocationSourceApple::
CreateGeolocationSystemPermissionManager());
}
}

View file

@ -4,20 +4,11 @@
#include "shell/browser/electron_pdf_document_helper_client.h"
#include "chrome/browser/pdf/pdf_frame_util.h"
#include "content/public/browser/web_contents.h"
ElectronPDFDocumentHelperClient::ElectronPDFDocumentHelperClient() = default;
ElectronPDFDocumentHelperClient::~ElectronPDFDocumentHelperClient() = default;
content::RenderFrameHost* ElectronPDFDocumentHelperClient::FindPdfFrame(
content::WebContents* contents) {
content::RenderFrameHost* main_frame = contents->GetPrimaryMainFrame();
content::RenderFrameHost* pdf_frame =
pdf_frame_util::FindPdfChildFrame(main_frame);
return pdf_frame ? pdf_frame : main_frame;
}
void ElectronPDFDocumentHelperClient::UpdateContentRestrictions(
content::RenderFrameHost* render_frame_host,
int content_restrictions) {}

View file

@ -17,8 +17,6 @@ class ElectronPDFDocumentHelperClient : public pdf::PDFDocumentHelperClient {
private:
// pdf::PDFDocumentHelperClient
content::RenderFrameHost* FindPdfFrame(
content::WebContents* contents) override;
void UpdateContentRestrictions(content::RenderFrameHost* render_frame_host,
int content_restrictions) override;
void OnPDFHasUnsupportedFeature(content::WebContents* contents) override;

View file

@ -62,4 +62,7 @@ bool ElectronSpeechRecognitionManagerDelegate::FilterProfanities(
return false;
}
void ElectronSpeechRecognitionManagerDelegate::BindSpeechRecognitionContext(
mojo::PendingReceiver<media::mojom::SpeechRecognitionContext> receiver) {}
} // namespace electron

View file

@ -50,6 +50,9 @@ class ElectronSpeechRecognitionManagerDelegate
override;
content::SpeechRecognitionEventListener* GetEventListener() override;
bool FilterProfanities(int render_process_id) override;
void BindSpeechRecognitionContext(
mojo::PendingReceiver<media::mojom::SpeechRecognitionContext> receiver)
override;
};
} // namespace electron

View file

@ -43,14 +43,6 @@ void ElectronWebContentsUtilityHandlerImpl::OnFirstNonEmptyLayout() {
}
}
void ElectronWebContentsUtilityHandlerImpl::UpdateDraggableRegions(
std::vector<mojom::DraggableRegionPtr> regions) {
api::WebContents* api_web_contents = api::WebContents::From(web_contents());
if (api_web_contents) {
api_web_contents->UpdateDraggableRegions(std::move(regions));
}
}
void ElectronWebContentsUtilityHandlerImpl::SetTemporaryZoomLevel(
double level) {
api::WebContents* api_web_contents = api::WebContents::From(web_contents());

View file

@ -41,8 +41,6 @@ class ElectronWebContentsUtilityHandlerImpl
// mojom::ElectronWebContentsUtility:
void OnFirstNonEmptyLayout() override;
void UpdateDraggableRegions(
std::vector<mojom::DraggableRegionPtr> regions) override;
void SetTemporaryZoomLevel(double level) override;
void DoGetZoomLevel(DoGetZoomLevelCallback callback) override;

View file

@ -18,8 +18,6 @@ namespace electron {
// Observer to dispatch those events.
class ExtendedWebContentsObserver : public base::CheckedObserver {
public:
virtual void OnDraggableRegionsUpdated(
const std::vector<mojom::DraggableRegionPtr>& regions) {}
virtual void OnSetContentBounds(const gfx::Rect& rect) {}
virtual void OnActivateContents() {}
virtual void OnPageTitleUpdated(const std::u16string& title,

View file

@ -699,7 +699,7 @@ bool ScriptingExecuteScriptFunction::Execute(
script_executor->ExecuteScript(
mojom::HostID(mojom::HostID::HostType::kExtensions, extension()->id()),
mojom::CodeInjection::NewJs(mojom::JSInjection::New(
std::move(sources), execution_world,
std::move(sources), execution_world, /*world_id=*/std::nullopt,
blink::mojom::WantResultOption::kWantResult,
user_gesture() ? blink::mojom::UserActivationOption::kActivate
: blink::mojom::UserActivationOption::kDoNotActivate,

View file

@ -4,13 +4,14 @@
#include "shell/browser/ui/drag_util.h"
#include "third_party/blink/public/mojom/page/draggable_region.mojom.h"
#include "ui/gfx/geometry/skia_conversions.h"
namespace electron {
// Convert draggable regions in raw format to SkRegion format.
std::unique_ptr<SkRegion> DraggableRegionsToSkRegion(
const std::vector<mojom::DraggableRegionPtr>& regions) {
const std::vector<blink::mojom::DraggableRegionPtr>& regions) {
auto sk_region = std::make_unique<SkRegion>();
for (const auto& region : regions) {
sk_region->op(

View file

@ -9,6 +9,7 @@
#include <vector>
#include "electron/shell/common/api/api.mojom.h"
#include "third_party/blink/public/mojom/page/draggable_region.mojom-forward.h"
#include "third_party/skia/include/core/SkRegion.h"
#include "ui/gfx/image/image.h"
@ -24,7 +25,7 @@ void DragFileItems(const std::vector<base::FilePath>& files,
// Convert draggable regions in raw format to SkRegion format.
std::unique_ptr<SkRegion> DraggableRegionsToSkRegion(
const std::vector<mojom::DraggableRegionPtr>& regions);
const std::vector<blink::mojom::DraggableRegionPtr>& regions);
} // namespace electron

View file

@ -5,6 +5,7 @@
#include "shell/browser/ui/views/win_icon_painter.h"
#include "base/numerics/safe_conversions.h"
#include "third_party/skia/include/core/SkPath.h"
#include "ui/gfx/color_utils.h"
#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/gfx/geometry/rrect_f.h"

View file

@ -25,19 +25,11 @@ interface ElectronAutofillDriver {
HideAutofillPopup();
};
struct DraggableRegion {
bool draggable;
gfx.mojom.Rect bounds;
};
interface ElectronWebContentsUtility {
// Informs underlying WebContents that first non-empty layout was performed
// by compositor.
OnFirstNonEmptyLayout();
UpdateDraggableRegions(
array<DraggableRegion> regions);
SetTemporaryZoomLevel(double zoom_level);
[Sync]

View file

@ -279,13 +279,6 @@ v8::Local<v8::Value> NativeImage::ToJPEG(v8::Isolate* isolate, int quality) {
std::string NativeImage::ToDataURL(gin::Arguments* args) {
float scale_factor = GetScaleFactorFromOptions(args);
if (scale_factor == 1.0f) {
// Use raw 1x PNG bytes when available
scoped_refptr<base::RefCountedMemory> png = image_.As1xPNGBytes();
if (png->size() > 0)
return webui::GetPngDataUrl(png->front(), png->size());
}
return webui::GetBitmapDataUrl(
image_.AsImageSkia().GetRepresentation(scale_factor).GetBitmap());
}

View file

@ -277,8 +277,8 @@ v8::Local<v8::Value> ElectronBindings::GetCPUUsage(
v8::Isolate* isolate) {
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
int processor_count = base::SysInfo::NumberOfProcessors();
std::optional<double> usage = metrics->GetPlatformIndependentCPUUsage();
dict.Set("percentCPUUsage", usage.value_or(0) / processor_count);
double usage = metrics->GetPlatformIndependentCPUUsage().value_or(0);
dict.Set("percentCPUUsage", usage / processor_count);
// NB: This will throw NOTIMPLEMENTED() on Windows
// For backwards compatibility, we'll return 0

View file

@ -10,6 +10,7 @@
#include <vector>
#include "base/check.h"
#include "base/containers/span.h"
#include "base/files/file.h"
#include "base/files/file_util.h"
#include "base/json/json_reader.h"
@ -214,7 +215,7 @@ bool Archive::Init() {
}
uint32_t size;
if (!base::PickleIterator(base::Pickle(buf.data(), buf.size()))
if (!base::PickleIterator(base::Pickle::WithData(base::as_byte_span(buf)))
.ReadUInt32(&size)) {
LOG(ERROR) << "Failed to parse header size from " << path_.value();
return false;
@ -231,7 +232,7 @@ bool Archive::Init() {
}
std::string header;
if (!base::PickleIterator(base::Pickle(buf.data(), buf.size()))
if (!base::PickleIterator(base::Pickle::WithData(base::as_byte_span(buf)))
.ReadString(&header)) {
LOG(ERROR) << "Failed to parse header from " << path_.value();
return false;

View file

@ -1,7 +1,7 @@
{
"action": {
"dependencies": ["manifest:action"],
"contexts": ["blessed_extension"]
"contexts": ["privileged_extension"]
},
"action.isEnabled": {
"channel": "stable"
@ -15,7 +15,7 @@
"tabs": {
"channel": "stable",
"extension_types": ["extension"],
"contexts": ["blessed_extension"]
"contexts": ["privileged_extension"]
},
"tabs.executeScript": {
"max_manifest_version": 2
@ -29,20 +29,20 @@
"extension": {
"channel": "stable",
"extension_types": ["extension"],
"contexts": ["blessed_extension"]
"contexts": ["privileged_extension"]
},
"extension.getBackgroundPage": {
"contexts": ["blessed_extension"],
"contexts": ["privileged_extension"],
"disallow_for_service_workers": true
},
"extension.getURL": {
"contexts": ["blessed_extension", "unblessed_extension", "content_script"],
"contexts": ["privileged_extension", "unprivileged_extension", "content_script"],
"max_manifest_version": 2
},
"extension.lastError": {
"contexts": [
"blessed_extension",
"unblessed_extension",
"privileged_extension",
"unprivileged_extension",
"content_script"
],
"max_manifest_version": 2
@ -50,7 +50,7 @@
"i18n": {
"channel": "stable",
"extension_types": ["extension"],
"contexts": ["blessed_extension", "unblessed_extension", "content_script"],
"contexts": ["privileged_extension", "unprivileged_extension", "content_script"],
"disallow_for_service_workers": true
},
"mimeHandlerViewGuestInternal": {
@ -61,11 +61,11 @@
},
"pdfViewerPrivate": {
"dependencies": ["permission:pdfViewerPrivate"],
"contexts": ["blessed_extension"]
"contexts": ["privileged_extension"]
},
"resourcesPrivate": [{
"dependencies": ["permission:resourcesPrivate"],
"contexts": ["blessed_extension"]
"contexts": ["privileged_extension"]
}, {
"channel": "stable",
"contexts": ["webui"],
@ -75,7 +75,7 @@
}],
"scripting": {
"dependencies": ["permission:scripting"],
"contexts": ["blessed_extension"]
"contexts": ["privileged_extension"]
},
"scripting.globalParams": {
"channel": "trunk",

View file

@ -69,7 +69,7 @@ ElectronRenderFrameObserver::ElectronRenderFrameObserver(
// In Chrome, app regions are only supported in the main frame.
// However, we need to support draggable regions on other
// local frames/windows, so extend support beyond the main frame.
render_frame_->GetWebView()->SetSupportsAppRegion(true);
render_frame_->GetWebView()->SetSupportsDraggableRegions(true);
}
void ElectronRenderFrameObserver::DidClearWindowObject() {
@ -153,25 +153,6 @@ void ElectronRenderFrameObserver::DidInstallConditionalFeatures(
}
}
void ElectronRenderFrameObserver::DraggableRegionsChanged() {
blink::WebVector<blink::WebDraggableRegion> webregions =
render_frame_->GetWebFrame()->GetDocument().DraggableRegions();
std::vector<mojom::DraggableRegionPtr> regions;
for (auto& webregion : webregions) {
auto region = mojom::DraggableRegion::New();
render_frame_->ConvertViewportToWindow(&webregion.bounds);
region->bounds = webregion.bounds;
region->draggable = webregion.draggable;
regions.push_back(std::move(region));
}
mojo::AssociatedRemote<mojom::ElectronWebContentsUtility>
web_contents_utility_remote;
render_frame_->GetRemoteAssociatedInterfaces()->GetInterface(
&web_contents_utility_remote);
web_contents_utility_remote->UpdateDraggableRegions(std::move(regions));
}
void ElectronRenderFrameObserver::WillReleaseScriptContext(
v8::Local<v8::Context> context,
int world_id) {

View file

@ -30,7 +30,6 @@ class ElectronRenderFrameObserver : public content::RenderFrameObserver {
void DidClearWindowObject() override;
void DidInstallConditionalFeatures(v8::Handle<v8::Context> context,
int world_id) override;
void DraggableRegionsChanged() override;
void WillReleaseScriptContext(v8::Local<v8::Context> context,
int world_id) override;
void OnDestruct() override;

View file

@ -1,14 +0,0 @@
// 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/renderer/extensions/electron_extensions_dispatcher_delegate.h"
ElectronExtensionsDispatcherDelegate::ElectronExtensionsDispatcherDelegate() =
default;
ElectronExtensionsDispatcherDelegate::~ElectronExtensionsDispatcherDelegate() =
default;
void ElectronExtensionsDispatcherDelegate::OnActiveExtensionsUpdated(
const std::set<std::string>& extension_ids) {}

View file

@ -1,31 +0,0 @@
// 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.
#ifndef ELECTRON_SHELL_RENDERER_EXTENSIONS_ELECTRON_EXTENSIONS_DISPATCHER_DELEGATE_H_
#define ELECTRON_SHELL_RENDERER_EXTENSIONS_ELECTRON_EXTENSIONS_DISPATCHER_DELEGATE_H_
#include <set>
#include <string>
#include "extensions/renderer/dispatcher_delegate.h"
class ElectronExtensionsDispatcherDelegate
: public extensions::DispatcherDelegate {
public:
ElectronExtensionsDispatcherDelegate();
~ElectronExtensionsDispatcherDelegate() override;
// disable copy
ElectronExtensionsDispatcherDelegate(
const ElectronExtensionsDispatcherDelegate&) = delete;
ElectronExtensionsDispatcherDelegate& operator=(
const ElectronExtensionsDispatcherDelegate&) = delete;
private:
// extensions::DispatcherDelegate implementation.
void OnActiveExtensionsUpdated(
const std::set<std::string>& extension_ids) override;
};
#endif // ELECTRON_SHELL_RENDERER_EXTENSIONS_ELECTRON_EXTENSIONS_DISPATCHER_DELEGATE_H_

View file

@ -11,16 +11,14 @@
#include "extensions/common/manifest_handlers/background_info.h"
#include "extensions/renderer/dispatcher.h"
#include "shell/common/world_ids.h"
#include "shell/renderer/extensions/electron_extensions_dispatcher_delegate.h"
namespace electron {
ElectronExtensionsRendererClient::ElectronExtensionsRendererClient() {}
void ElectronExtensionsRendererClient::RenderThreadStarted() {
dispatcher_ = std::make_unique<extensions::Dispatcher>(
std::make_unique<ElectronExtensionsDispatcherDelegate>(),
std::move(api_providers_));
dispatcher_ =
std::make_unique<extensions::Dispatcher>(std::move(api_providers_));
dispatcher_->OnRenderThreadStarted(content::RenderThread::Get());
}

View file

@ -12,7 +12,7 @@
#include "third_party/blink/public/web/web_local_frame.h"
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
#include "chrome/common/pdf_util.h"
#include "components/pdf/common/pdf_util.h"
#include "extensions/common/constants.h"
#include "extensions/renderer/guest_view/mime_handler_view/post_message_support.h"
#endif // BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)

View file

@ -20,6 +20,7 @@
#include "content/public/renderer/render_thread.h"
#include "electron/buildflags/buildflags.h"
#include "electron/fuses.h"
#include "media/base/key_systems_support_registration.h"
#include "printing/buildflags/buildflags.h"
#include "shell/browser/api/electron_api_protocol.h"
#include "shell/common/api/electron_api_native_image.h"
@ -68,8 +69,8 @@
#endif
#if BUILDFLAG(ENABLE_PDF_VIEWER)
#include "chrome/common/pdf_util.h"
#include "components/pdf/common/constants.h"
#include "components/pdf/common/pdf_util.h"
#include "components/pdf/renderer/pdf_internal_plugin_delegate.h"
#include "shell/common/electron_constants.h"
#endif // BUILDFLAG(ENABLE_PDF_VIEWER)
@ -405,16 +406,6 @@ bool RendererClientBase::OverrideCreatePlugin(
return true;
}
std::unique_ptr<media::KeySystemSupportObserver>
RendererClientBase::GetSupportedKeySystems(media::GetSupportedKeySystemsCB cb) {
#if BUILDFLAG(ENABLE_WIDEVINE)
GetChromeKeySystems(std::move(cb));
#else
std::move(cb).Run({});
#endif
return nullptr;
}
void RendererClientBase::DidSetUserAgent(const std::string& user_agent) {
#if BUILDFLAG(ENABLE_PRINTING)
printing::SetAgent(user_agent);

View file

@ -10,6 +10,7 @@
#include "content/public/renderer/content_renderer_client.h"
#include "electron/buildflags/buildflags.h"
#include "media/base/key_systems_support_registration.h"
#include "printing/buildflags/buildflags.h"
#include "shell/common/gin_helper/dictionary.h"
// In SHARED_INTERMEDIATE_DIR.
@ -102,8 +103,6 @@ class RendererClientBase : public content::ContentRendererClient
bool OverrideCreatePlugin(content::RenderFrame* render_frame,
const blink::WebPluginParams& params,
blink::WebPlugin** plugin) override;
std::unique_ptr<media::KeySystemSupportObserver> GetSupportedKeySystems(
media::GetSupportedKeySystemsCB cb) override;
void DidSetUserAgent(const std::string& user_agent) override;
bool IsPluginHandledExternally(content::RenderFrame* render_frame,
const blink::WebElement& plugin_element,