chore: bump chromium to 117.0.5892.0 (main) (#39118)

* chore: bump chromium in DEPS to 117.0.5892.0

* 4670267: Don't send javascript: or empty URLs to browser in CreateNewWindow.

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

* 4662090: Add metrics for WebGPU support

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

* 4672599: Use set_defaults for mac_app_bundle

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

* 4663771: usb: Add connection count tracking methods for UsbDelegate

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

* 4664578: Remove unused parameter from ExtensionsGuestViewManagerDelegate ctor

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

* 4622253: usb: Create classes for usb system tray icon

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

* 4678263: Remove ARC support from scoped_nsobject

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

* chore: follow-up ARC changes and missing guard corrections

* chore: don't mark 0-param ctor explicit

Follow up to https://chromium-review.googlesource.com/c/chromium/src/+/4664578

* chore: fixup patch indices

* 4670865: Merge ObjectProxy::CallMethodAndBlock{,WithErrorDetails}.

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

* chore: follow-up ARC changes and missing guard corrections

* fixup: retain ElectronApplicationDelegate

* fix: correct rustc binary

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
electron-roller[bot] 2023-07-19 00:26:27 +02:00 committed by GitHub
parent ee4460ac68
commit bbdd037219
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
77 changed files with 389 additions and 353 deletions

View file

@ -526,6 +526,10 @@ step-fix-sync: &step-fix-sync
sed -i '' "s/Updating depot_tools... //g" esbuild_ensure_file
cipd ensure --root src/third_party/devtools-frontend/src/third_party/esbuild -ensure-file esbuild_ensure_file
# Fix rustc (wrong binary)
rm -rf src/third_party/rust-toolchain
python3 src/tools/rust/update_rust.py
# Fix gn (wrong binary)
echo 'gn/gn/mac-${arch}' `gclient getdep --deps-file=src/DEPS -r 'src/buildtools/mac:gn/gn/mac-${arch}'` > gn_ensure_file
# Remove extra output from calling gclient getdep which always calls update_depot_tools

View file

@ -746,9 +746,18 @@ source_set("electron_lib") {
if (is_mac) {
source_set("electron_lib_arc") {
public_configs = [ ":branding" ]
include_dirs = [ "." ]
sources = [
"shell/app/electron_main_delegate_mac.h",
"shell/app/electron_main_delegate_mac.mm",
"shell/browser/api/electron_api_menu_mac.h",
"shell/browser/api/electron_api_menu_mac.mm",
"shell/browser/api/electron_api_native_theme_mac.mm",
"shell/browser/api/electron_api_push_notifications_mac.mm",
"shell/browser/api/electron_api_system_preferences_mac.mm",
"shell/browser/browser_mac.mm",
"shell/browser/electron_browser_main_parts_mac.mm",
"shell/browser/mac/dict_util.h",
"shell/browser/mac/dict_util.mm",
"shell/browser/mac/electron_application.h",
@ -757,8 +766,21 @@ if (is_mac) {
"shell/browser/mac/electron_application_delegate.mm",
"shell/browser/native_window_mac.h",
"shell/browser/native_window_mac.mm",
"shell/browser/ui/cocoa/delayed_native_view_host.h",
"shell/browser/ui/cocoa/delayed_native_view_host.mm",
"shell/browser/ui/cocoa/electron_inspectable_web_contents_view.h",
"shell/browser/ui/cocoa/electron_inspectable_web_contents_view.mm",
"shell/browser/ui/cocoa/electron_menu_controller.mm",
"shell/browser/ui/cocoa/electron_ns_window.h",
"shell/browser/ui/cocoa/electron_ns_window.mm",
"shell/browser/ui/cocoa/electron_ns_window_delegate.h",
"shell/browser/ui/cocoa/electron_ns_window_delegate.mm",
"shell/browser/ui/cocoa/electron_touch_bar.h",
"shell/browser/ui/cocoa/electron_touch_bar.mm",
"shell/browser/ui/inspectable_web_contents_view_mac.h",
"shell/browser/ui/inspectable_web_contents_view_mac.mm",
"shell/browser/ui/tray_icon_cocoa.h",
"shell/browser/ui/tray_icon_cocoa.mm",
]
deps = [
@ -947,7 +969,7 @@ if (is_mac) {
deps += [ "//sandbox/mac:seatbelt" ]
}
defines = [ "HELPER_EXECUTABLE" ]
extra_configs = [ "//electron/build/config:mas_build" ]
configs += [ "//electron/build/config:mas_build" ]
sources = [
"shell/app/electron_main_mac.cc",
"shell/app/uv_stdio_fix.cc",
@ -1118,7 +1140,7 @@ if (is_mac) {
"-rpath",
"@executable_path/../Frameworks",
]
extra_configs = [ "//electron/build/config:mas_build" ]
configs += [ "//electron/build/config:mas_build" ]
}
if (enable_dsyms) {

2
DEPS
View file

@ -2,7 +2,7 @@ gclient_gn_args_from = 'src'
vars = {
'chromium_version':
'117.0.5884.1',
'117.0.5892.0',
'node_version':
'v18.16.1',
'nan_version':

View file

@ -116,18 +116,10 @@ filenames = {
]
lib_sources_mac = [
"shell/app/electron_main_delegate_mac.h",
"shell/app/electron_main_delegate_mac.mm",
"shell/browser/api/electron_api_app_mac.mm",
"shell/browser/api/electron_api_menu_mac.h",
"shell/browser/api/electron_api_menu_mac.mm",
"shell/browser/api/electron_api_native_theme_mac.mm",
"shell/browser/api/electron_api_power_monitor_mac.mm",
"shell/browser/api/electron_api_push_notifications_mac.mm",
"shell/browser/api/electron_api_system_preferences_mac.mm",
"shell/browser/api/electron_api_web_contents_mac.mm",
"shell/browser/auto_updater_mac.mm",
"shell/browser/electron_browser_main_parts_mac.mm",
"shell/browser/mac/in_app_purchase_observer.h",
"shell/browser/mac/in_app_purchase_observer.mm",
"shell/browser/mac/in_app_purchase_product.h",
@ -146,24 +138,15 @@ filenames = {
"shell/browser/osr/osr_web_contents_view_mac.mm",
"shell/browser/relauncher_mac.cc",
"shell/browser/ui/certificate_trust_mac.mm",
"shell/browser/ui/cocoa/delayed_native_view_host.mm",
"shell/browser/ui/cocoa/delayed_native_view_host.h",
"shell/browser/ui/cocoa/electron_bundle_mover.h",
"shell/browser/ui/cocoa/electron_bundle_mover.mm",
"shell/browser/ui/cocoa/electron_inspectable_web_contents_view.h",
"shell/browser/ui/cocoa/electron_inspectable_web_contents_view.mm",
"shell/browser/ui/cocoa/electron_menu_controller.h",
"shell/browser/ui/cocoa/electron_menu_controller.mm",
"shell/browser/ui/cocoa/electron_native_widget_mac.h",
"shell/browser/ui/cocoa/electron_native_widget_mac.mm",
"shell/browser/ui/cocoa/electron_ns_panel.h",
"shell/browser/ui/cocoa/electron_ns_panel.mm",
"shell/browser/ui/cocoa/electron_ns_window.h",
"shell/browser/ui/cocoa/electron_ns_window.mm",
"shell/browser/ui/cocoa/electron_preview_item.h",
"shell/browser/ui/cocoa/electron_preview_item.mm",
"shell/browser/ui/cocoa/electron_touch_bar.h",
"shell/browser/ui/cocoa/electron_touch_bar.mm",
"shell/browser/ui/cocoa/event_dispatching_window.h",
"shell/browser/ui/cocoa/event_dispatching_window.mm",
"shell/browser/ui/cocoa/NSString+ANSI.h",
@ -176,11 +159,7 @@ filenames = {
"shell/browser/ui/cocoa/window_buttons_proxy.mm",
"shell/browser/ui/drag_util_mac.mm",
"shell/browser/ui/file_dialog_mac.mm",
"shell/browser/ui/inspectable_web_contents_view_mac.h",
"shell/browser/ui/inspectable_web_contents_view_mac.mm",
"shell/browser/ui/message_box_mac.mm",
"shell/browser/ui/tray_icon_cocoa.h",
"shell/browser/ui/tray_icon_cocoa.mm",
"shell/common/api/electron_api_clipboard_mac.mm",
"shell/common/api/electron_api_native_image_mac.mm",
"shell/common/asar/archive_mac.mm",

View file

@ -20,7 +20,7 @@ index 2ca14efae5ea478f43794a81883b00dfdb1a37b0..d73055fbf39334925ef4b4804bbaca57
case ssl_open_record_error:
diff --git a/ssl/ssl_lib.cc b/ssl/ssl_lib.cc
index d7b5be3ddeec762a3353baefc67d659c9aba68f5..82bf00311b36bdbc948ae14f808c78fd2f71ca54 100644
index 26ffd5036cb9b15b741d20d83fc9143f1bb4e835..5446aecd69a7bac07f8f9d9d8c88e3ae881ac830 100644
--- a/ssl/ssl_lib.cc
+++ b/ssl/ssl_lib.cc
@@ -1333,7 +1333,7 @@ int SSL_get_error(const SSL *ssl, int ret_code) {

View file

@ -23,10 +23,10 @@ index 103a9d9fb17e954ecaf0acecaa3eeafc23e39c94..de299316216dba204decba3b0eb57f5c
int32_t world_id) {}
virtual void DidClearWindowObject() {}
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 84a3c22188a4dd94b9bd348f0be4a7bf532c46ba..deac08ba0dbd74c8bb6485b91447610e3c9f029a 100644
index 49d960da588af130304df1b45dda6dc05f58d966..a7d6bd40c52ae4e010fbfa846da6f8b785dedd1a 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -4477,6 +4477,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
@@ -4474,6 +4474,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
observer.DidCreateScriptContext(context, world_id);
}

View file

@ -7,7 +7,7 @@ Ensure that licenses for the dependencies introduced by Electron
are included in `LICENSES.chromium.html`
diff --git a/tools/licenses/licenses.py b/tools/licenses/licenses.py
index dfb1bda193c8fae8aa21ef80a567628937365b9e..95159ef629d08256a6acc891e7df57f6631468be 100755
index c728df1b5421b749af10a076fdbd8ffe691114b9..51c538ad91482f2b164016e2de8946aba2bb6ac9 100755
--- a/tools/licenses/licenses.py
+++ b/tools/licenses/licenses.py
@@ -424,6 +424,31 @@ SPECIAL_CASES = {

View file

@ -49,7 +49,7 @@ index 22c4d4e9718a503d9c7ca26a40c97149b0f8986a..6bdc2757c96a28022fda9e6f5e3b74a0
// its owning reference back to our owning LocalFrame.
client_->Detached(type);
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
index 3c3f6f7f920eb990de6a143807c520478ac9e842..3db87d746c1be999509e0cbabae6071878471b23 100644
index 6e278ba2097021dcdf0ac9cd4d39b108929c79c6..59ed3c0fcc335ce418484f537886a5ded7835418 100644
--- a/third_party/blink/renderer/core/frame/local_frame.cc
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
@@ -665,10 +665,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {

View file

@ -6,7 +6,7 @@ Subject: boringssl BUILD.gn
Build BoringSSL with some extra functions that nodejs needs.
diff --git a/third_party/boringssl/BUILD.gn b/third_party/boringssl/BUILD.gn
index 1aeccd473017be4f810317366d10402adeb6057c..9aba852521acd70c5bfbfaa559e2b409bc0c0068 100644
index eb2393eb9a6459a2d7dfdcfe6379817be3139074..ef99c6bc6c1cd16cc8ef1bd88da55bf6961f31fd 100644
--- a/third_party/boringssl/BUILD.gn
+++ b/third_party/boringssl/BUILD.gn
@@ -49,6 +49,20 @@ config("no_asm_config") {

View file

@ -11,7 +11,7 @@ if we ever align our .pak file generation with Chrome we can remove this
patch.
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
index bfb799ebe63f9134604c1343a215405d0dff0cca..4d5d3b4876cab294d4347ffcf0c877811fa9aead 100644
index 9cb1abe75f29fbd1510968c1e571583563d18c29..a58a36e75951c3ef366bebc11b80c6533144b2f5 100644
--- a/chrome/BUILD.gn
+++ b/chrome/BUILD.gn
@@ -202,11 +202,16 @@ if (!is_android && !is_mac) {
@ -33,10 +33,10 @@ index bfb799ebe63f9134604c1343a215405d0dff0cca..4d5d3b4876cab294d4347ffcf0c87781
"//base",
"//build:branding_buildflags",
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index a21ac39e8ad1f9c4d6dbc25e3ab3a077ce439920..ccdbcf77d4c6347099721af5106a7372e35e6779 100644
index 0a8b24bef7024a19d9eae065721f8f9dc6c53534..1e82e0dc7a55094b41c283c5a76d426484e7384e 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -4635,7 +4635,7 @@ static_library("browser") {
@@ -4644,7 +4644,7 @@ static_library("browser") {
# On Windows, the hashes are embedded in //chrome:chrome_initial rather
# than here in :chrome_dll.
@ -46,10 +46,10 @@ index a21ac39e8ad1f9c4d6dbc25e3ab3a077ce439920..ccdbcf77d4c6347099721af5106a7372
sources += [ "certificate_viewer_stub.cc" ]
}
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
index a0568bdcc5b1722ceab811fea4b85788e202ce75..f640077ed4cfba57680647fd29ddf7f9004e49cf 100644
index 6f21c7183d174da59a83efda0dfc1365c3b01b70..2e9b21f56cdec301a42faf886920f7062435fffc 100644
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -6645,7 +6645,6 @@ test("unit_tests") {
@@ -6652,7 +6652,6 @@ test("unit_tests") {
deps += [
"//chrome:other_version",
@ -57,7 +57,7 @@ index a0568bdcc5b1722ceab811fea4b85788e202ce75..f640077ed4cfba57680647fd29ddf7f9
"//chrome//services/util_win:unit_tests",
"//chrome/app:chrome_dll_resources",
"//chrome/app:win_unit_tests",
@@ -6671,6 +6670,10 @@ test("unit_tests") {
@@ -6678,6 +6677,10 @@ test("unit_tests") {
"//ui/resources",
]
@ -68,7 +68,7 @@ index a0568bdcc5b1722ceab811fea4b85788e202ce75..f640077ed4cfba57680647fd29ddf7f9
ldflags = [
"/DELAYLOAD:api-ms-win-core-winrt-error-l1-1-0.dll",
"/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll",
@@ -7612,7 +7615,6 @@ test("unit_tests") {
@@ -7628,7 +7631,6 @@ test("unit_tests") {
}
deps += [
@ -76,7 +76,7 @@ index a0568bdcc5b1722ceab811fea4b85788e202ce75..f640077ed4cfba57680647fd29ddf7f9
"//chrome/browser/apps:icon_standardizer",
"//chrome/browser/apps/app_service",
"//chrome/browser/apps/app_service:test_support",
@@ -7698,6 +7700,10 @@ test("unit_tests") {
@@ -7714,6 +7716,10 @@ test("unit_tests") {
"//ui/webui/resources/js/browser_command:mojo_bindings",
]

View file

@ -6,10 +6,10 @@ Subject: build: only use the mas build config in the required components
Before landing this patch should be split into the relevant MAS patches, or at least the patch this one partially reverts
diff --git a/base/BUILD.gn b/base/BUILD.gn
index eb9bc951061a48d25e4b87c8ba2c1740163f2a6c..042b9aa295c78246c907b560ba0401431230123d 100644
index aa7f2d6b3f2ff416ea42e320c6813c45ab38049d..9509ae4fb685a5b2257f34500918fbe777e2dc9b 100644
--- a/base/BUILD.gn
+++ b/base/BUILD.gn
@@ -1031,6 +1031,7 @@ component("base") {
@@ -1029,6 +1029,7 @@ component("base") {
"//build/config/compiler:prevent_unsafe_narrowing",
"//build/config/compiler:wexit_time_destructors",
"//build/config/compiler:wglobal_constructors",
@ -55,7 +55,7 @@ index c52c741205d140fbe8b3be02974c89ea22c2365f..9460c656f71e24044ffccc55053a04b8
"alert.h",
"alert.mm",
diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn
index ebc723289104f2d6e0684586214cfeb7a64aeb69..2b708fe7ba36755f93816f8d19801bb06484e8c7 100644
index fa72a9170a7e41ae475b05653be99af59d4eaebb..b5c39b57a61a6595b842c52da8489bdbf2420b2c 100644
--- a/components/viz/service/BUILD.gn
+++ b/components/viz/service/BUILD.gn
@@ -332,6 +332,7 @@ viz_component("service") {
@ -66,7 +66,7 @@ index ebc723289104f2d6e0684586214cfeb7a64aeb69..2b708fe7ba36755f93816f8d19801bb0
}
if (is_android || use_ozone) {
@@ -589,6 +590,8 @@ viz_source_set("unit_tests") {
@@ -590,6 +591,8 @@ viz_source_set("unit_tests") {
]
configs += [ "//build/config/compiler:enable_arc" ]
frameworks = [ "IOSurface.framework" ]
@ -76,7 +76,7 @@ index ebc723289104f2d6e0684586214cfeb7a64aeb69..2b708fe7ba36755f93816f8d19801bb0
if (is_win) {
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
index 9f8f97981311eb58ccc57118fdab978b080f34b6..cb0361c3ab6fed0b397909210692bfe4dec4cc96 100644
index 798498992ae1e8003ed3d9b4ba3b22e31410a065..ddec233997c6449d964604bb3746ac37074a4cb9 100644
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -56,6 +56,7 @@ source_set("browser") {
@ -112,7 +112,7 @@ index 65714a5dca013794527640645d8eb2ce36049ac6..b2df50b4cd64816ddf9c5b7e222c47b6
public_deps = [
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn
index 3ae0f5f3a941a4edfb73c9d1b6ebf87c6ec2cc62..136b36295e669f423a6539a444b4de42c26c81cb 100644
index da5183c7ed3eb6219e9d79202ac2e1883a48abdc..78ebaf890b3f1bb7e470573c875a751dedf37f31 100644
--- a/content/test/BUILD.gn
+++ b/content/test/BUILD.gn
@@ -475,6 +475,7 @@ static_library("test_support") {
@ -214,7 +214,7 @@ index 5e9fc18352d1bf0939f8366d2282b49aeb307994..69dcc2cafa27b3d8bdf3fe8d0a22a980
source_set("sandbox_unittests") {
diff --git a/third_party/blink/renderer/core/BUILD.gn b/third_party/blink/renderer/core/BUILD.gn
index 670903698c899df678a16218d8c373d94a7f2b9e..15c0c7125434c13c5a4b8c74dee937f542cc16fd 100644
index 410f09c7b8a50c515eed664f31a54d6aa2d9de26..19517bf957637129c98923c0939e1737561fa42f 100644
--- a/third_party/blink/renderer/core/BUILD.gn
+++ b/third_party/blink/renderer/core/BUILD.gn
@@ -308,6 +308,7 @@ component("core") {
@ -263,7 +263,7 @@ index 7d0a002dba31c5e5bdc4bbec0ef396280f0f3d89..fe61909e6228b8c2f982035ef2ccee2b
if (is_apple) {
diff --git a/ui/display/BUILD.gn b/ui/display/BUILD.gn
index 11ff80e18ea42b290f96a90fecb9cfbc0f78a51c..6a01260f2ad2e9e8c05a4a44613bdf2a75c2a8ea 100644
index e37e8a6f980a9eb522eea2191be2691d49a9638d..8fcfcfdec68e0c591abd58dbde957d2dbccf491f 100644
--- a/ui/display/BUILD.gn
+++ b/ui/display/BUILD.gn
@@ -67,6 +67,10 @@ component("display") {
@ -290,7 +290,7 @@ index e66e2339ea3cb8b2b80ef3f0b09dcc53a2240339..07e11afb172ecbb24c04f25f87c11bdc
if (is_win) {
sources += [
diff --git a/ui/views/BUILD.gn b/ui/views/BUILD.gn
index a7d46bc8bbf09db6d96a2139850ca940a79ea4b5..a1579cb5aef391480d511ad1541302c19cde0e65 100644
index 30642c59d4ab84cbe6cc82e6b5b645cdacc07418..ca2e4c1b9064132fa9612339106d3729d79bf3cf 100644
--- a/ui/views/BUILD.gn
+++ b/ui/views/BUILD.gn
@@ -686,6 +686,7 @@ component("views") {
@ -301,7 +301,7 @@ index a7d46bc8bbf09db6d96a2139850ca940a79ea4b5..a1579cb5aef391480d511ad1541302c1
}
if (is_win) {
@@ -1102,6 +1103,8 @@ source_set("test_support") {
@@ -1103,6 +1104,8 @@ source_set("test_support") {
"//testing/gtest",
]

View file

@ -9,10 +9,10 @@ potentially prevent a window from being created.
TODO(loc): this patch is currently broken.
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
index ce2480803d2fcacedc93e11dd61457d2fca30ed4..99fb67d9d2e9c0018fef2df765de1d8546bbb93d 100644
index 12ab6ff09dd01ec248ab8432bfa3776f2ef06250..10a27d219eb7ae960b4ef79a99d4da483a411fe7 100644
--- a/content/browser/renderer_host/render_frame_host_impl.cc
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -8000,6 +8000,7 @@ void RenderFrameHostImpl::CreateNewWindow(
@@ -8002,6 +8002,7 @@ void RenderFrameHostImpl::CreateNewWindow(
last_committed_origin_, params->window_container_type,
params->target_url, params->referrer.To<Referrer>(),
params->frame_name, params->disposition, *params->features,
@ -21,10 +21,10 @@ index ce2480803d2fcacedc93e11dd61457d2fca30ed4..99fb67d9d2e9c0018fef2df765de1d85
&no_javascript_access);
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 9c371b7c539fc3ce703215d84588fdaafe2bb102..2b888be4850f4fad3bb9c43102dbb4da57227208 100644
index 3c66272f910296e8958f38513aa5a800260fbeb1..dc9ad3e374bf842ceeb864356380c56daea62906 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4257,6 +4257,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -4256,6 +4256,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
auto* new_contents_impl = new_contents.get();
@ -37,7 +37,7 @@ index 9c371b7c539fc3ce703215d84588fdaafe2bb102..2b888be4850f4fad3bb9c43102dbb4da
// If the new frame has a name, make sure any SiteInstances that can find
// this named frame have proxies for it. Must be called after
// SetSessionStorageNamespace, since this calls CreateRenderView, which uses
@@ -4298,12 +4304,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -4297,12 +4303,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
AddWebContentsDestructionObserver(new_contents_impl);
}
@ -148,12 +148,12 @@ index c5bda327264c330345baf7b44b4ba5c478e58952..989778079d5dc91127989e43f3ce6b25
// typically happens when popups are created.
virtual void WebContentsCreated(WebContents* source_contents,
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index b992054d64fd8acc8bbc8433726a8d1016365aa3..84a3c22188a4dd94b9bd348f0be4a7bf532c46ba 100644
index 98668c5adb4a16ef77ed6a8a718430310ed8aea4..49d960da588af130304df1b45dda6dc05f58d966 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -6355,6 +6355,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
blink::GetNavigationInitiatorActivationAndAdStatus(
request.HasUserGesture(), GetWebFrame()->IsAdScriptInStack());
@@ -6371,6 +6371,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
request.HasUserGesture(), GetWebFrame()->IsAdFrame(),
GetWebFrame()->IsAdScriptInStack());
+ params->raw_features = features.raw_features.Utf8(
+ WTF::UTF8ConversionMode::kStrictUTF8ConversionReplacingUnpairedSurrogatesWithFFFD);
@ -210,7 +210,7 @@ index bef5a989bac50c177f15f52fe87ac3790d553e85..65dcd2e3b51929400c8bfb6a98a4fb59
} // namespace blink
diff --git a/third_party/blink/renderer/core/frame/local_dom_window.cc b/third_party/blink/renderer/core/frame/local_dom_window.cc
index 674d053ca30dfd4e4979e9378a5c67f3b56a407a..9996267c84bd44ea4e6abd807736b73d0a13b2fc 100644
index 22a139de0e2eab33b9e2f3e95bf5156493bf2be9..fdf1196fdaabdeebfcfe1095d139e1643c2a8cff 100644
--- a/third_party/blink/renderer/core/frame/local_dom_window.cc
+++ b/third_party/blink/renderer/core/frame/local_dom_window.cc
@@ -2192,6 +2192,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,

View file

@ -34,7 +34,7 @@ index 2e4bacce52a45b5d9d7829c1f88f82aa0bb1b4bb..f3537e89191bd2c6d9b06c9b741a1680
Widget* GetWidget();
const Widget* GetWidget() const;
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 68953ca1a30ef5a497e6e4708f9e6891d4511e6e..24b6bb99bd477eeb7ed2e672df3327dcd3ea5d7b 100644
index 1676180ba1d1535b3cfb34f91c90da37a22f2334..1b35fd35d54aee39c486be83a6d30e922cf06325 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -3246,15 +3246,19 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,

View file

@ -218,10 +218,10 @@ index 4e32d708ecf4afd3913d86ec1602ef2dc9a60998..1dd2f50fba1387b5eeb554dd540957d7
void AddNewContents(content::WebContents* source,
std::unique_ptr<content::WebContents> new_contents,
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 4893c65e3046b393532bbd2f372c4321a6e87560..a974151f5880e1a78d5cde849b637e2d512a3d78 100644
index caedd4d4e657bf49e9b0b76fce7bf7adfea1bb7b..a96bc70457ab3bb7339361ab82e5643382fd364f 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4164,8 +4164,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -4163,8 +4163,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
if (delegate_ && delegate_->IsWebContentsCreationOverridden(
source_site_instance, params.window_container_type,
@ -260,10 +260,10 @@ index 989778079d5dc91127989e43f3ce6b25a9df56d4..71b5a7c30f6546e3172ea31f9b0572c0
// Allow delegate to creates a custom WebContents when
// WebContents::CreateNewWindow() is called. This function is only called
diff --git a/extensions/browser/guest_view/extension_options/extension_options_guest.cc b/extensions/browser/guest_view/extension_options/extension_options_guest.cc
index 5579bd54453d9dd2c15b949dee9f6ddf3e5ec67b..459c15913c91b9a77c8ffaa30445dff7a0d9751b 100644
index b6413e636b411a525a27bef0ec1dd68a6f06c2b4..55e458137786a722bd07e203c572438ad41fce2d 100644
--- a/extensions/browser/guest_view/extension_options/extension_options_guest.cc
+++ b/extensions/browser/guest_view/extension_options/extension_options_guest.cc
@@ -206,8 +206,7 @@ bool ExtensionOptionsGuest::IsWebContentsCreationOverridden(
@@ -207,8 +207,7 @@ bool ExtensionOptionsGuest::IsWebContentsCreationOverridden(
content::SiteInstance* source_site_instance,
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,
@ -274,7 +274,7 @@ index 5579bd54453d9dd2c15b949dee9f6ddf3e5ec67b..459c15913c91b9a77c8ffaa30445dff7
// view is used for displaying embedded extension options, we want any
// external links to be opened in a new tab, not in a new guest view so we
diff --git a/extensions/browser/guest_view/extension_options/extension_options_guest.h b/extensions/browser/guest_view/extension_options/extension_options_guest.h
index 675780388e55aaabcb099f795e7e388f7105e56c..fd876690186533cde2fde6a08a5a8916f44833b4 100644
index 583da1abe9cb405dc02806564b99a4619fc81473..8131afeee37a60ae3b10731bc708efd99114838c 100644
--- a/extensions/browser/guest_view/extension_options/extension_options_guest.h
+++ b/extensions/browser/guest_view/extension_options/extension_options_guest.h
@@ -61,8 +61,7 @@ class ExtensionOptionsGuest
@ -288,10 +288,10 @@ index 675780388e55aaabcb099f795e7e388f7105e56c..fd876690186533cde2fde6a08a5a8916
content::RenderFrameHost* opener,
content::SiteInstance* source_site_instance,
diff --git a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
index 44d0b99677a74cd57c5f2d0462b0983812726083..72d66188452b8b5cb56b08475c6d94d84ea5c4c1 100644
index 1e1712fdf38ecbd41f998896cca98db14448fa18..d2cd1003c224f49338595dc91fe9cd05a4549f4a 100644
--- a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
+++ b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
@@ -404,8 +404,7 @@ bool MimeHandlerViewGuest::IsWebContentsCreationOverridden(
@@ -380,8 +380,7 @@ bool MimeHandlerViewGuest::IsWebContentsCreationOverridden(
content::SiteInstance* source_site_instance,
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,
@ -302,10 +302,10 @@ index 44d0b99677a74cd57c5f2d0462b0983812726083..72d66188452b8b5cb56b08475c6d94d8
}
diff --git a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h
index 2ade4d0b28ba4c7179886c740952e963f828888e..b5e70e7e52df862a64baa8e3ca7e59020ac35871 100644
index 397bee1fc011be7d949f62c50f6acfb05c7251e1..165026320324c3295b7152731d19efd65fd90b07 100644
--- a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h
+++ b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h
@@ -175,8 +175,7 @@ class MimeHandlerViewGuest
@@ -172,8 +172,7 @@ class MimeHandlerViewGuest
content::SiteInstance* source_site_instance,
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,

View file

@ -20,7 +20,7 @@ to deal with color spaces. That is being tracked at
https://crbug.com/634542 and https://crbug.com/711107.
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 394d0a39a6c86c68c868eeca0e0d9a4108e1dafc..a1b91f3ce3e28cb7afc7bae7a3eef0fdc5b6f292 100644
index 8d253544e97c8bf7767ce51dda44593cea118e34..523d58c083458143c2eab5abd0e81251cd99bdc5 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1867,6 +1867,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw(
@ -93,10 +93,10 @@ index 7891c0d116ef4e9b080746698be0c71b6f9a8595..e5a2ac168bf1fdbfc2c0c64f5c8b03ef
sandbox::policy::switches::kGpuSandboxAllowSysVShm,
sandbox::policy::switches::kGpuSandboxFailuresFatal,
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 37fdd04d9738c699db8c9140600f90e8523de93e..945ba0d61888d8c9f4eb139246150c4fd180e5ab 100644
index 0227d69ec2afe04ff4c4d8d9e6a20bda2daad71b..3717d48210dcaa3a995f0a4e287666d4173e518a 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -3527,6 +3527,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
@@ -3537,6 +3537,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
// Propagate the following switches to the renderer command line (along
// with any associated values) if present in the browser command line.
static const char* const kSwitchNames[] = {

View file

@ -19,7 +19,7 @@ index 53c1d25e3f56daa9d7929089620c9df7971ceda6..d90c652d7c572686bf54c4d282960ea4
excluded_margin);
}
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index a1bd556e733fa7984effd2a43c810e3ebb6dc7da..f382e6eec48440eefb9a91642792cbf21a504275 100644
index bb3e9c6759cef48ac2993145d5993cbc7e640805..642945e5f30942088189c3085d9efe16d774999e 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -1154,8 +1154,11 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen,

View file

@ -10,7 +10,7 @@ get this standardised, but in lieu of that, this makes MessagePort a
whole bunch more useful!
diff --git a/third_party/blink/renderer/core/messaging/message_port.cc b/third_party/blink/renderer/core/messaging/message_port.cc
index 515143a8408ff29e39f556a32439738b1f38a1a6..1f3b1e84ffa3fa874118b69652c6faf1253dda12 100644
index 109ca611fedb6acce1142b2087ec3c4d6cbbfbf0..cf683459c3bb67df027d8b28cd471214b89fbda6 100644
--- a/third_party/blink/renderer/core/messaging/message_port.cc
+++ b/third_party/blink/renderer/core/messaging/message_port.cc
@@ -175,6 +175,7 @@ void MessagePort::close() {
@ -22,10 +22,10 @@ index 515143a8408ff29e39f556a32439738b1f38a1a6..1f3b1e84ffa3fa874118b69652c6faf1
void MessagePort::Entangle(MessagePortDescriptor port) {
diff --git a/third_party/blink/renderer/core/messaging/message_port.h b/third_party/blink/renderer/core/messaging/message_port.h
index 30d13d1e47e3acc7df6ce5c627fd7b3a32c3edc4..f9baba3c6d13992508da48a13c97bb10c8ec56e0 100644
index 3055b625e7474f94aaddcf5500b4db07bd59a428..cc6b29749a9cf5ddd71aa4163078dce8989bd3bf 100644
--- a/third_party/blink/renderer/core/messaging/message_port.h
+++ b/third_party/blink/renderer/core/messaging/message_port.h
@@ -120,6 +120,13 @@ class CORE_EXPORT MessagePort : public EventTargetWithInlineData,
@@ -120,6 +120,13 @@ class CORE_EXPORT MessagePort : public EventTarget,
return GetAttributeEventListener(event_type_names::kMessageerror);
}

View file

@ -183,7 +183,7 @@ index 01e62d7e8df65efb900e9cd0d34bcd8e0ed3e7da..9af6784707f125046d9a734165fc2b08
host->GetChildProcess()->BindServiceInterface(std::move(receiver));
}
diff --git a/content/browser/utility_process_host.cc b/content/browser/utility_process_host.cc
index 5aa0119ef7cc8d47e978566db56567fc2843797f..fc211d8e7341078b47bf4d1c54ef2c42fb71d32e 100644
index 8a132fc9721ca1145249e0ccfaf019c3babf2739..411662674b0ad47e273957aacc80ddcafe0e84ab 100644
--- a/content/browser/utility_process_host.cc
+++ b/content/browser/utility_process_host.cc
@@ -156,11 +156,13 @@ const ChildProcessData& UtilityProcessHost::GetData() {
@ -227,7 +227,7 @@ index 5aa0119ef7cc8d47e978566db56567fc2843797f..fc211d8e7341078b47bf4d1c54ef2c42
mojom::ChildProcess* UtilityProcessHost::GetChildProcess() {
return static_cast<ChildProcessHostImpl*>(process_->GetHost())
->child_process();
@@ -444,9 +464,22 @@ bool UtilityProcessHost::StartProcess() {
@@ -445,9 +465,22 @@ bool UtilityProcessHost::StartProcess() {
}
#endif // BUILDFLAG(IS_LINUX)

View file

@ -87,7 +87,7 @@ index 8af69cac78b7488d28f1f05ccb174793fe5148cd..9f74e511c263d147b5fbe81fe100d217
private:
const HWND hwnd_;
diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn
index c99250739b9aa9ab2d7dcae4adfa5034ef3921c2..ebc723289104f2d6e0684586214cfeb7a64aeb69 100644
index 7d16c747af4b807b9084ff8f9d00e576ed83949b..fa72a9170a7e41ae475b05653be99af59d4eaebb 100644
--- a/components/viz/service/BUILD.gn
+++ b/components/viz/service/BUILD.gn
@@ -141,6 +141,8 @@ viz_component("service") {
@ -514,7 +514,7 @@ index 796ae2688436eb07f19909641d1620dd02f10cdb..c9e0eee0b329caf46669b419b1cd10cf
waiting_on_draw_ack_ = true;
diff --git a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc
index ad8357c34da5f34b8583c6bc037e3fc861c6351a..9d3e20b9dedd43e3f3c13462402c147b5b7fd0a1 100644
index fe0cd60ba7d972ade4ba3cb0780117019ccea9cc..61ff833e649add942116371b012ec6b568bcfc44 100644
--- a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc
+++ b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc
@@ -96,7 +96,8 @@ RootCompositorFrameSinkImpl::Create(

View file

@ -90,7 +90,7 @@ index 40fa3f76df8e43d9d78232ea3d88efc77cf4a5ee..fa06e397abd87156e0a32da3629ec566
// a cookie. If this is set to non-null, the observer passed to
// URLLoaderFactory will be ignored.
diff --git a/services/network/public/mojom/url_response_head.mojom b/services/network/public/mojom/url_response_head.mojom
index 3464dcf4713762ede8ca5ef4918c935c0c1ae1d1..b47cc49c8691acbe03fd23a773e23ffe921b42d2 100644
index d0df2913c2e5102cfd1e1ff140e6c95d168900bd..830f90a83774e32116757f8a3b9598492dff33ee 100644
--- a/services/network/public/mojom/url_response_head.mojom
+++ b/services/network/public/mojom/url_response_head.mojom
@@ -12,6 +12,7 @@ import "services/network/public/mojom/encoded_body_length.mojom";
@ -112,10 +112,10 @@ index 3464dcf4713762ede8ca5ef4918c935c0c1ae1d1..b47cc49c8691acbe03fd23a773e23ffe
string mime_type;
diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc
index 388ce3171a7495b96baadbe4b0730de08b331fa1..b2bcb4941c4237aa007f9f27057002b5a72c0ba6 100644
index 94298f56fdd0bfb354ecdbfb482fb5117191fdae..2b0492d9a5caa54bd5f7bf6b05d351fc8a376d8c 100644
--- a/services/network/url_loader.cc
+++ b/services/network/url_loader.cc
@@ -658,6 +658,7 @@ URLLoader::URLLoader(
@@ -662,6 +662,7 @@ URLLoader::URLLoader(
has_user_activation_ = request.trusted_params->has_user_activation;
allow_cookies_from_browser_ =
request.trusted_params->allow_cookies_from_browser;
@ -123,7 +123,7 @@ index 388ce3171a7495b96baadbe4b0730de08b331fa1..b2bcb4941c4237aa007f9f27057002b5
}
// Store any cookies passed from the browser process to later attach them to
@@ -743,7 +744,7 @@ URLLoader::URLLoader(
@@ -741,7 +742,7 @@ URLLoader::URLLoader(
&URLLoader::IsSharedDictionaryReadAllowed, base::Unretained(this)));
}
@ -132,7 +132,7 @@ index 388ce3171a7495b96baadbe4b0730de08b331fa1..b2bcb4941c4237aa007f9f27057002b5
url_request_->SetResponseHeadersCallback(base::BindRepeating(
&URLLoader::SetRawResponseHeaders, base::Unretained(this)));
}
@@ -1638,6 +1639,19 @@ void URLLoader::OnResponseStarted(net::URLRequest* url_request, int net_error) {
@@ -1680,6 +1681,19 @@ void URLLoader::OnResponseStarted(net::URLRequest* url_request, int net_error) {
}
response_ = BuildResponseHead();
@ -153,10 +153,10 @@ index 388ce3171a7495b96baadbe4b0730de08b331fa1..b2bcb4941c4237aa007f9f27057002b5
// Parse and remove the Trust Tokens response headers, if any are expected,
diff --git a/services/network/url_loader.h b/services/network/url_loader.h
index 7e15cbf136dbe5a7d7997e5fcbebec170cc41cf6..e65e32d66b8fc04e9530ddf7a293043b5dce2044 100644
index 79b64718c8e4fcae4f23ce53b3084fe5eede2c12..56227fc0fb28f93df97fe4600b46e52cb1828297 100644
--- a/services/network/url_loader.h
+++ b/services/network/url_loader.h
@@ -583,6 +583,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
@@ -651,6 +651,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
std::unique_ptr<ResourceScheduler::ScheduledResourceRequest>
resource_scheduler_request_handle_;

View file

@ -6,10 +6,10 @@ Subject: fix: allow guest webcontents to enter fullscreen
This can be upstreamed, a guest webcontents can't technically become the focused webContents. This DCHECK should allow all guest webContents to request fullscreen entrance.
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index d806c7b3feb19c94de4622c543ba39b728423524..75059c0404f60e7a6e075b15452ed39914050075 100644
index bdeae59df3ff1ece1505086410c6ff1ea6c83386..57c5157e28c26daf3c61497cc9f9e0216325771d 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -3661,7 +3661,7 @@ void WebContentsImpl::EnterFullscreenMode(
@@ -3660,7 +3660,7 @@ void WebContentsImpl::EnterFullscreenMode(
OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::EnterFullscreenMode");
DCHECK(CanEnterFullscreenMode(requesting_frame, options));
DCHECK(requesting_frame->IsActive());

View file

@ -11,10 +11,10 @@ enlarge window above dimensions set during creation of the
BrowserWindow.
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index f382e6eec48440eefb9a91642792cbf21a504275..68953ca1a30ef5a497e6e4708f9e6891d4511e6e 100644
index 642945e5f30942088189c3085d9efe16d774999e..1676180ba1d1535b3cfb34f91c90da37a22f2334 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -3797,14 +3797,29 @@ void HWNDMessageHandler::SizeWindowToAspectRatio(UINT param,
@@ -3798,14 +3798,29 @@ void HWNDMessageHandler::SizeWindowToAspectRatio(UINT param,
delegate_->GetMinMaxSize(&min_window_size, &max_window_size);
min_window_size = delegate_->DIPToScreenSize(min_window_size);
max_window_size = delegate_->DIPToScreenSize(max_window_size);

View file

@ -17,7 +17,7 @@ policy->CanCommitOriginAndUrl.
Upstreamed at https://chromium-review.googlesource.com/c/chromium/src/+/3856266.
diff --git a/content/browser/renderer_host/navigation_request.cc b/content/browser/renderer_host/navigation_request.cc
index c4c884d3adfc97cd89ce8ce27af201c3b15fbf70..d2a13a45f274ad58e956d1434b72d805fe5ce4c9 100644
index 2f5bd34117ebb65c067d5d7fd1ebc79f1384139c..8a50f05c9a07a71125ec3dbd68f7e163f4e53a00 100644
--- a/content/browser/renderer_host/navigation_request.cc
+++ b/content/browser/renderer_host/navigation_request.cc
@@ -7373,10 +7373,11 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() {
@ -37,10 +37,10 @@ index c4c884d3adfc97cd89ce8ce27af201c3b15fbf70..d2a13a45f274ad58e956d1434b72d805
}
diff --git a/content/browser/renderer_host/render_frame_host_impl.h b/content/browser/renderer_host/render_frame_host_impl.h
index 8b5c6a5b57770043b4fdec580ef208760cfdb24d..62dbb7d88de5cc30d3944f3e8c5944f7e0a71f99 100644
index 95e4fce11d972b14a7c5fed2e91424e3a8aed701..d62466b41c65a820fbd20cfc4583aaaaa999aeb4 100644
--- a/content/browser/renderer_host/render_frame_host_impl.h
+++ b/content/browser/renderer_host/render_frame_host_impl.h
@@ -2944,6 +2944,17 @@ class CONTENT_EXPORT RenderFrameHostImpl
@@ -2950,6 +2950,17 @@ class CONTENT_EXPORT RenderFrameHostImpl
// last committed document.
CookieChangeListener::CookieChangeInfo GetCookieChangeInfo();
@ -58,7 +58,7 @@ index 8b5c6a5b57770043b4fdec580ef208760cfdb24d..62dbb7d88de5cc30d3944f3e8c5944f7
// Sets a ResourceCache in the renderer. `this` must be active and there must
// be no pending navigation. `remote` must have the same and process
// isolation policy.
@@ -3326,17 +3337,6 @@ class CONTENT_EXPORT RenderFrameHostImpl
@@ -3332,17 +3343,6 @@ class CONTENT_EXPORT RenderFrameHostImpl
// relevant.
void ResetWaitingState();

View file

@ -13,10 +13,10 @@ This patch can be removed should we choose to support chrome.fileSystem
or support it enough to fix the crash.
diff --git a/chrome/browser/resources/pdf/pdf_viewer.ts b/chrome/browser/resources/pdf/pdf_viewer.ts
index b68423ffe09246ec7ba2935873774c7c452b5952..936ab4b4e12546ca93da27f264559c97f51509ae 100644
index 487404691947badb9e73e2553c4ed8fd6ab0a502..a588e1806e489e65eca0282af1bb08885bdcd73e 100644
--- a/chrome/browser/resources/pdf/pdf_viewer.ts
+++ b/chrome/browser/resources/pdf/pdf_viewer.ts
@@ -895,26 +895,12 @@ export class PdfViewerElement extends PdfViewerBaseElement {
@@ -903,26 +903,12 @@ export class PdfViewerElement extends PdfViewerBaseElement {
dataArray = [result.dataToSave];
}
@ -48,7 +48,7 @@ index b68423ffe09246ec7ba2935873774c7c452b5952..936ab4b4e12546ca93da27f264559c97
}
/**
@@ -1022,30 +1008,12 @@ export class PdfViewerElement extends PdfViewerBaseElement {
@@ -1030,30 +1016,12 @@ export class PdfViewerElement extends PdfViewerBaseElement {
fileName = fileName + '.pdf';
}

View file

@ -45,10 +45,10 @@ index ed0641b888c6421b1791c086466bd9c158e9109d..3760b3823d5af3325017bb53f5b1d38e
// RenderFrameMetadataProvider::Observer implementation.
void OnRenderFrameMetadataChangedBeforeActivation(
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 75059c0404f60e7a6e075b15452ed39914050075..88830e9c75fafe7ab8a191dee7887944fc6a6d24 100644
index 57c5157e28c26daf3c61497cc9f9e0216325771d..89f8b3aaf5d86d30c56562db7072c795f1fac58a 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -8212,7 +8212,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame(
@@ -8201,7 +8201,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame(
"WebContentsImpl::OnFocusedElementChangedInFrame",
"render_frame_host", frame);
RenderWidgetHostViewBase* root_view =

View file

@ -18,7 +18,7 @@ or resizing, but Electron does not seem to run into that issue
for opaque frameless windows even with that block commented out.
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 24b6bb99bd477eeb7ed2e672df3327dcd3ea5d7b..a87ccfe3ed5a4b4329775968981c598912f4184a 100644
index 1b35fd35d54aee39c486be83a6d30e922cf06325..7cf9f6b73757cf4ed189aefa6d32a25ed8cfb457 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -1873,7 +1873,23 @@ LRESULT HWNDMessageHandler::OnCreate(CREATESTRUCT* create_struct) {

View file

@ -64,7 +64,7 @@ index 4cd668a127a50e5462e3878c3f1dcb7384926768..dfbec49249404df8f8ebdbd26e6e865c
#endif // THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_SCRIPT_EXECUTION_CALLBACK_H_
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
index 3db87d746c1be999509e0cbabae6071878471b23..0f53c0939687fce3b933e71c1484ed21419b8357 100644
index 59ed3c0fcc335ce418484f537886a5ded7835418..af2060c1ec305cb59416d8f57aac75efba079b41 100644
--- a/third_party/blink/renderer/core/frame/local_frame.cc
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
@@ -2771,6 +2771,7 @@ void LocalFrame::RequestExecuteScript(
@ -85,7 +85,7 @@ index 3db87d746c1be999509e0cbabae6071878471b23..0f53c0939687fce3b933e71c1484ed21
void LocalFrame::SetEvictCachedSessionStorageOnFreezeOrUnload() {
diff --git a/third_party/blink/renderer/core/frame/local_frame.h b/third_party/blink/renderer/core/frame/local_frame.h
index 7e5cdb3f09323fbb2d4e5f2bd31123a99b2a1bbe..ed69dc75e33503706ce0d93b102685c733a5b52f 100644
index b15184f713b88845e8934fa852ec0197af18d58d..365c418475bafd64ab71a8685db072a1068ac1c9 100644
--- a/third_party/blink/renderer/core/frame/local_frame.h
+++ b/third_party/blink/renderer/core/frame/local_frame.h
@@ -796,6 +796,7 @@ class CORE_EXPORT LocalFrame final

View file

@ -6,7 +6,7 @@ Subject: fix: select the first menu item when opened via keyboard
This fixes an accessibility issue where the root view is 'focused' to the screen reader instead of the first menu item as with all other native menus. This patch will be upstreamed.
diff --git a/ui/views/controls/menu/menu_controller.cc b/ui/views/controls/menu/menu_controller.cc
index f8b3ded1dba82259f7d536ed5bab1a972d182419..b095843c8b28783bf51c0bf7becb111010651486 100644
index 7816e1fe32d9a590e5278b62e6e82ae58eb24777..9a472cf3b8f835cebbfb95060eccfdd650dc2097 100644
--- a/ui/views/controls/menu/menu_controller.cc
+++ b/ui/views/controls/menu/menu_controller.cc
@@ -563,6 +563,7 @@ void MenuController::Run(Widget* parent,
@ -32,7 +32,7 @@ index f8b3ded1dba82259f7d536ed5bab1a972d182419..b095843c8b28783bf51c0bf7becb1110
if (button_controller) {
pressed_lock_ = button_controller->TakeLock(
false, ui::LocatedEvent::FromIfValid(event));
@@ -2262,19 +2271,15 @@ void MenuController::OpenMenuImpl(MenuItemView* item, bool show) {
@@ -2251,19 +2260,15 @@ void MenuController::OpenMenuImpl(MenuItemView* item, bool show) {
}
item->GetSubmenu()->ShowAt(params);
@ -58,10 +58,10 @@ index f8b3ded1dba82259f7d536ed5bab1a972d182419..b095843c8b28783bf51c0bf7becb1110
item->GetSubmenu()->GetWidget()->SetNativeWindowProperty(
diff --git a/ui/views/controls/menu/menu_controller.h b/ui/views/controls/menu/menu_controller.h
index e10b92be74908f8d96e421843cb2231f712a4895..82dc2f014d2e333057836290a00c7142b460bb57 100644
index 1334ad5a759dd582b14711ef609e303613efad65..bf6653cff876205268b000e28b8f3ef0f7a29eb0 100644
--- a/ui/views/controls/menu/menu_controller.h
+++ b/ui/views/controls/menu/menu_controller.h
@@ -134,6 +134,7 @@ class VIEWS_EXPORT MenuController
@@ -140,6 +140,7 @@ class VIEWS_EXPORT MenuController
MenuAnchorPosition position,
bool context_menu,
bool is_nested_drag,
@ -157,7 +157,7 @@ index 68c01b93a973a1910c1cce1e581b5c5e38a8c787..fd82c908886f646327e59a2f4ee8dc34
absl::optional<gfx::RoundedCornersF> corners = absl::nullopt) override;
void Cancel() override;
diff --git a/ui/views/controls/menu/menu_runner_impl_cocoa.mm b/ui/views/controls/menu/menu_runner_impl_cocoa.mm
index c4c1f9b517927cff4fc573504f8e707433a6c1cc..32ab57972c8935a08919dfffab1ad59a4724b67c 100644
index 8bbf8104fdb46dc8fdb506d8504a1c9f9376175e..717488a814d122e6b0b285b1b1e49488f981eccb 100644
--- a/ui/views/controls/menu/menu_runner_impl_cocoa.mm
+++ b/ui/views/controls/menu/menu_runner_impl_cocoa.mm
@@ -193,6 +193,7 @@

View file

@ -6,10 +6,10 @@ Subject: frame_host_manager.patch
Allows embedder to intercept site instances created by chromium.
diff --git a/content/browser/renderer_host/render_frame_host_manager.cc b/content/browser/renderer_host/render_frame_host_manager.cc
index 2bf760cd665cf3ec91568f593d72b25aeaf79dcc..141b9764a59e733b7895aff697fa4e77a380f5bd 100644
index 058d0df9fefbc4f17f41fc873fd5207fabb84429..17f63f0910c3a65aeb931220cbc03bfbc8fcc53c 100644
--- a/content/browser/renderer_host/render_frame_host_manager.cc
+++ b/content/browser/renderer_host/render_frame_host_manager.cc
@@ -4024,6 +4024,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
@@ -4042,6 +4042,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
request->ResetStateForSiteInstanceChange();
}

View file

@ -12,10 +12,10 @@ rendering and there is no signal from browser process on this event
to identify it.
diff --git a/content/browser/gpu/gpu_data_manager_impl.cc b/content/browser/gpu/gpu_data_manager_impl.cc
index bcc2798027aaf132d1bcf526357c8fc65b268c2a..6762c090034f5b29e978bfd9ac0a5677d2b779eb 100644
index e496fc3cab0eed155123f5fc0e3cb5c4332bfcea..db062a89b241ea7d73b01a28adf6725e9f951e4d 100644
--- a/content/browser/gpu/gpu_data_manager_impl.cc
+++ b/content/browser/gpu/gpu_data_manager_impl.cc
@@ -230,6 +230,11 @@ void GpuDataManagerImpl::TerminateInfoCollectionGpuProcess() {
@@ -225,6 +225,11 @@ void GpuDataManagerImpl::TerminateInfoCollectionGpuProcess() {
base::AutoLock auto_lock(lock_);
private_->TerminateInfoCollectionGpuProcess();
}
@ -24,26 +24,26 @@ index bcc2798027aaf132d1bcf526357c8fc65b268c2a..6762c090034f5b29e978bfd9ac0a5677
+ base::AutoLock auto_lock(lock_);
+ return private_->DxdiagDx12VulkanRequested();
+}
#endif
#endif // BUILDFLAG(IS_WIN)
void GpuDataManagerImpl::UpdateDawnInfo(
void GpuDataManagerImpl::PostCreateThreads() {
diff --git a/content/browser/gpu/gpu_data_manager_impl.h b/content/browser/gpu/gpu_data_manager_impl.h
index dec0836918007eb0d3be46e57cfc92c31af3dc62..9059320a73d27b81fb627753ce5a379470873f33 100644
index c57305681efb469d296c90df68b6cdbea927580d..6dda1a5465e08df64b539ee203b7c40386d16e72 100644
--- a/content/browser/gpu/gpu_data_manager_impl.h
+++ b/content/browser/gpu/gpu_data_manager_impl.h
@@ -125,6 +125,7 @@ class CONTENT_EXPORT GpuDataManagerImpl : public GpuDataManager,
// BrowserMainParts override instead.
void PostCreateThreads();
@@ -121,6 +121,7 @@ class CONTENT_EXPORT GpuDataManagerImpl : public GpuDataManager,
bool Dx12Requested() const;
bool VulkanRequested() const;
void TerminateInfoCollectionGpuProcess();
+ bool DxdiagDx12VulkanRequested() const;
#endif
void UpdateDawnInfo(const std::vector<std::string>& dawn_info_list);
// Called from BrowserMainLoop::PostCreateThreads().
// TODO(content/browser/gpu/OWNERS): This should probably use a
diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc
index a8884357f015b8205e9b25ff6ab7a5c268d4ef01..e6ffc967a38df013f767f1d5b5af830ad0ab4e95 100644
index cd958aa527e3d078fd8f16e6b681bd80b2b41288..7826c31f0d91e742bf0909252f170258d63cd536 100644
--- a/content/browser/gpu/gpu_data_manager_impl_private.cc
+++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
@@ -1190,6 +1190,12 @@ void GpuDataManagerImplPrivate::TerminateInfoCollectionGpuProcess() {
@@ -1178,6 +1178,12 @@ void GpuDataManagerImplPrivate::TerminateInfoCollectionGpuProcess() {
if (host)
host->ForceShutdown();
}
@ -55,16 +55,16 @@ index a8884357f015b8205e9b25ff6ab7a5c268d4ef01..e6ffc967a38df013f767f1d5b5af830a
+}
#endif
void GpuDataManagerImplPrivate::UpdateDawnInfo(
void GpuDataManagerImplPrivate::PostCreateThreads() {
diff --git a/content/browser/gpu/gpu_data_manager_impl_private.h b/content/browser/gpu/gpu_data_manager_impl_private.h
index ed4a3a959ba33fb893ac64b1f965dc3315e78e2c..2023620a79e7267ad5b5859ebf962b747889cdac 100644
index cc93bb117b67c8dc656c1850c3c5f41b5bc31c82..c3a5c24ac664bf4701612f7c7f2e1586625c5b78 100644
--- a/content/browser/gpu/gpu_data_manager_impl_private.h
+++ b/content/browser/gpu/gpu_data_manager_impl_private.h
@@ -87,6 +87,7 @@ class CONTENT_EXPORT GpuDataManagerImplPrivate {
@@ -86,6 +86,7 @@ class CONTENT_EXPORT GpuDataManagerImplPrivate {
bool Dx12Requested() const;
bool VulkanRequested() const;
void PostCreateThreads();
void TerminateInfoCollectionGpuProcess();
+ bool DxdiagDx12VulkanRequested() const;
#endif
void PostCreateThreads();
void UpdateDawnInfo(const std::vector<std::string>& dawn_info_list);

View file

@ -6,10 +6,10 @@ Subject: gritsettings_resource_ids.patch
Add electron resources file to the list of resource ids generation.
diff --git a/tools/gritsettings/resource_ids.spec b/tools/gritsettings/resource_ids.spec
index 7e09b901412911af89d39ff46a2c824399a2b25d..46acd3cb20e414849718f199f4f32589e38088c4 100644
index 36e9375a7b656a101027e0b15de79b0d592632c7..8973dba495cb70846820383aa48979a23a77d9a3 100644
--- a/tools/gritsettings/resource_ids.spec
+++ b/tools/gritsettings/resource_ids.spec
@@ -1185,6 +1185,11 @@
@@ -1189,6 +1189,11 @@
"includes": [7440],
},

View file

@ -9,7 +9,7 @@ at rutime. It would be best if eventually all usages of this property were
replaced with clean ozone native implementations.
diff --git a/ui/ozone/platform/x11/ozone_platform_x11.cc b/ui/ozone/platform/x11/ozone_platform_x11.cc
index bf0365da219530780ec232e477f13ed216e6d5b9..84b137b0bff80f63db58b08d6c97ed5228294e0a 100644
index fb665685e3539eb13cde9b213960156634f987b3..e95c5883df89ad119a7229198f628acd83386f70 100644
--- a/ui/ozone/platform/x11/ozone_platform_x11.cc
+++ b/ui/ozone/platform/x11/ozone_platform_x11.cc
@@ -193,6 +193,7 @@ class OzonePlatformX11 : public OzonePlatform,

View file

@ -65,7 +65,7 @@ index 22c7e07dffab64061d546aa537620c50948afec0..bf7f32fe6908ad5bf0186b0ad7a5e5ce
} // namespace
diff --git a/content/renderer/theme_helper_mac.mm b/content/renderer/theme_helper_mac.mm
index b9788cf84caf5e151b124e4b3bea81cc906e0673..e4a884a2715be084d0d5ae8d75a3e613f181e56f 100644
index 75c28eeec5cae1afcefd0f429b151df6334c115b..6fee85efb4149e1b2cfff18404f0451cdc772b9e 100644
--- a/content/renderer/theme_helper_mac.mm
+++ b/content/renderer/theme_helper_mac.mm
@@ -12,10 +12,11 @@
@ -81,7 +81,7 @@ index b9788cf84caf5e151b124e4b3bea81cc906e0673..e4a884a2715be084d0d5ae8d75a3e613
namespace content {
void SystemColorsDidChange(int aqua_color_variant) {
@@ -34,8 +35,18 @@ void SystemColorsDidChange(int aqua_color_variant) {
@@ -28,8 +29,18 @@ void SystemColorsDidChange(int aqua_color_variant) {
}
bool IsSubpixelAntialiasingAvailable() {

View file

@ -133,7 +133,7 @@ index 64de8c4a00a3297b34ca052db7ce7b4778e8407f..9742a4c069679900c3dbbe6e36e0e959
const GURL& document_url,
const WeakDocumentPtr& weak_document_ptr,
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 75aec0b8a254543b8f0aa8dc9f3dab7aaac90f1f..69b48c4ae7c169af84922d7bc7e6f63429a238d5 100644
index 5422535d3a34edd469cf9aadbf4d3ef354685cf9..bf22e17a0b1321cfac6f4e12f92162330decab5d 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -2230,7 +2230,7 @@ void RenderProcessHostImpl::CreateNotificationService(

View file

@ -8,7 +8,7 @@ needed in chromium but our autofill implementation uses them. This patch can be
our autofill implementation to work like Chromium's.
diff --git a/ui/color/color_id.h b/ui/color/color_id.h
index ca8afffa9d67e1039a53e5867202d2d7bbc43f7e..71b47780514bd8a31d24cae91544a38ca7eff589 100644
index 118fdf05c357e3a36de188f505dd8482056dc9b0..a758aba16e8cb2dda5ea78ef885d7207a5573f22 100644
--- a/ui/color/color_id.h
+++ b/ui/color/color_id.h
@@ -377,6 +377,10 @@
@ -22,7 +22,7 @@ index ca8afffa9d67e1039a53e5867202d2d7bbc43f7e..71b47780514bd8a31d24cae91544a38c
E_CPONLY(kColorSegmentedButtonBorder) \
E_CPONLY(kColorSegmentedButtonFocus) \
E_CPONLY(kColorSegmentedButtonForegroundChecked) \
@@ -464,6 +468,7 @@
@@ -470,6 +474,7 @@
E_CPONLY(kColorTreeNodeForeground) \
E_CPONLY(kColorTreeNodeForegroundSelectedFocused) \
E_CPONLY(kColorTreeNodeForegroundSelectedUnfocused) \
@ -31,7 +31,7 @@ index ca8afffa9d67e1039a53e5867202d2d7bbc43f7e..71b47780514bd8a31d24cae91544a38c
#if BUILDFLAG(IS_CHROMEOS)
diff --git a/ui/color/ui_color_mixer.cc b/ui/color/ui_color_mixer.cc
index b1381d60447be969d3cf6d7027f1d88f00029826..86822f5483a25e606ac340d673682049616ca8ab 100644
index 05d283f9c55381b7ada52b872cd2e41ef5ae184c..9c897504c6854d9e8fb3870ca3860a2008c13850 100644
--- a/ui/color/ui_color_mixer.cc
+++ b/ui/color/ui_color_mixer.cc
@@ -224,6 +224,17 @@ void AddUiColorMixer(ColorProvider* provider, const ColorProviderKey& key) {
@ -52,7 +52,7 @@ index b1381d60447be969d3cf6d7027f1d88f00029826..86822f5483a25e606ac340d673682049
mixer[kColorSeparator] = {kColorMidground};
mixer[kColorShadowBase] = {dark_mode ? SK_ColorBLACK : gfx::kGoogleGrey800};
mixer[kColorShadowValueAmbientShadowElevationThree] =
@@ -322,6 +333,7 @@ void AddUiColorMixer(ColorProvider* provider, const ColorProviderKey& key) {
@@ -335,6 +346,7 @@ void AddUiColorMixer(ColorProvider* provider, const ColorProviderKey& key) {
mixer[kColorTreeNodeForegroundSelectedFocused] = {kColorTreeNodeForeground};
mixer[kColorTreeNodeForegroundSelectedUnfocused] = {
kColorTreeNodeForegroundSelectedFocused};

View file

@ -11,7 +11,7 @@ majority of changes originally come from these PRs:
This patch also fixes callback for manual user cancellation and success.
diff --git a/BUILD.gn b/BUILD.gn
index 79cc0c5a844bf7a21b0b1910a3c7b6477f0c082a..d75a7b18de626d836a9044ebb6839ca9b3f2dfb7 100644
index acd08b3cc7ef4e6a8bf7836a38028d87e3e19710..2fb89b190051949a2605ae7f25567c1df6863fb5 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -973,7 +973,6 @@ if (is_win) {
@ -601,7 +601,7 @@ index fcee7b58a8eebd9fc044bab51a5d0e540de0de7d..160b5a6ad2d5cb6e0292f9ff1d16ee55
// Indication that the job is getting canceled.
bool canceling_job_ = false;
diff --git a/chrome/browser/printing/printer_query.cc b/chrome/browser/printing/printer_query.cc
index 85e2d8c9161b4c6b122371a5a17b844c0660bb39..7bcedc3c75e5c77c1c00f0124b44e9d145646e08 100644
index 83bce57ef52afa2094e294ae6bbe35e5e9e7797c..a32fc474b7db1bfa07443900eac49184036136da 100644
--- a/chrome/browser/printing/printer_query.cc
+++ b/chrome/browser/printing/printer_query.cc
@@ -355,17 +355,19 @@ void PrinterQuery::UpdatePrintSettings(base::Value::Dict new_settings,
@ -919,7 +919,7 @@ index 0fea424325081a0ef6720000841ea321b89024d0..c700de4b81fc0c157946e76faedaca6b
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
// Set options for print preset from source PDF document.
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
index 8e96ddd9e574d162f00814a7ae311c49d396819a..9f8f97981311eb58ccc57118fdab978b080f34b6 100644
index 35b96db98a4c190805d54e4aacb4eb368e5999b6..798498992ae1e8003ed3d9b4ba3b22e31410a065 100644
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -2907,8 +2907,9 @@ source_set("browser") {

View file

@ -44,10 +44,10 @@ index 025965f6171b3ddd77d6adcf4eb4c711544c81db..0501178b4ec494cbeccd95428ecdd856
void RenderWidgetHostImpl::ShowContextMenuAtPoint(
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 2b888be4850f4fad3bb9c43102dbb4da57227208..4893c65e3046b393532bbd2f372c4321a6e87560 100644
index dc9ad3e374bf842ceeb864356380c56daea62906..caedd4d4e657bf49e9b0b76fce7bf7adfea1bb7b 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4849,6 +4849,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
@@ -4848,6 +4848,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
return text_input_manager_.get();
}

View file

@ -52,7 +52,7 @@ Some alternatives to this patch:
None of these options seems like a substantial maintainability win over this patch to me (@nornagon).
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
index 1940c81f4acb9fdaee605abe64adf424bd6e3632..bfb799ebe63f9134604c1343a215405d0dff0cca 100644
index 15beb12c5c9702c5f67fdc2bf127de7bc31631fa..9cb1abe75f29fbd1510968c1e571583563d18c29 100644
--- a/chrome/BUILD.gn
+++ b/chrome/BUILD.gn
@@ -1617,7 +1617,7 @@ if (is_chrome_branded && !is_android) {

View file

@ -6,10 +6,10 @@ Subject: scroll_bounce_flag.patch
Patch to make scrollBounce option work.
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index b1ad4bd6c61089badd7eda1d95592f3f5b190a1b..64c4adde22136baf053275e8cd4d097b027f1abe 100644
index 9bdebf527329f163260a4f300316a0b44f1082a6..abe4e33ef816221eb177c7ad789878dd49125c8c 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -1337,7 +1337,7 @@ bool RenderThreadImpl::IsLcdTextEnabled() {
@@ -1332,7 +1332,7 @@ bool RenderThreadImpl::IsLcdTextEnabled() {
}
bool RenderThreadImpl::IsElasticOverscrollEnabled() {

View file

@ -22,7 +22,7 @@ However, the patch would need to be reviewed by the security team, as it
does touch a security-sensitive class.
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 69b48c4ae7c169af84922d7bc7e6f63429a238d5..37fdd04d9738c699db8c9140600f90e8523de93e 100644
index bf22e17a0b1321cfac6f4e12f92162330decab5d..0227d69ec2afe04ff4c4d8d9e6a20bda2daad71b 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -1915,9 +1915,15 @@ bool RenderProcessHostImpl::Init() {

View file

@ -9,10 +9,10 @@ is needed for OSR.
Originally landed in https://github.com/electron/libchromiumcontent/pull/226.
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index a974151f5880e1a78d5cde849b637e2d512a3d78..d806c7b3feb19c94de4622c543ba39b728423524 100644
index a96bc70457ab3bb7339361ab82e5643382fd364f..bdeae59df3ff1ece1505086410c6ff1ea6c83386 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -3270,6 +3270,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
@@ -3269,6 +3269,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
params.main_frame_name, GetOpener(), primary_main_frame_policy,
base::UnguessableToken::Create());
@ -26,7 +26,7 @@ index a974151f5880e1a78d5cde849b637e2d512a3d78..d806c7b3feb19c94de4622c543ba39b7
std::unique_ptr<WebContentsViewDelegate> delegate =
GetContentClient()->browser()->GetWebContentsViewDelegate(this);
@@ -3280,6 +3287,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
@@ -3279,6 +3286,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
view_ = CreateWebContentsView(this, std::move(delegate),
&render_view_host_delegate_view_);
}

View file

@ -14,10 +14,10 @@ Note that we also need to manually update embedder's
`api::WebContents::IsFullscreenForTabOrPending` value.
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
index 99fb67d9d2e9c0018fef2df765de1d8546bbb93d..0c0e7a0269ad029238c5a58ef6ec7326df30b355 100644
index 10a27d219eb7ae960b4ef79a99d4da483a411fe7..489086eb57e9a1a9221ec490ad9d1140dbd983af 100644
--- a/content/browser/renderer_host/render_frame_host_impl.cc
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -7217,6 +7217,17 @@ void RenderFrameHostImpl::EnterFullscreen(
@@ -7223,6 +7223,17 @@ void RenderFrameHostImpl::EnterFullscreen(
}
}

View file

@ -9,10 +9,10 @@ necessary for native modules to load.
Also change visibility on mksnapshot in order to target mksnapshot for mksnapshot zip.
diff --git a/BUILD.gn b/BUILD.gn
index 5ad9387ca5db2f41d5040e82ddead0e7dc94c980..f42d82ee866d26123d64cafcc78ce64dfb203c05 100644
index 94b81042cab26257e715a5af5188d5b90c9b74c9..92da66d39ca453c71cca6ccbc7c4eac41e54b837 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -732,7 +732,7 @@ config("internal_config") {
@@ -737,7 +737,7 @@ config("internal_config") {
":cppgc_header_features",
]
@ -21,7 +21,7 @@ index 5ad9387ca5db2f41d5040e82ddead0e7dc94c980..f42d82ee866d26123d64cafcc78ce64d
defines += [ "BUILDING_V8_SHARED" ]
}
@@ -6674,7 +6674,7 @@ if (current_toolchain == v8_generator_toolchain) {
@@ -6679,7 +6679,7 @@ if (current_toolchain == v8_generator_toolchain) {
"src/interpreter/bytecodes.h",
]
@ -30,7 +30,7 @@ index 5ad9387ca5db2f41d5040e82ddead0e7dc94c980..f42d82ee866d26123d64cafcc78ce64d
deps = [
":v8_libbase",
@@ -6686,7 +6686,6 @@ if (current_toolchain == v8_generator_toolchain) {
@@ -6691,7 +6691,6 @@ if (current_toolchain == v8_generator_toolchain) {
if (current_toolchain == v8_snapshot_toolchain) {
v8_executable("mksnapshot") {

View file

@ -12,10 +12,10 @@ This patch can be safely removed if, when it is removed, `node.lib` does not
contain any standard C++ library exports (e.g. `std::ostringstream`).
diff --git a/BUILD.gn b/BUILD.gn
index f42d82ee866d26123d64cafcc78ce64dfb203c05..17b6241d4428eb27cf478193909bde21ee99e50f 100644
index 92da66d39ca453c71cca6ccbc7c4eac41e54b837..5987258239dcfb035d2b85a630e60eb578cc5cde 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -732,6 +732,10 @@ config("internal_config") {
@@ -737,6 +737,10 @@ config("internal_config") {
":cppgc_header_features",
]

View file

@ -10,7 +10,6 @@
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/mac/foundation_util.h"
#include "base/mac/scoped_nsautorelease_pool.h"
#include "base/path_service.h"
#include "base/strings/sys_string_conversions.h"
#include "content/browser/mac_helpers.h"
@ -19,6 +18,10 @@
#include "shell/common/application_info.h"
#include "shell/common/mac/main_application_bundle.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
namespace electron {
namespace {
@ -70,14 +73,15 @@ void ElectronMainDelegate::OverrideChildProcessPath() {
}
void ElectronMainDelegate::SetUpBundleOverrides() {
base::mac::ScopedNSAutoreleasePool pool;
NSBundle* bundle = MainApplicationBundle();
std::string base_bundle_id =
base::SysNSStringToUTF8([bundle bundleIdentifier]);
NSString* team_id = [bundle objectForInfoDictionaryKey:@"ElectronTeamID"];
if (team_id)
base_bundle_id = base::SysNSStringToUTF8(team_id) + "." + base_bundle_id;
base::mac::SetBaseBundleID(base_bundle_id.c_str());
@autoreleasepool {
NSBundle* bundle = MainApplicationBundle();
std::string base_bundle_id =
base::SysNSStringToUTF8([bundle bundleIdentifier]);
NSString* team_id = [bundle objectForInfoDictionaryKey:@"ElectronTeamID"];
if (team_id)
base_bundle_id = base::SysNSStringToUTF8(team_id) + "." + base_bundle_id;
base::mac::SetBaseBundleID(base_bundle_id.c_str());
}
}
void RegisterAtomCrApp() {

View file

@ -11,7 +11,9 @@
#import "shell/browser/ui/cocoa/electron_menu_controller.h"
using base::scoped_nsobject;
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
namespace electron::api {
@ -41,10 +43,10 @@ class MenuMac : public Menu {
void ClosePopupOnUI(int32_t window_id);
void OnClosed(int32_t window_id, base::OnceClosure callback);
scoped_nsobject<ElectronMenuController> menu_controller_;
ElectronMenuController* __strong menu_controller_;
// window ID -> open context menu
std::map<int32_t, scoped_nsobject<ElectronMenuController>> popup_controllers_;
std::map<int32_t, ElectronMenuController*> popup_controllers_;
base::WeakPtrFactory<MenuMac> weak_factory_{this};
};

View file

@ -20,7 +20,7 @@
namespace {
static scoped_nsobject<NSMenu> applicationMenu_;
static NSMenu* __strong applicationMenu_;
ui::Accelerator GetAcceleratorFromKeyEquivalentAndModifierMask(
NSString* key_equivalent,
@ -75,16 +75,15 @@ v8::Local<v8::Value> Menu::GetUserAcceleratorAt(int command_id) const {
if (![NSMenuItem usesUserKeyEquivalents])
return v8::Null(isolate);
auto controller = base::scoped_nsobject<ElectronMenuController>(
[[ElectronMenuController alloc] initWithModel:model()
useDefaultAccelerator:NO]);
auto controller = [[ElectronMenuController alloc] initWithModel:model()
useDefaultAccelerator:NO];
int command_index = GetIndexOfCommandId(command_id);
if (command_index == -1)
return v8::Null(isolate);
base::scoped_nsobject<NSMenuItem> item =
[controller makeMenuItemForIndex:command_index fromModel:model()];
NSMenuItem* item = [controller makeMenuItemForIndex:command_index
fromModel:model()];
if ([[item userKeyEquivalent] length] == 0)
return v8::Null(isolate);
@ -109,9 +108,9 @@ void MenuMac::PopupOnUI(const base::WeakPtr<NativeWindow>& native_window,
base::OnceClosure close_callback =
base::BindOnce(&MenuMac::OnClosed, weak_factory_.GetWeakPtr(), window_id,
std::move(callback));
popup_controllers_[window_id] = base::scoped_nsobject<ElectronMenuController>(
popup_controllers_[window_id] =
[[ElectronMenuController alloc] initWithModel:model()
useDefaultAccelerator:NO]);
useDefaultAccelerator:NO];
NSMenu* menu = [popup_controllers_[window_id] menu];
NSView* view = [nswindow contentView];
@ -171,9 +170,9 @@ void MenuMac::ClosePopupAt(int32_t window_id) {
std::u16string MenuMac::GetAcceleratorTextAtForTesting(int index) const {
// A least effort to get the real shortcut text of NSMenuItem, the code does
// not need to be perfect since it is test only.
base::scoped_nsobject<ElectronMenuController> controller(
ElectronMenuController* controller =
[[ElectronMenuController alloc] initWithModel:model()
useDefaultAccelerator:NO]);
useDefaultAccelerator:NO];
NSMenuItem* item = [[controller menu] itemAtIndex:index];
std::u16string text;
NSEventModifierFlags modifiers = [item keyEquivalentModifierMask];
@ -227,15 +226,15 @@ void MenuMac::OnClosed(int32_t window_id, base::OnceClosure callback) {
// static
void Menu::SetApplicationMenu(Menu* base_menu) {
MenuMac* menu = static_cast<MenuMac*>(base_menu);
base::scoped_nsobject<ElectronMenuController> menu_controller(
ElectronMenuController* menu_controller =
[[ElectronMenuController alloc] initWithModel:menu->model_.get()
useDefaultAccelerator:YES]);
useDefaultAccelerator:YES];
NSRunLoop* currentRunLoop = [NSRunLoop currentRunLoop];
[currentRunLoop cancelPerformSelector:@selector(setMainMenu:)
target:NSApp
argument:applicationMenu_];
applicationMenu_.reset([[menu_controller menu] retain]);
applicationMenu_ = [menu_controller menu];
[[NSRunLoop currentRunLoop]
performSelector:@selector(setMainMenu:)
target:NSApp
@ -243,8 +242,7 @@ void Menu::SetApplicationMenu(Menu* base_menu) {
order:0
modes:[NSArray arrayWithObject:NSDefaultRunLoopMode]];
// Ensure the menu_controller_ is destroyed after main menu is set.
menu_controller.swap(menu->menu_controller_);
menu->menu_controller_ = menu_controller;
}
// static

View file

@ -6,6 +6,10 @@
#include "shell/browser/mac/electron_application.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
namespace electron::api {
void NativeTheme::UpdateMacOSAppearanceForOverrideValue(

View file

@ -12,6 +12,10 @@
#include "shell/common/gin_converters/value_converter.h"
#include "shell/common/gin_helper/promise.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
namespace electron::api {
v8::Local<v8::Promise> PushNotifications::RegisterForAPNSNotifications(

View file

@ -30,13 +30,17 @@
#include "skia/ext/skia_utils_mac.h"
#include "ui/native_theme/native_theme.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
namespace gin {
template <>
struct Converter<NSAppearance*> {
static bool FromV8(v8::Isolate* isolate,
v8::Local<v8::Value> val,
NSAppearance** out) {
NSAppearance* __strong* out) {
if (val->IsNull()) {
*out = nil;
return true;
@ -409,7 +413,7 @@ std::string SystemPreferences::GetSystemColor(gin_helper::ErrorThrower thrower,
}
bool SystemPreferences::CanPromptTouchID() {
base::scoped_nsobject<LAContext> context([[LAContext alloc] init]);
LAContext* context = [[LAContext alloc] init];
LAPolicy auth_policy = LAPolicyDeviceOwnerAuthenticationWithBiometricsOrWatch;
if (![context canEvaluatePolicy:auth_policy error:nil])
return false;
@ -422,7 +426,7 @@ v8::Local<v8::Promise> SystemPreferences::PromptTouchID(
gin_helper::Promise<void> promise(isolate);
v8::Local<v8::Promise> handle = promise.GetHandle();
base::scoped_nsobject<LAContext> context([[LAContext alloc] init]);
LAContext* context = [[LAContext alloc] init];
base::ScopedCFTypeRef<SecAccessControlRef> access_control =
base::ScopedCFTypeRef<SecAccessControlRef>(
SecAccessControlCreateWithFlags(
@ -463,7 +467,8 @@ v8::Local<v8::Promise> SystemPreferences::PromptTouchID(
// static
bool SystemPreferences::IsTrustedAccessibilityClient(bool prompt) {
NSDictionary* options = @{(id)kAXTrustedCheckOptionPrompt : @(prompt)};
NSDictionary* options =
@{(__bridge id)kAXTrustedCheckOptionPrompt : @(prompt)};
return AXIsProcessTrustedWithOptions((CFDictionaryRef)options);
}

View file

@ -532,14 +532,10 @@ void Browser::ShowAboutPanel() {
// Credits must be a NSAttributedString instead of NSString
NSString* credits = (NSString*)options[@"Credits"];
if (credits != nil) {
base::scoped_nsobject<NSMutableDictionary> mutable_options(
[options mutableCopy]);
base::scoped_nsobject<NSAttributedString> creditString(
[[NSAttributedString alloc]
initWithString:credits
attributes:@{
NSForegroundColorAttributeName : [NSColor textColor]
}]);
NSMutableDictionary* mutable_options = [options mutableCopy];
NSAttributedString* creditString = [[NSAttributedString alloc]
initWithString:credits
attributes:@{NSForegroundColorAttributeName : [NSColor textColor]}];
[mutable_options setValue:creditString forKey:@"Credits"];
options = [NSDictionary dictionaryWithDictionary:mutable_options];

View file

@ -297,6 +297,10 @@ HidSystemTrayIcon* BrowserProcessImpl::hid_system_tray_icon() {
return nullptr;
}
UsbSystemTrayIcon* BrowserProcessImpl::usb_system_tray_icon() {
return nullptr;
}
void BrowserProcessImpl::SetSystemLocale(const std::string& locale) {
system_locale_ = locale;
}

View file

@ -107,6 +107,7 @@ class BrowserProcessImpl : public BrowserProcess {
resource_coordinator::TabManager* GetTabManager() override;
SerialPolicyAllowedPorts* serial_policy_allowed_ports() override;
HidSystemTrayIcon* hid_system_tray_icon() override;
UsbSystemTrayIcon* usb_system_tray_icon() override;
void CreateDevToolsProtocolHandler() override {}
void CreateDevToolsAutoOpener() override {}
void set_background_mode_manager_for_test(

View file

@ -17,13 +17,18 @@
#include "shell/common/electron_paths.h"
#include "ui/base/l10n/l10n_util_mac.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
namespace electron {
static ElectronApplicationDelegate* __strong delegate_;
void ElectronBrowserMainParts::PreCreateMainMessageLoop() {
// Set our own application delegate.
ElectronApplicationDelegate* delegate =
[[ElectronApplicationDelegate alloc] init];
[NSApp setDelegate:delegate];
delegate_ = [[ElectronApplicationDelegate alloc] init];
[NSApp setDelegate:delegate_];
PreCreateMainMessageLoopCommon();
@ -40,7 +45,7 @@ void ElectronBrowserMainParts::PreCreateMainMessageLoop() {
}
void ElectronBrowserMainParts::FreeAppDelegate() {
[[NSApp delegate] release];
delegate_ = nil;
[NSApp setDelegate:nil];
}
@ -78,7 +83,6 @@ void ElectronBrowserMainParts::InitializeMainNib() {
}
[mainNib instantiateWithOwner:application topLevelObjects:nil];
[mainNib release];
}
std::string ElectronBrowserMainParts::GetCurrentSystemLocale() {

View file

@ -32,8 +32,7 @@ namespace extensions {
class ElectronGuestViewManagerDelegate
: public ExtensionsGuestViewManagerDelegate {
public:
explicit ElectronGuestViewManagerDelegate(content::BrowserContext* context)
: ExtensionsGuestViewManagerDelegate(context) {}
ElectronGuestViewManagerDelegate() : ExtensionsGuestViewManagerDelegate() {}
~ElectronGuestViewManagerDelegate() override = default;
// disable copy
@ -118,9 +117,8 @@ ElectronExtensionsAPIClient::CreateMimeHandlerViewGuestDelegate(
}
std::unique_ptr<guest_view::GuestViewManagerDelegate>
ElectronExtensionsAPIClient::CreateGuestViewManagerDelegate(
content::BrowserContext* context) const {
return std::make_unique<ElectronGuestViewManagerDelegate>(context);
ElectronExtensionsAPIClient::CreateGuestViewManagerDelegate() const {
return std::make_unique<ElectronGuestViewManagerDelegate>();
}
} // namespace extensions

View file

@ -27,8 +27,7 @@ class ElectronExtensionsAPIClient : public ExtensionsAPIClient {
MimeHandlerViewGuest* guest) const override;
ManagementAPIDelegate* CreateManagementAPIDelegate() const override;
std::unique_ptr<guest_view::GuestViewManagerDelegate>
CreateGuestViewManagerDelegate(
content::BrowserContext* context) const override;
CreateGuestViewManagerDelegate() const override;
private:
std::unique_ptr<ElectronMessagingDelegate> messaging_delegate_;

View file

@ -6,18 +6,21 @@
#define ELECTRON_SHELL_BROWSER_MAC_ELECTRON_APPLICATION_H_
#include "base/functional/callback.h"
#include "base/mac/scoped_nsobject.h"
#include "base/mac/scoped_sending_event.h"
#import <AVFoundation/AVFoundation.h>
#import <LocalAuthentication/LocalAuthentication.h>
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
@interface AtomApplication : NSApplication <CrAppProtocol,
CrAppControlProtocol,
NSUserActivityDelegate> {
@private
BOOL handlingSendEvent_;
base::scoped_nsobject<NSUserActivity> currentActivity_;
NSUserActivity* __strong currentActivity_;
NSCondition* handoffLock_;
BOOL updateReceived_;
BOOL userStoppedShutdown_;

View file

@ -77,8 +77,7 @@ inline void dispatch_sync_main(dispatch_block_t block) {
- (void)setCurrentActivity:(NSString*)type
withUserInfo:(NSDictionary*)userInfo
withWebpageURL:(NSURL*)webpageURL {
currentActivity_ = base::scoped_nsobject<NSUserActivity>(
[[NSUserActivity alloc] initWithActivityType:type]);
currentActivity_ = [[NSUserActivity alloc] initWithActivityType:type];
[currentActivity_ setUserInfo:userInfo];
[currentActivity_ setWebpageURL:webpageURL];
[currentActivity_ setDelegate:self];
@ -87,13 +86,13 @@ inline void dispatch_sync_main(dispatch_block_t block) {
}
- (NSUserActivity*)getCurrentActivity {
return currentActivity_.get();
return currentActivity_;
}
- (void)invalidateCurrentActivity {
if (currentActivity_) {
[currentActivity_ invalidate];
currentActivity_.reset();
currentActivity_ = nil;
}
}

View file

@ -7,7 +7,6 @@
#import <Cocoa/Cocoa.h>
#include "base/mac/scoped_nsobject.h"
#include "shell/browser/native_browser_view.h"
namespace electron {

View file

@ -11,7 +11,6 @@
#include <string>
#include <vector>
#include "base/mac/scoped_nsobject.h"
#include "electron/shell/common/api/api.mojom.h"
#include "shell/browser/native_window.h"
#include "ui/display/display_observer.h"
@ -193,8 +192,8 @@ class NativeWindowMac : public NativeWindow,
kInactive,
};
ElectronPreviewItem* preview_item() const { return preview_item_.get(); }
ElectronTouchBar* touch_bar() const { return touch_bar_.get(); }
ElectronPreviewItem* preview_item() const { return preview_item_; }
ElectronTouchBar* touch_bar() const { return touch_bar_; }
bool zoom_to_page_width() const { return zoom_to_page_width_; }
bool always_simple_fullscreen() const { return always_simple_fullscreen_; }
@ -235,9 +234,9 @@ class NativeWindowMac : public NativeWindow,
ElectronNSWindow* window_; // Weak ref, managed by widget_.
base::scoped_nsobject<ElectronNSWindowDelegate> window_delegate_;
base::scoped_nsobject<ElectronPreviewItem> preview_item_;
base::scoped_nsobject<ElectronTouchBar> touch_bar_;
ElectronNSWindowDelegate* __strong window_delegate_;
ElectronPreviewItem* __strong preview_item_;
ElectronTouchBar* __strong touch_bar_;
// The views::View that fills the client area.
std::unique_ptr<RootViewMac> root_view_;
@ -266,7 +265,7 @@ class NativeWindowMac : public NativeWindow,
absl::optional<bool> window_button_visibility_;
// Controls the position and visibility of window buttons.
base::scoped_nsobject<WindowButtonsProxy> buttons_proxy_;
WindowButtonsProxy* __strong buttons_proxy_;
std::unique_ptr<SkRegion> draggable_region_;

View file

@ -306,13 +306,13 @@ NativeWindowMac::NativeWindowMac(const gin_helper::Dictionary& options,
if (window->window_)
window->window_ = nil;
if (window->buttons_proxy_)
window->buttons_proxy_.reset();
window->buttons_proxy_ = nil;
},
this));
[window_ setEnableLargerThanScreen:enable_larger_than_screen()];
window_delegate_.reset([[ElectronNSWindowDelegate alloc] initWithShell:this]);
window_delegate_ = [[ElectronNSWindowDelegate alloc] initWithShell:this];
[window_ setDelegate:window_delegate_];
// Only use native parent window for non-modal windows.
@ -352,7 +352,7 @@ NativeWindowMac::NativeWindowMac(const gin_helper::Dictionary& options,
if (title_bar_style_ == TitleBarStyle::kNormal) {
InternalSetWindowButtonVisibility(false);
} else {
buttons_proxy_.reset([[WindowButtonsProxy alloc] initWithWindow:window_]);
buttons_proxy_ = [[WindowButtonsProxy alloc] initWithWindow:window_];
[buttons_proxy_ setHeight:titlebar_overlay_height()];
if (traffic_light_position_) {
[buttons_proxy_ setMargin:*traffic_light_position_];
@ -1555,10 +1555,9 @@ void NativeWindowMac::UpdateFrame() {
void NativeWindowMac::SetTouchBar(
std::vector<gin_helper::PersistentDictionary> items) {
touch_bar_.reset([[ElectronTouchBar alloc]
initWithDelegate:window_delegate_.get()
window:this
settings:std::move(items)]);
touch_bar_ = [[ElectronTouchBar alloc] initWithDelegate:window_delegate_
window:this
settings:std::move(items)];
[window_ setTouchBar:nil];
}
@ -1626,9 +1625,9 @@ void NativeWindowMac::SetAspectRatio(double aspect_ratio,
void NativeWindowMac::PreviewFile(const std::string& path,
const std::string& display_name) {
preview_item_.reset([[ElectronPreviewItem alloc]
preview_item_ = [[ElectronPreviewItem alloc]
initWithURL:[NSURL fileURLWithPath:base::SysUTF8ToNSString(path)]
title:base::SysUTF8ToNSString(display_name)]);
title:base::SysUTF8ToNSString(display_name)];
[[QLPreviewPanel sharedPreviewPanel] makeKeyAndOrderFront:nil];
}
@ -1799,7 +1798,7 @@ void NativeWindowMac::AddContentViewLayers() {
// There is no need to do so for frameless window, and doing so would make
// titleBarStyle stop working.
if (has_frame()) {
base::scoped_nsobject<CALayer> background_layer([[CALayer alloc] init]);
CALayer* background_layer = [[CALayer alloc] init];
[background_layer
setAutoresizingMask:kCALayerWidthSizable | kCALayerHeightSizable];
[[window_ contentView] setLayer:background_layer];

View file

@ -6,6 +6,10 @@
#include "base/apple/owned_objc.h"
#include "shell/browser/ui/cocoa/electron_inspectable_web_contents_view.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
namespace electron {
DelayedNativeViewHost::DelayedNativeViewHost(gfx::NativeView native_view)

View file

@ -8,11 +8,14 @@
#import <AppKit/AppKit.h>
#include "base/apple/owned_objc.h"
#include "base/mac/scoped_nsobject.h"
#include "base/memory/raw_ptr.h"
#include "chrome/browser/devtools/devtools_contents_resizing_strategy.h"
#include "ui/base/cocoa/base_view.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
namespace electron {
class InspectableWebContentsViewMac;
}
@ -27,8 +30,8 @@ using electron::InspectableWebContentsViewMac;
@private
raw_ptr<electron::InspectableWebContentsViewMac> inspectableWebContentsView_;
base::scoped_nsobject<NSView> fake_view_;
base::scoped_nsobject<NSWindow> devtools_window_;
NSView* __strong fake_view_;
NSWindow* __strong devtools_window_;
BOOL devtools_visible_;
BOOL devtools_docked_;
BOOL devtools_is_first_responder_;

View file

@ -13,6 +13,10 @@
#include "ui/base/cocoa/base_view.h"
#include "ui/gfx/mac/scoped_cocoa_disable_screen_updates.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
@implementation ElectronInspectableWebContentsView
- (instancetype)initWithInspectableWebContentsViewMac:
@ -28,7 +32,7 @@
attached_to_window_ = NO;
if (inspectableWebContentsView_->inspectable_web_contents()->IsGuest()) {
fake_view_.reset([[NSView alloc] init]);
fake_view_ = [[NSView alloc] init];
[fake_view_ setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
[self addSubview:fake_view_];
} else {
@ -47,7 +51,6 @@
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[super dealloc];
}
- (void)resizeSubviewsWithOldSize:(NSSize)oldBoundsSize {
@ -126,7 +129,7 @@
} else {
[devtools_window_ setDelegate:nil];
[devtools_window_ close];
devtools_window_.reset();
devtools_window_ = nil;
}
}
}
@ -160,11 +163,11 @@
NSWindowStyleMaskResizable |
NSWindowStyleMaskTexturedBackground |
NSWindowStyleMaskUnifiedTitleAndToolbar;
devtools_window_.reset([[EventDispatchingWindow alloc]
devtools_window_ = [[EventDispatchingWindow alloc]
initWithContentRect:NSMakeRect(0, 0, 800, 600)
styleMask:styleMask
backing:NSBackingStoreBuffered
defer:YES]);
defer:YES];
[devtools_window_ setDelegate:self];
[devtools_window_ setFrameAutosaveName:@"electron.devtools"];
[devtools_window_ setTitle:@"Developer Tools"];

View file

@ -9,9 +9,12 @@
#import <Cocoa/Cocoa.h>
#include "base/functional/callback.h"
#include "base/mac/scoped_nsobject.h"
#include "base/memory/weak_ptr.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
namespace electron {
class ElectronMenuModel;
}
@ -26,7 +29,9 @@ class ElectronMenuModel;
: NSObject <NSMenuDelegate, NSSharingServiceDelegate> {
@protected
base::WeakPtr<electron::ElectronMenuModel> model_;
base::scoped_nsobject<NSMenu> menu_;
NSMenu* __strong menu_;
NSMenuItem* __strong recentDocumentsMenuItem_;
NSMenu* __strong recentDocumentsMenuSwap_;
BOOL isMenuOpen_;
BOOL useDefaultAccelerator_;
base::OnceClosure closeCallback;
@ -52,9 +57,8 @@ class ElectronMenuModel;
// default initializer was used, then this will create the menu on first call.
- (NSMenu*)menu;
- (base::scoped_nsobject<NSMenuItem>)
makeMenuItemForIndex:(NSInteger)index
fromModel:(electron::ElectronMenuModel*)model;
- (NSMenuItem*)makeMenuItemForIndex:(NSInteger)index
fromModel:(electron::ElectronMenuModel*)model;
// Whether the menu is currently open.
- (BOOL)isMenuOpen;

View file

@ -86,13 +86,13 @@ bool MenuHasVisibleItems(const electron::ElectronMenuModel* model) {
// Called when an empty submenu is created. This inserts a menu item labeled
// "(empty)" into the submenu. Matches Windows behavior.
NSMenu* MakeEmptySubmenu() {
base::scoped_nsobject<NSMenu> submenu([[NSMenu alloc] initWithTitle:@""]);
NSMenu* submenu = [[NSMenu alloc] initWithTitle:@""];
NSString* empty_menu_title =
l10n_util::GetNSString(IDS_APP_MENU_EMPTY_SUBMENU);
[submenu addItemWithTitle:empty_menu_title action:NULL keyEquivalent:@""];
[[submenu itemAtIndex:0] setEnabled:NO];
return submenu.autorelease();
return submenu;
}
// Convert an SharingItem to an array of NSObjects.
@ -130,8 +130,7 @@ NSArray* ConvertSharingItemToNS(const SharingItem& item) {
}
+ (instancetype)weakPtrForModel:(electron::ElectronMenuModel*)model {
return [[[WeakPtrToElectronMenuModelAsNSObject alloc] initWithModel:model]
autorelease];
return [[WeakPtrToElectronMenuModelAsNSObject alloc] initWithModel:model];
}
+ (electron::ElectronMenuModel*)getFrom:(id)instance {
@ -153,12 +152,6 @@ NSArray* ConvertSharingItemToNS(const SharingItem& item) {
@end
// Menu item is located for ease of removing it from the parent owner
static base::scoped_nsobject<NSMenuItem> recentDocumentsMenuItem_;
// Submenu retained to be swapped back to |recentDocumentsMenuItem_|
static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
@implementation ElectronMenuController
- (electron::ElectronMenuModel*)model {
@ -188,7 +181,6 @@ static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
[self cancel];
model_ = nullptr;
[super dealloc];
}
- (void)setCloseCallback:(base::OnceClosure)callback {
@ -204,8 +196,8 @@ static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
std::u16string title = u"Open Recent";
NSString* openTitle = l10n_util::FixUpWindowsStyleLabel(title);
recentDocumentsMenuItem_.reset([[[[[NSApp mainMenu]
itemWithTitle:@"Electron"] submenu] itemWithTitle:openTitle] retain]);
recentDocumentsMenuItem_ = [[[[NSApp mainMenu] itemWithTitle:@"Electron"]
submenu] itemWithTitle:openTitle];
}
model_ = model->GetWeakPtr();
@ -236,7 +228,7 @@ static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
// Creates a NSMenu from the given model. If the model has submenus, this can
// be invoked recursively.
- (NSMenu*)menuFromModel:(electron::ElectronMenuModel*)model {
NSMenu* menu = [[[NSMenu alloc] initWithTitle:@""] autorelease];
NSMenu* menu = [[NSMenu alloc] initWithTitle:@""];
const int count = model->GetItemCount();
for (int index = 0; index < count; index++) {
@ -261,7 +253,7 @@ static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
- (void)moveMenuItems:(NSMenu*)source to:(NSMenu*)destination {
const NSInteger count = [source numberOfItems];
for (NSInteger index = 0; index < count; index++) {
NSMenuItem* removedItem = [[[source itemAtIndex:0] retain] autorelease];
NSMenuItem* removedItem = [source itemAtIndex:0];
[source removeItemAtIndex:0];
[destination addItem:removedItem];
}
@ -270,8 +262,7 @@ static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
// Replaces the item's submenu instance with the singleton recent documents
// menu. Previously replaced menu items will be recovered.
- (void)replaceSubmenuShowingRecentDocuments:(NSMenuItem*)item {
NSMenu* recentDocumentsMenu =
[[[recentDocumentsMenuItem_ submenu] retain] autorelease];
NSMenu* recentDocumentsMenu = [recentDocumentsMenuItem_ submenu];
// Remove menu items in recent documents back to swap menu
[self moveMenuItems:recentDocumentsMenu to:recentDocumentsMenuSwap_];
@ -279,7 +270,7 @@ static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
[recentDocumentsMenuItem_ setSubmenu:recentDocumentsMenuSwap_];
// Retain the item's submenu for a future recovery
recentDocumentsMenuSwap_.reset([[item submenu] retain]);
recentDocumentsMenuSwap_ = [item submenu];
// Repopulate with items from the submenu to be replaced
[self moveMenuItems:recentDocumentsMenuSwap_ to:recentDocumentsMenu];
@ -292,7 +283,7 @@ static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
DCHECK_EQ([item target], recentDocumentsMenu);
// Remember the new menu item that carries the recent documents menu
recentDocumentsMenuItem_.reset([item retain]);
recentDocumentsMenuItem_ = item;
}
// Fill the menu with Share Menu items.
@ -300,36 +291,33 @@ static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
NSArray* items = ConvertSharingItemToNS(item);
if ([items count] == 0)
return MakeEmptySubmenu();
base::scoped_nsobject<NSMenu> menu([[NSMenu alloc] init]);
NSMenu* menu = [[NSMenu alloc] init];
NSArray* services = [NSSharingService sharingServicesForItems:items];
for (NSSharingService* service in services)
[menu addItem:[self menuItemForService:service withItems:items]];
return menu.autorelease();
return menu;
}
// Creates a menu item that calls |service| when invoked.
- (NSMenuItem*)menuItemForService:(NSSharingService*)service
withItems:(NSArray*)items {
base::scoped_nsobject<NSMenuItem> item([[NSMenuItem alloc]
initWithTitle:service.menuItemTitle
action:@selector(performShare:)
keyEquivalent:@""]);
NSMenuItem* item = [[NSMenuItem alloc] initWithTitle:service.menuItemTitle
action:@selector(performShare:)
keyEquivalent:@""];
[item setTarget:self];
[item setImage:service.image];
[item setRepresentedObject:@{@"service" : service, @"items" : items}];
return item.autorelease();
return item;
}
- (base::scoped_nsobject<NSMenuItem>)
makeMenuItemForIndex:(NSInteger)index
fromModel:(electron::ElectronMenuModel*)model {
- (NSMenuItem*)makeMenuItemForIndex:(NSInteger)index
fromModel:(electron::ElectronMenuModel*)model {
std::u16string label16 = model->GetLabelAt(index);
NSString* label = l10n_util::FixUpWindowsStyleLabel(label16);
base::scoped_nsobject<NSMenuItem> item([[NSMenuItem alloc]
initWithTitle:label
action:@selector(itemSelected:)
keyEquivalent:@""]);
NSMenuItem* item = [[NSMenuItem alloc] initWithTitle:label
action:@selector(itemSelected:)
keyEquivalent:@""];
// If the menu item has an icon, set it.
ui::ImageModel icon = model->GetIconAt(index);
@ -348,7 +336,7 @@ static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
[item setTarget:nil];
[item setAction:nil];
NSMenu* submenu = [[[NSMenu alloc] initWithTitle:sub_label] autorelease];
NSMenu* submenu = [[NSMenu alloc] initWithTitle:sub_label];
[item setSubmenu:submenu];
[NSApp setServicesMenu:submenu];
} else if (role == u"sharemenu") {
@ -504,18 +492,18 @@ static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
- (NSMenu*)menu {
if (menu_)
return menu_.get();
return menu_;
if (model_ && model_->GetSharingItem()) {
NSMenu* menu = [self createShareMenuForItem:*model_->GetSharingItem()];
menu_.reset([menu retain]);
menu_ = menu;
} else {
menu_.reset([[NSMenu alloc] initWithTitle:@""]);
menu_ = [[NSMenu alloc] initWithTitle:@""];
if (model_)
[self populateWithModel:model_.get()];
}
[menu_ setDelegate:self];
return menu_.get();
return menu_;
}
- (BOOL)isMenuOpen {

View file

@ -14,6 +14,10 @@
#import <objc/message.h>
#import <objc/runtime.h>
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
namespace electron {
int ScopedDisableResize::disable_resize_ = 0;
@ -248,7 +252,7 @@ void SwizzleSwipeWithEvent(NSView* view, SEL swiz_selector) {
@"NSAccessibilityReparentingCellProxy"];
NSArray* children = [super accessibilityAttributeValue:attribute];
NSMutableArray* mutableChildren = [[children mutableCopy] autorelease];
NSMutableArray* mutableChildren = [children mutableCopy];
[mutableChildren filterUsingPredicate:predicate];
return mutableChildren;

View file

@ -11,11 +11,14 @@
#include <string>
#include <vector>
#include "base/mac/scoped_nsobject.h"
#include "base/memory/raw_ptr.h"
#include "shell/browser/native_window.h"
#include "shell/common/gin_helper/persistent_dictionary.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
@interface ElectronTouchBar : NSObject <NSScrubberDelegate,
NSScrubberDataSource,
NSScrubberFlowLayoutDelegate> {

View file

@ -55,10 +55,10 @@ static NSString* const ImageScrubberItemIdentifier = @"scrubber.image.item";
}
- (NSTouchBar*)touchBarFromItemIdentifiers:(NSMutableArray*)items {
base::scoped_nsobject<NSTouchBar> bar([[NSTouchBar alloc] init]);
NSTouchBar* bar = [[NSTouchBar alloc] init];
[bar setDelegate:delegate_];
[bar setDefaultItemIdentifiers:items];
return bar.autorelease();
return bar;
}
- (NSMutableArray*)identifiersFromSettings:
@ -349,15 +349,15 @@ static NSString* const ImageScrubberItemIdentifier = @"scrubber.image.item";
v8::HandleScope handle_scope(isolate);
gin_helper::PersistentDictionary settings = settings_[s_id];
base::scoped_nsobject<NSCustomTouchBarItem> item(
[[NSCustomTouchBarItem alloc] initWithIdentifier:identifier]);
NSCustomTouchBarItem* item =
[[NSCustomTouchBarItem alloc] initWithIdentifier:identifier];
NSButton* button = [NSButton buttonWithTitle:@""
target:self
action:@selector(buttonAction:)];
button.tag = [id floatValue];
[item setView:button];
[self updateButton:item withSettings:settings];
return item.autorelease();
return item;
}
- (void)updateButton:(NSCustomTouchBarItem*)item
@ -410,11 +410,11 @@ static NSString* const ImageScrubberItemIdentifier = @"scrubber.image.item";
v8::HandleScope handle_scope(isolate);
gin_helper::PersistentDictionary settings = settings_[s_id];
base::scoped_nsobject<NSCustomTouchBarItem> item(
[[NSCustomTouchBarItem alloc] initWithIdentifier:identifier]);
NSCustomTouchBarItem* item =
[[NSCustomTouchBarItem alloc] initWithIdentifier:identifier];
[item setView:[NSTextField labelWithString:@""]];
[self updateLabel:item withSettings:settings];
return item.autorelease();
return item;
}
- (void)updateLabel:(NSCustomTouchBarItem*)item
@ -447,20 +447,19 @@ static NSString* const ImageScrubberItemIdentifier = @"scrubber.image.item";
v8::HandleScope scope(isolate);
gin_helper::PersistentDictionary settings = settings_[s_id];
base::scoped_nsobject<NSColorPickerTouchBarItem> item(
[[NSColorPickerTouchBarItem alloc] initWithIdentifier:identifier]);
NSColorPickerTouchBarItem* item =
[[NSColorPickerTouchBarItem alloc] initWithIdentifier:identifier];
[item setTarget:self];
[item setAction:@selector(colorPickerAction:)];
[self updateColorPicker:item withSettings:settings];
return item.autorelease();
return item;
}
- (void)updateColorPicker:(NSColorPickerTouchBarItem*)item
withSettings:(const gin_helper::PersistentDictionary&)settings {
std::vector<std::string> colors;
if (settings.Get("availableColors", &colors) && !colors.empty()) {
NSColorList* color_list =
[[[NSColorList alloc] initWithName:@""] autorelease];
NSColorList* color_list = [[NSColorList alloc] initWithName:@""];
for (size_t i = 0; i < colors.size(); ++i) {
[color_list insertColor:[self colorFromHexColorString:colors[i]]
key:base::SysUTF8ToNSString(colors[i])
@ -485,12 +484,12 @@ static NSString* const ImageScrubberItemIdentifier = @"scrubber.image.item";
v8::HandleScope handle_scope(isolate);
gin_helper::PersistentDictionary settings = settings_[s_id];
base::scoped_nsobject<NSSliderTouchBarItem> item(
[[NSSliderTouchBarItem alloc] initWithIdentifier:identifier]);
NSSliderTouchBarItem* item =
[[NSSliderTouchBarItem alloc] initWithIdentifier:identifier];
[item setTarget:self];
[item setAction:@selector(sliderAction:)];
[self updateSlider:item withSettings:settings];
return item.autorelease();
return item;
}
- (void)updateSlider:(NSSliderTouchBarItem*)item
@ -521,10 +520,10 @@ static NSString* const ImageScrubberItemIdentifier = @"scrubber.image.item";
v8::HandleScope handle_scope(isolate);
gin_helper::PersistentDictionary settings = settings_[s_id];
base::scoped_nsobject<NSPopoverTouchBarItem> item(
[[NSPopoverTouchBarItem alloc] initWithIdentifier:identifier]);
NSPopoverTouchBarItem* item =
[[NSPopoverTouchBarItem alloc] initWithIdentifier:identifier];
[self updatePopover:item withSettings:settings];
return item.autorelease();
return item;
}
- (void)updatePopover:(NSPopoverTouchBarItem*)item
@ -613,8 +612,8 @@ static NSString* const ImageScrubberItemIdentifier = @"scrubber.image.item";
v8::HandleScope handle_scope(isolate);
gin_helper::PersistentDictionary settings = settings_[s_id];
base::scoped_nsobject<NSCustomTouchBarItem> item(
[[NSCustomTouchBarItem alloc] initWithIdentifier:identifier]);
NSCustomTouchBarItem* item =
[[NSCustomTouchBarItem alloc] initWithIdentifier:identifier];
NSSegmentedControl* control = [NSSegmentedControl
segmentedControlWithLabels:[NSMutableArray array]
@ -625,7 +624,7 @@ static NSString* const ImageScrubberItemIdentifier = @"scrubber.image.item";
[item setView:control];
[self updateSegmentedControl:item withSettings:settings];
return item.autorelease();
return item;
}
- (void)updateSegmentedControl:(NSCustomTouchBarItem*)item
@ -700,11 +699,10 @@ static NSString* const ImageScrubberItemIdentifier = @"scrubber.image.item";
v8::HandleScope handle_scope(isolate);
gin_helper::PersistentDictionary settings = settings_[s_id];
base::scoped_nsobject<NSCustomTouchBarItem> item(
[[NSCustomTouchBarItem alloc] initWithIdentifier:identifier]);
NSCustomTouchBarItem* item =
[[NSCustomTouchBarItem alloc] initWithIdentifier:identifier];
NSScrubber* scrubber =
[[[NSScrubber alloc] initWithFrame:NSZeroRect] autorelease];
NSScrubber* scrubber = [[NSScrubber alloc] initWithFrame:NSZeroRect];
[scrubber registerClass:[NSScrubberTextItemView class]
forItemIdentifier:TextScrubberItemIdentifier];
@ -718,7 +716,7 @@ static NSString* const ImageScrubberItemIdentifier = @"scrubber.image.item";
[item setView:scrubber];
[self updateScrubber:item withSettings:settings];
return item.autorelease();
return item;
}
- (void)updateScrubber:(NSCustomTouchBarItem*)item

View file

@ -7,7 +7,6 @@
#import <Cocoa/Cocoa.h>
#include "base/mac/scoped_nsobject.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "ui/gfx/geometry/point.h"
@ -36,8 +35,8 @@
// Track mouse moves above window buttons.
BOOL show_on_hover_;
BOOL mouse_inside_;
base::scoped_nsobject<NSTrackingArea> tracking_area_;
base::scoped_nsobject<ButtonsAreaHoverView> hover_view_;
NSTrackingArea* __strong tracking_area_;
ButtonsAreaHoverView* __strong hover_view_;
}
- (id)initWithWindow:(NSWindow*)window;

View file

@ -70,12 +70,12 @@
// Put a transparent view above the window buttons so we can track mouse
// events when mouse enter/leave the window buttons.
if (show_on_hover_) {
hover_view_.reset([[ButtonsAreaHoverView alloc] initWithProxy:self]);
hover_view_ = [[ButtonsAreaHoverView alloc] initWithProxy:self];
[hover_view_ setFrame:[self getButtonsBounds]];
[titleBarContainer addSubview:hover_view_.get()];
[titleBarContainer addSubview:hover_view_];
} else {
[hover_view_ removeFromSuperview];
hover_view_.reset();
hover_view_ = nil;
}
[self updateButtonsVisibility];
}
@ -143,14 +143,14 @@
- (void)updateTrackingAreas {
if (tracking_area_)
[hover_view_ removeTrackingArea:tracking_area_.get()];
tracking_area_.reset([[NSTrackingArea alloc]
[hover_view_ removeTrackingArea:tracking_area_];
tracking_area_ = [[NSTrackingArea alloc]
initWithRect:NSZeroRect
options:NSTrackingMouseEnteredAndExited | NSTrackingActiveAlways |
NSTrackingInVisibleRect
owner:self
userInfo:nil]);
[hover_view_ addTrackingArea:tracking_area_.get()];
userInfo:nil];
[hover_view_ addTrackingArea:tracking_area_];
}
- (void)mouseEntered:(NSEvent*)event {

View file

@ -8,10 +8,12 @@
#include "shell/browser/ui/inspectable_web_contents_view.h"
#include "base/mac/scoped_nsobject.h"
@class ElectronInspectableWebContentsView;
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
namespace electron {
class InspectableWebContentsViewMac : public InspectableWebContentsView {
@ -34,7 +36,7 @@ class InspectableWebContentsViewMac : public InspectableWebContentsView {
void SetTitle(const std::u16string& title) override;
private:
base::scoped_nsobject<ElectronInspectableWebContentsView> view_;
ElectronInspectableWebContentsView* __strong view_;
};
} // namespace electron

View file

@ -28,7 +28,7 @@ InspectableWebContentsViewMac::~InspectableWebContentsViewMac() {
}
gfx::NativeView InspectableWebContentsViewMac::GetNativeView() const {
return view_.get();
return view_;
}
void InspectableWebContentsViewMac::ShowDevTools(bool activate) {

View file

@ -9,12 +9,15 @@
#include <string>
#include "base/mac/scoped_nsobject.h"
#include "shell/browser/ui/tray_icon.h"
@class ElectronMenuController;
@class StatusItemView;
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
namespace electron {
class TrayIconCocoa : public TrayIcon {
@ -38,10 +41,10 @@ class TrayIconCocoa : public TrayIcon {
private:
// Electron custom view for NSStatusItem.
base::scoped_nsobject<StatusItemView> status_item_view_;
StatusItemView* __strong status_item_view_;
// Status menu shown when right-clicking the system icon.
base::scoped_nsobject<ElectronMenuController> menu_;
ElectronMenuController* __strong menu_;
base::WeakPtrFactory<TrayIconCocoa> weak_factory_{this};
};

View file

@ -23,8 +23,8 @@
raw_ptr<electron::TrayIconCocoa> trayIcon_; // weak
ElectronMenuController* menuController_; // weak
BOOL ignoreDoubleClickEvents_;
base::scoped_nsobject<NSStatusItem> statusItem_;
base::scoped_nsobject<NSTrackingArea> trackingArea_;
NSStatusItem* __strong statusItem_;
NSTrackingArea* __strong trackingArea_;
}
@end // @interface StatusItemView
@ -34,7 +34,6 @@
- (void)dealloc {
trayIcon_ = nil;
menuController_ = nil;
[super dealloc];
}
- (id)initWithIcon:(electron::TrayIconCocoa*)icon {
@ -54,7 +53,7 @@
// Create the status item.
NSStatusItem* item = [[NSStatusBar systemStatusBar]
statusItemWithLength:NSVariableStatusItemLength];
statusItem_.reset([item retain]);
statusItem_ = item;
[[statusItem_ button] addSubview:self]; // inject custom view
[self updateDimensions];
}
@ -69,12 +68,12 @@
// Use NSTrackingArea for listening to mouseEnter, mouseExit, and mouseMove
// events.
[self removeTrackingArea:trackingArea_];
trackingArea_.reset([[NSTrackingArea alloc]
trackingArea_ = [[NSTrackingArea alloc]
initWithRect:[self bounds]
options:NSTrackingMouseEnteredAndExited | NSTrackingMouseMoved |
NSTrackingActiveAlways
owner:self
userInfo:nil]);
userInfo:nil];
[self addTrackingArea:trackingArea_];
}
@ -82,11 +81,11 @@
// Turn off tracking events to prevent crash.
if (trackingArea_) {
[self removeTrackingArea:trackingArea_];
trackingArea_.reset();
trackingArea_ = nil;
}
[[NSStatusBar systemStatusBar] removeStatusItem:statusItem_];
[self removeFromSuperview];
statusItem_.reset();
statusItem_ = nil;
}
- (void)setImage:(NSImage*)image {
@ -216,21 +215,13 @@
// Show a custom menu.
if (menu_model) {
base::scoped_nsobject<ElectronMenuController> menuController(
ElectronMenuController* menuController =
[[ElectronMenuController alloc] initWithModel:menu_model
useDefaultAccelerator:NO]);
useDefaultAccelerator:NO];
// Hacky way to mimic design of ordinary tray menu.
[statusItem_ setMenu:[menuController menu]];
// -performClick: is a blocking call, which will run the task loop inside
// itself. This can potentially include running JS, which can result in
// this object being released. We take a temporary reference here to make
// sure we stay alive long enough to successfully return from this
// function.
// TODO(nornagon/codebytere): Avoid nesting task loops here.
[self retain];
[[statusItem_ button] performClick:self];
[statusItem_ setMenu:[menuController_ menu]];
[self release];
return;
}
@ -326,7 +317,7 @@
namespace electron {
TrayIconCocoa::TrayIconCocoa() {
status_item_view_.reset([[StatusItemView alloc] initWithIcon:this]);
status_item_view_ = [[StatusItemView alloc] initWithIcon:this];
}
TrayIconCocoa::~TrayIconCocoa() {
@ -382,12 +373,12 @@ void TrayIconCocoa::CloseContextMenu() {
void TrayIconCocoa::SetContextMenu(raw_ptr<ElectronMenuModel> menu_model) {
if (menu_model) {
// Create native menu.
menu_.reset([[ElectronMenuController alloc] initWithModel:menu_model
useDefaultAccelerator:NO]);
menu_ = [[ElectronMenuController alloc] initWithModel:menu_model
useDefaultAccelerator:NO];
} else {
menu_.reset();
menu_ = nil;
}
[status_item_view_ setMenuController:menu_.get()];
[status_item_view_ setMenuController:menu_];
}
gfx::Rect TrayIconCocoa::GetBounds() {

View file

@ -45,8 +45,11 @@ bool ShouldUseGlobalMenuBar() {
dbus::ObjectProxy* object_proxy =
bus->GetObjectProxy(DBUS_SERVICE_DBUS, dbus::ObjectPath(DBUS_PATH_DBUS));
dbus::MethodCall method_call(DBUS_INTERFACE_DBUS, "ListNames");
std::unique_ptr<dbus::Response> response(object_proxy->CallMethodAndBlock(
&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT));
std::unique_ptr<dbus::Response> response =
object_proxy
->CallMethodAndBlock(&method_call,
dbus::ObjectProxy::TIMEOUT_USE_DEFAULT)
.value_or(nullptr);
if (!response) {
bus->ShutdownAndBlock();
return false;

View file

@ -73,6 +73,14 @@ class ElectronUsbDelegate : public content::UsbDelegate {
Observer* observer) override;
void RemoveObserver(content::BrowserContext* browser_context,
Observer* observer) override;
// TODO: See if we can separate these from Profiles upstream.
void IncrementConnectionCount(content::BrowserContext* browser_context,
const url::Origin& origin) override {}
void DecrementConnectionCount(content::BrowserContext* browser_context,
const url::Origin& origin) override {}
bool IsServiceWorkerAllowedForOrigin(const url::Origin& origin) override;
void DeleteControllerForFrame(content::RenderFrameHost* render_frame_host);