mirror of
https://github.com/electron/electron.git
synced 2026-02-19 03:14:51 -05:00
Compare commits
11 Commits
v39.2.0
...
v37.0.0-al
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
01994637e8 | ||
|
|
0810fe54d4 | ||
|
|
d783f134d9 | ||
|
|
bf94f88569 | ||
|
|
47e25dfd57 | ||
|
|
03d83c293f | ||
|
|
46e3ab6353 | ||
|
|
620f3a57dd | ||
|
|
534ad05cf2 | ||
|
|
7c77018b19 | ||
|
|
6696b98ecc |
2
BUILD.gn
2
BUILD.gn
@@ -670,6 +670,8 @@ source_set("electron_lib") {
|
||||
sources += [
|
||||
"shell/browser/certificate_manager_model.cc",
|
||||
"shell/browser/certificate_manager_model.h",
|
||||
"shell/browser/linux/x11_util.cc",
|
||||
"shell/browser/linux/x11_util.h",
|
||||
"shell/browser/ui/gtk_util.cc",
|
||||
"shell/browser/ui/gtk_util.h",
|
||||
]
|
||||
|
||||
2
DEPS
2
DEPS
@@ -2,7 +2,7 @@ gclient_gn_args_from = 'src'
|
||||
|
||||
vars = {
|
||||
'chromium_version':
|
||||
'137.0.7151.0',
|
||||
'138.0.7156.0',
|
||||
'node_version':
|
||||
'v22.14.0',
|
||||
'nan_version':
|
||||
|
||||
@@ -356,7 +356,7 @@ as `-webkit-app-region: drag` in a frameless window.
|
||||
|
||||
Calling `event.preventDefault()` will prevent the menu from being displayed.
|
||||
|
||||
To convert `point` to DIP, use [`screen.screenToDipPoint(point)`](./screen.md#screenscreentodippointpoint-windows).
|
||||
To convert `point` to DIP, use [`screen.screenToDipPoint(point)`](./screen.md#screenscreentodippointpoint-windows-linux).
|
||||
|
||||
### Static Methods
|
||||
|
||||
|
||||
@@ -435,7 +435,7 @@ as `-webkit-app-region: drag` in a frameless window.
|
||||
|
||||
Calling `event.preventDefault()` will prevent the menu from being displayed.
|
||||
|
||||
To convert `point` to DIP, use [`screen.screenToDipPoint(point)`](./screen.md#screenscreentodippointpoint-windows).
|
||||
To convert `point` to DIP, use [`screen.screenToDipPoint(point)`](./screen.md#screenscreentodippointpoint-windows-linux).
|
||||
|
||||
### Static Methods
|
||||
|
||||
|
||||
@@ -142,8 +142,8 @@ Note: The Windows implementation will ignore `size.height` and scale the height
|
||||
|
||||
Returns `NativeImage`
|
||||
|
||||
Creates a new `NativeImage` instance from a file located at `path`. This method
|
||||
returns an empty image if the `path` does not exist, cannot be read, or is not
|
||||
Creates a new `NativeImage` instance from an image file (e.g., PNG or JPEG) located at `path`.
|
||||
This method returns an empty image if the `path` does not exist, cannot be read, or is not
|
||||
a valid image.
|
||||
|
||||
```js
|
||||
|
||||
@@ -124,7 +124,7 @@ Returns [`Display`](structures/display.md) - The display nearest the specified p
|
||||
Returns [`Display`](structures/display.md) - The display that most closely
|
||||
intersects the provided bounds.
|
||||
|
||||
### `screen.screenToDipPoint(point)` _Windows_
|
||||
### `screen.screenToDipPoint(point)` _Windows_ _Linux_
|
||||
|
||||
* `point` [Point](structures/point.md)
|
||||
|
||||
@@ -133,7 +133,10 @@ Returns [`Point`](structures/point.md)
|
||||
Converts a screen physical point to a screen DIP point.
|
||||
The DPI scale is performed relative to the display containing the physical point.
|
||||
|
||||
### `screen.dipToScreenPoint(point)` _Windows_
|
||||
Not currently supported on Wayland - if used there it will return the point passed
|
||||
in with no changes.
|
||||
|
||||
### `screen.dipToScreenPoint(point)` _Windows_ _Linux_
|
||||
|
||||
* `point` [Point](structures/point.md)
|
||||
|
||||
@@ -142,6 +145,8 @@ Returns [`Point`](structures/point.md)
|
||||
Converts a screen DIP point to a screen physical point.
|
||||
The DPI scale is performed relative to the display containing the DIP point.
|
||||
|
||||
Not currently supported on Wayland.
|
||||
|
||||
### `screen.screenToDipRect(window, rect)` _Windows_
|
||||
|
||||
* `window` [BrowserWindow](browser-window.md) | null
|
||||
|
||||
@@ -35,6 +35,7 @@ filenames = {
|
||||
"shell/browser/relauncher_linux.cc",
|
||||
"shell/browser/ui/electron_desktop_window_tree_host_linux.cc",
|
||||
"shell/browser/ui/file_dialog_linux.cc",
|
||||
"shell/browser/ui/file_dialog_linux_portal.cc",
|
||||
"shell/browser/ui/gtk/menu_gtk.cc",
|
||||
"shell/browser/ui/gtk/menu_gtk.h",
|
||||
"shell/browser/ui/gtk/menu_util.cc",
|
||||
|
||||
@@ -1421,7 +1421,6 @@ libcxx_headers = [
|
||||
"//third_party/libc++/src/include/__type_traits/is_member_pointer.h",
|
||||
"//third_party/libc++/src/include/__type_traits/is_nothrow_assignable.h",
|
||||
"//third_party/libc++/src/include/__type_traits/is_nothrow_constructible.h",
|
||||
"//third_party/libc++/src/include/__type_traits/is_nothrow_convertible.h",
|
||||
"//third_party/libc++/src/include/__type_traits/is_nothrow_destructible.h",
|
||||
"//third_party/libc++/src/include/__type_traits/is_null_pointer.h",
|
||||
"//third_party/libc++/src/include/__type_traits/is_object.h",
|
||||
|
||||
@@ -144,6 +144,5 @@ feat_separate_content_settings_callback_for_sync_and_async_clipboard.patch
|
||||
fix_win32_synchronous_spellcheck.patch
|
||||
fix_enable_wrap_iter_in_string_view_and_array.patch
|
||||
fix_linter_error.patch
|
||||
revert_enable_crel_for_arm32_targets.patch
|
||||
chore_grandfather_in_electron_views_and_delegates.patch
|
||||
refactor_patch_electron_permissiontypes_into_blink.patch
|
||||
|
||||
@@ -9,7 +9,7 @@ This patch makes three changes to Accelerator::GetShortcutText to improve shortc
|
||||
2. Ctrl-Shift-= and Ctrl-Plus show up as such
|
||||
|
||||
diff --git a/ui/base/accelerators/accelerator.cc b/ui/base/accelerators/accelerator.cc
|
||||
index 7eb75d87dd3ed03fc6da738a8b397d4d52f5b5ce..8db9f17c2bdcf5378f9a3f3165956c8f1d1c8d61 100644
|
||||
index 5ad9332dd27ceda7d67cd3f571b12218a4415a40..ffe083836c39fb60b4bff1f9fbdd6cebb7fa9d1d 100644
|
||||
--- a/ui/base/accelerators/accelerator.cc
|
||||
+++ b/ui/base/accelerators/accelerator.cc
|
||||
@@ -12,6 +12,7 @@
|
||||
@@ -20,7 +20,7 @@ index 7eb75d87dd3ed03fc6da738a8b397d4d52f5b5ce..8db9f17c2bdcf5378f9a3f3165956c8f
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/types/cxx23_to_underlying.h"
|
||||
#include "build/build_config.h"
|
||||
@@ -160,6 +161,11 @@ std::u16string Accelerator::GetKeyCodeStringForShortcut() const {
|
||||
@@ -164,6 +165,11 @@ std::u16string Accelerator::GetKeyCodeStringForShortcut() const {
|
||||
#endif
|
||||
|
||||
if (key_string.empty()) {
|
||||
@@ -32,7 +32,7 @@ index 7eb75d87dd3ed03fc6da738a8b397d4d52f5b5ce..8db9f17c2bdcf5378f9a3f3165956c8f
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
// Our fallback is to try translate the key code to a regular character
|
||||
// unless it is one of digits (VK_0 to VK_9). Some keyboard
|
||||
@@ -186,6 +192,10 @@ std::u16string Accelerator::GetKeyCodeStringForShortcut() const {
|
||||
@@ -190,6 +196,10 @@ std::u16string Accelerator::GetKeyCodeStringForShortcut() const {
|
||||
static_cast<std::u16string::value_type>(base::ToUpperASCII(c));
|
||||
}
|
||||
#endif
|
||||
@@ -43,7 +43,7 @@ index 7eb75d87dd3ed03fc6da738a8b397d4d52f5b5ce..8db9f17c2bdcf5378f9a3f3165956c8f
|
||||
}
|
||||
|
||||
return key_string;
|
||||
@@ -346,7 +356,7 @@ std::vector<std::u16string> Accelerator::GetLongFormModifiers() const {
|
||||
@@ -350,7 +360,7 @@ std::vector<std::u16string> Accelerator::GetLongFormModifiers() const {
|
||||
modifiers.push_back(l10n_util::GetStringUTF16(IDS_APP_CTRL_KEY));
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ Allows Electron to restore WER when ELECTRON_DEFAULT_ERROR_MODE is set.
|
||||
This should be upstreamed.
|
||||
|
||||
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
|
||||
index f78e6732f4a154b6a479bcfcdb237f0679a7fde3..c95b699fe2d37421ae589a14d51c5ffd4465860f 100644
|
||||
index cadb96febde3fb3fe90929873b1db452a6d8fb8f..09f5504127b5a5ec3d0d69d9eb6d0cd93e0e75cd 100644
|
||||
--- a/content/gpu/gpu_main.cc
|
||||
+++ b/content/gpu/gpu_main.cc
|
||||
@@ -254,6 +254,10 @@ int GpuMain(MainFunctionParams parameters) {
|
||||
@@ -24,7 +24,7 @@ index f78e6732f4a154b6a479bcfcdb237f0679a7fde3..c95b699fe2d37421ae589a14d51c5ffd
|
||||
// We are experiencing what appear to be memory-stomp issues in the GPU
|
||||
// process. These issues seem to be impacting the task executor and listeners
|
||||
// registered to it. Create the task executor on the heap to guard against
|
||||
@@ -364,7 +368,6 @@ int GpuMain(MainFunctionParams parameters) {
|
||||
@@ -363,7 +367,6 @@ int GpuMain(MainFunctionParams parameters) {
|
||||
#endif
|
||||
const bool dead_on_arrival = !init_success;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ DidCreateScriptContext is called, not all JS APIs are available in the
|
||||
context, which can cause some preload scripts to trip.
|
||||
|
||||
diff --git a/content/public/renderer/render_frame_observer.h b/content/public/renderer/render_frame_observer.h
|
||||
index 44da0544b778d6ff4c14b6f4e8463cb8260d2f0d..8ae8939af4141a684b7a6d50a43e1abb354ea028 100644
|
||||
index db655a7b52eacb74f2a8637db36abd87f6b86792..8014cb08e2090a12ea8b9e92cb8f93c96921d400 100644
|
||||
--- a/content/public/renderer/render_frame_observer.h
|
||||
+++ b/content/public/renderer/render_frame_observer.h
|
||||
@@ -149,6 +149,8 @@ class CONTENT_EXPORT RenderFrameObserver
|
||||
@@ -23,10 +23,10 @@ index 44da0544b778d6ff4c14b6f4e8463cb8260d2f0d..8ae8939af4141a684b7a6d50a43e1abb
|
||||
int32_t world_id) {}
|
||||
virtual void DidClearWindowObject() {}
|
||||
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
||||
index e3f9f9406f51d4d4cb48fd35d33ee3d694933038..6bcbbd6f746e00344e78447ebdaf59edc80a2b79 100644
|
||||
index b0aa018f2f4e6865915516ab6b65fac20d9e6f20..c04a544eb8991bfa718322e6e3a090ef4733a50b 100644
|
||||
--- a/content/renderer/render_frame_impl.cc
|
||||
+++ b/content/renderer/render_frame_impl.cc
|
||||
@@ -4810,6 +4810,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
@@ -4807,6 +4807,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
observer.DidCreateScriptContext(context, world_id);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ usage of BrowserList and Browser as we subclass related methods and use our
|
||||
WindowList.
|
||||
|
||||
diff --git a/chrome/browser/ui/webui/accessibility/accessibility_ui.cc b/chrome/browser/ui/webui/accessibility/accessibility_ui.cc
|
||||
index 09027b5c273a209519a1c9268c604b3cf1ca0d3c..00511a4558dbc907f752b4c602cc97b4590c16b0 100644
|
||||
index ce3840087d3becac116e57ed8c690b73e360f95f..a929b2d4f6c4b34f9e278aada9f8f793477c6d19 100644
|
||||
--- a/chrome/browser/ui/webui/accessibility/accessibility_ui.cc
|
||||
+++ b/chrome/browser/ui/webui/accessibility/accessibility_ui.cc
|
||||
@@ -48,6 +48,7 @@
|
||||
@@ -21,7 +21,7 @@ index 09027b5c273a209519a1c9268c604b3cf1ca0d3c..00511a4558dbc907f752b4c602cc97b4
|
||||
#include "ui/accessibility/accessibility_features.h"
|
||||
#include "ui/accessibility/ax_updates_and_events.h"
|
||||
#include "ui/accessibility/platform/ax_platform_node.h"
|
||||
@@ -167,7 +168,7 @@ base::Value::Dict BuildTargetDescriptor(content::RenderViewHost* rvh) {
|
||||
@@ -169,7 +170,7 @@ base::Value::Dict BuildTargetDescriptor(content::RenderViewHost* rvh) {
|
||||
rvh->GetRoutingID(), accessibility_mode);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ index 09027b5c273a209519a1c9268c604b3cf1ca0d3c..00511a4558dbc907f752b4c602cc97b4
|
||||
base::Value::Dict BuildTargetDescriptor(Browser* browser) {
|
||||
base::Value::Dict target_data;
|
||||
target_data.Set(kSessionIdField, browser->session_id().id());
|
||||
@@ -190,7 +191,7 @@ void HandleAccessibilityRequestCallback(
|
||||
@@ -193,7 +194,7 @@ void HandleAccessibilityRequestCallback(
|
||||
auto& browser_accessibility_state =
|
||||
*content::BrowserAccessibilityState::GetInstance();
|
||||
base::Value::Dict data;
|
||||
@@ -39,8 +39,8 @@ index 09027b5c273a209519a1c9268c604b3cf1ca0d3c..00511a4558dbc907f752b4c602cc97b4
|
||||
ui::AXMode mode = browser_accessibility_state.GetAccessibilityMode();
|
||||
bool native = mode.has_mode(ui::AXMode::kNativeAPIs);
|
||||
bool web = mode.has_mode(ui::AXMode::kWebContents);
|
||||
@@ -214,7 +215,7 @@ void HandleAccessibilityRequestCallback(
|
||||
data.Set(kPDFPrinting, pdf_printing);
|
||||
@@ -246,7 +247,7 @@ void HandleAccessibilityRequestCallback(
|
||||
initial_process_mode.has_mode(ui::AXMode::kHTML)));
|
||||
|
||||
std::string pref_api_type =
|
||||
- pref->GetString(prefs::kShownAccessibilityApiType);
|
||||
@@ -48,7 +48,7 @@ index 09027b5c273a209519a1c9268c604b3cf1ca0d3c..00511a4558dbc907f752b4c602cc97b4
|
||||
bool pref_api_type_supported = false;
|
||||
|
||||
std::vector<ui::AXApiType::Type> supported_api_types =
|
||||
@@ -282,11 +283,11 @@ void HandleAccessibilityRequestCallback(
|
||||
@@ -314,11 +315,11 @@ void HandleAccessibilityRequestCallback(
|
||||
data.Set(kPagesField, std::move(page_list));
|
||||
|
||||
base::Value::List browser_list;
|
||||
@@ -62,7 +62,7 @@ index 09027b5c273a209519a1c9268c604b3cf1ca0d3c..00511a4558dbc907f752b4c602cc97b4
|
||||
data.Set(kBrowsersField, std::move(browser_list));
|
||||
|
||||
std::string json_string;
|
||||
@@ -762,7 +763,8 @@ void AccessibilityUIMessageHandler::SetGlobalString(
|
||||
@@ -792,7 +793,8 @@ void AccessibilityUIMessageHandler::SetGlobalString(
|
||||
const std::string value = CheckJSValue(data.FindString(kValueField));
|
||||
|
||||
if (string_name == kApiTypeField) {
|
||||
@@ -72,7 +72,7 @@ index 09027b5c273a209519a1c9268c604b3cf1ca0d3c..00511a4558dbc907f752b4c602cc97b4
|
||||
pref->SetString(prefs::kShownAccessibilityApiType, value);
|
||||
}
|
||||
}
|
||||
@@ -816,7 +818,8 @@ void AccessibilityUIMessageHandler::RequestWebContentsTree(
|
||||
@@ -846,7 +848,8 @@ void AccessibilityUIMessageHandler::RequestWebContentsTree(
|
||||
AXPropertyFilter::ALLOW_EMPTY);
|
||||
AddPropertyFilters(property_filters, deny, AXPropertyFilter::DENY);
|
||||
|
||||
@@ -82,7 +82,7 @@ index 09027b5c273a209519a1c9268c604b3cf1ca0d3c..00511a4558dbc907f752b4c602cc97b4
|
||||
ui::AXApiType::Type api_type =
|
||||
ui::AXApiType::From(pref->GetString(prefs::kShownAccessibilityApiType));
|
||||
std::string accessibility_contents =
|
||||
@@ -843,6 +846,7 @@ void AccessibilityUIMessageHandler::RequestNativeUITree(
|
||||
@@ -873,6 +876,7 @@ void AccessibilityUIMessageHandler::RequestNativeUITree(
|
||||
AXPropertyFilter::ALLOW_EMPTY);
|
||||
AddPropertyFilters(property_filters, deny, AXPropertyFilter::DENY);
|
||||
|
||||
@@ -90,7 +90,7 @@ index 09027b5c273a209519a1c9268c604b3cf1ca0d3c..00511a4558dbc907f752b4c602cc97b4
|
||||
for (Browser* browser : *BrowserList::GetInstance()) {
|
||||
if (browser->session_id().id() == session_id) {
|
||||
base::Value::Dict result = BuildTargetDescriptor(browser);
|
||||
@@ -855,6 +859,7 @@ void AccessibilityUIMessageHandler::RequestNativeUITree(
|
||||
@@ -885,6 +889,7 @@ void AccessibilityUIMessageHandler::RequestNativeUITree(
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -98,7 +98,7 @@ index 09027b5c273a209519a1c9268c604b3cf1ca0d3c..00511a4558dbc907f752b4c602cc97b4
|
||||
#endif // !BUILDFLAG(IS_ANDROID)
|
||||
// No browser with the specified |session_id| was found.
|
||||
base::Value::Dict result;
|
||||
@@ -898,11 +903,13 @@ void AccessibilityUIMessageHandler::StopRecording(
|
||||
@@ -928,11 +933,13 @@ void AccessibilityUIMessageHandler::StopRecording(
|
||||
}
|
||||
|
||||
ui::AXApiType::Type AccessibilityUIMessageHandler::GetRecordingApiType() {
|
||||
@@ -115,7 +115,7 @@ index 09027b5c273a209519a1c9268c604b3cf1ca0d3c..00511a4558dbc907f752b4c602cc97b4
|
||||
// Check to see if it is in the supported types list.
|
||||
if (std::find(supported_types.begin(), supported_types.end(), api_type) ==
|
||||
supported_types.end()) {
|
||||
@@ -972,8 +979,11 @@ void AccessibilityUIMessageHandler::RequestAccessibilityEvents(
|
||||
@@ -1002,8 +1009,11 @@ void AccessibilityUIMessageHandler::RequestAccessibilityEvents(
|
||||
// static
|
||||
void AccessibilityUIMessageHandler::RegisterProfilePrefs(
|
||||
user_prefs::PrefRegistrySyncable* registry) {
|
||||
|
||||
@@ -23,10 +23,10 @@ index f9b27264f7e3e1f8de6f088ccb78e4a4693c5e93..85aebec5028fd6b324a1f1d9416fbf99
|
||||
return receiver_.BindNewEndpointAndPassDedicatedRemote();
|
||||
}
|
||||
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
|
||||
index 00b1dc2ab7661d9ab76d0c6787bfe406327039ad..22c2a68428ed881b63e4458d17d5ff542cefe559 100644
|
||||
index 9d430ebff1067323f229c3b81b18300e8cb7e8a9..090125bc5a4c485c83d9eaa6b82ed5cf3402cbbd 100644
|
||||
--- a/content/browser/renderer_host/render_view_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_view_host_impl.cc
|
||||
@@ -763,6 +763,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
|
||||
@@ -768,6 +768,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
|
||||
GetWidget()->GetAssociatedFrameWidget()->SetBackgroundOpaque(opaque);
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ index 2072f6b14289b1f3a76dbccc98f29aa178c1c35c..d7017437a7e7e6ac130677e52731d048
|
||||
// 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 ecaae5e1a2911b122678b2f4f77b5796323ad0bf..fbfd4d96e8082df8c5db5d354ac7c39bc329d4ee 100644
|
||||
index a309befcbcb1e7fe667bc1d794141fb90fea1035..dd148eb3cce762d20e9117b4f8030c881057b8bb 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
@@ -753,10 +753,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
|
||||
@@ -33,7 +33,7 @@ index 4b3f01018a9dea91b46b5917e099f272582991b2..8250f2e447ff19829cfae3f00b3df70b
|
||||
"//base",
|
||||
"//build:branding_buildflags",
|
||||
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
|
||||
index ad39862fdd9a5a4f827f36e6a9778223a638d831..518ab769287525b1977387df56d1f50d1f0778f2 100644
|
||||
index 5c26efefaa030e5f5b7ba6089e989303795d771c..5df9bd353fe212491e473027a7080854cc5ea738 100644
|
||||
--- a/chrome/browser/BUILD.gn
|
||||
+++ b/chrome/browser/BUILD.gn
|
||||
@@ -4627,7 +4627,7 @@ static_library("browser") {
|
||||
@@ -46,10 +46,10 @@ index ad39862fdd9a5a4f827f36e6a9778223a638d831..518ab769287525b1977387df56d1f50d
|
||||
# than here in :chrome_dll.
|
||||
deps += [ "//chrome:packed_resources_integrity_header" ]
|
||||
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
|
||||
index 1b52a0d1a249c5d8beb205358c2003202c9253a0..4fbf2f66adfccb3580176be8d25598cf9ffcb616 100644
|
||||
index 897f91ed0f1fcd386f980fe2073c07915cfc6458..43c6c436a391362173cc3ae562d6cd0fb5191d1b 100644
|
||||
--- a/chrome/test/BUILD.gn
|
||||
+++ b/chrome/test/BUILD.gn
|
||||
@@ -7187,9 +7187,12 @@ test("unit_tests") {
|
||||
@@ -7181,9 +7181,12 @@ test("unit_tests") {
|
||||
"//chrome/notification_helper",
|
||||
]
|
||||
|
||||
@@ -63,7 +63,7 @@ index 1b52a0d1a249c5d8beb205358c2003202c9253a0..4fbf2f66adfccb3580176be8d25598cf
|
||||
"//chrome//services/util_win:unit_tests",
|
||||
"//chrome/app:chrome_dll_resources",
|
||||
"//chrome/app:win_unit_tests",
|
||||
@@ -8155,6 +8158,10 @@ test("unit_tests") {
|
||||
@@ -8149,6 +8152,10 @@ test("unit_tests") {
|
||||
"../browser/performance_manager/policies/background_tab_loading_policy_unittest.cc",
|
||||
]
|
||||
|
||||
@@ -74,7 +74,7 @@ index 1b52a0d1a249c5d8beb205358c2003202c9253a0..4fbf2f66adfccb3580176be8d25598cf
|
||||
sources += [
|
||||
# The importer code is not used on Android.
|
||||
"../common/importer/firefox_importer_utils_unittest.cc",
|
||||
@@ -8210,7 +8217,6 @@ test("unit_tests") {
|
||||
@@ -8204,7 +8211,6 @@ test("unit_tests") {
|
||||
# Non-android deps for "unit_tests" target.
|
||||
deps += [
|
||||
"../browser/screen_ai:screen_ai_install_state",
|
||||
|
||||
@@ -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 ebf407904b9b9bc7f60a9c13a5c39ce64640189d..7b45a0006af60400f5d8ba5b925f971cb5cf393e 100644
|
||||
index 66c25476de83a9aabad58a042addc825e27ffd0c..7578b4f9056b9be79645fa0eed9476ab9b80c509 100644
|
||||
--- a/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
@@ -9778,6 +9778,7 @@ void RenderFrameHostImpl::CreateNewWindow(
|
||||
@@ -9775,6 +9775,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 ebf407904b9b9bc7f60a9c13a5c39ce64640189d..7b45a0006af60400f5d8ba5b925f971c
|
||||
&no_javascript_access);
|
||||
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index fe352434dd26ebbde72145df335520ff9d026e80..4f87894219452e736311ad25a62b71b8aec4d158 100644
|
||||
index d2715008c411519ed6c2491bf093a92e81d8d874..a99621ef317ec59f1368e5c7959f73de8ed32c54 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -5126,6 +5126,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -5131,6 +5131,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
SetPartitionedPopinOpenerOnNewWindowIfNeeded(new_contents_impl, params,
|
||||
opener);
|
||||
|
||||
@@ -37,7 +37,7 @@ index fe352434dd26ebbde72145df335520ff9d026e80..4f87894219452e736311ad25a62b71b8
|
||||
// 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
|
||||
@@ -5167,12 +5173,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -5172,12 +5178,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
AddWebContentsDestructionObserver(new_contents_impl);
|
||||
}
|
||||
|
||||
@@ -66,10 +66,10 @@ index 55bb4ae3bab4cdf20b3e1dde9450a5c0e4e62b37..fe444c7fa140166a1b65c7a8a2676e2d
|
||||
|
||||
// Operation result when the renderer asks the browser to create a new window.
|
||||
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
|
||||
index 9c36ad70531bd8c31158c741ab23763ea00bc068..6909f75fb4cbd0e7b4f3067cda52a5f67dc100de 100644
|
||||
index b3975f65bfbcff7bc9eb0815a0ac5e97d1ff3548..2b219ccfdbef82f9e4075243da48c4b1e53158c2 100644
|
||||
--- a/content/public/browser/content_browser_client.cc
|
||||
+++ b/content/public/browser/content_browser_client.cc
|
||||
@@ -821,6 +821,8 @@ bool ContentBrowserClient::CanCreateWindow(
|
||||
@@ -823,6 +823,8 @@ bool ContentBrowserClient::CanCreateWindow(
|
||||
const std::string& frame_name,
|
||||
WindowOpenDisposition disposition,
|
||||
const blink::mojom::WindowFeatures& features,
|
||||
@@ -79,7 +79,7 @@ index 9c36ad70531bd8c31158c741ab23763ea00bc068..6909f75fb4cbd0e7b4f3067cda52a5f6
|
||||
bool opener_suppressed,
|
||||
bool* no_javascript_access) {
|
||||
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
|
||||
index f1fee091b84aec20f1e15dcc90917e50bb47d1c6..3a7a6dc0a4e75c151379f8488d371439a808f1a9 100644
|
||||
index 77b3e5c0fe47e5ed0139d3e54394f7d96fc69d21..cabdb73fa092683cdd2dad38f7b62b6bac974d0d 100644
|
||||
--- a/content/public/browser/content_browser_client.h
|
||||
+++ b/content/public/browser/content_browser_client.h
|
||||
@@ -199,6 +199,7 @@ class NetworkService;
|
||||
@@ -90,7 +90,7 @@ index f1fee091b84aec20f1e15dcc90917e50bb47d1c6..3a7a6dc0a4e75c151379f8488d371439
|
||||
} // namespace network
|
||||
|
||||
namespace sandbox {
|
||||
@@ -1377,6 +1378,8 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
@@ -1378,6 +1379,8 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
const std::string& frame_name,
|
||||
WindowOpenDisposition disposition,
|
||||
const blink::mojom::WindowFeatures& features,
|
||||
@@ -148,10 +148,10 @@ index da319cb20733150366d85bee95609f0f2d9def7f..8a18958035cc1dd26be558349f64f772
|
||||
// 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 5af26eef19c2f7ce082af02cff6d8f919c4d245d..e3f9f9406f51d4d4cb48fd35d33ee3d694933038 100644
|
||||
index 7f33a5452de32f5f4f8a43d0314917f24308d77c..b0aa018f2f4e6865915516ab6b65fac20d9e6f20 100644
|
||||
--- a/content/renderer/render_frame_impl.cc
|
||||
+++ b/content/renderer/render_frame_impl.cc
|
||||
@@ -6936,6 +6936,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
|
||||
@@ -6938,6 +6938,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
|
||||
request.HasUserGesture(), GetWebFrame()->IsAdFrame(),
|
||||
GetWebFrame()->IsAdScriptInStack());
|
||||
|
||||
@@ -163,7 +163,7 @@ index 5af26eef19c2f7ce082af02cff6d8f919c4d245d..e3f9f9406f51d4d4cb48fd35d33ee3d6
|
||||
// moved on send.
|
||||
bool is_background_tab =
|
||||
diff --git a/content/web_test/browser/web_test_content_browser_client.cc b/content/web_test/browser/web_test_content_browser_client.cc
|
||||
index 75bd6c082dbda49bd5ee177105d78b670d147034..bceb8a8acf9a23d0d1df2d6749b94f4c98ee72ec 100644
|
||||
index 9af07ab542531bd3354cf28135f36044e88c0dfb..5d763af59aec30cdfb763b8bd5fa1383c4cb5568 100644
|
||||
--- a/content/web_test/browser/web_test_content_browser_client.cc
|
||||
+++ b/content/web_test/browser/web_test_content_browser_client.cc
|
||||
@@ -535,6 +535,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
|
||||
@@ -176,7 +176,7 @@ index 75bd6c082dbda49bd5ee177105d78b670d147034..bceb8a8acf9a23d0d1df2d6749b94f4c
|
||||
bool opener_suppressed,
|
||||
bool* no_javascript_access) {
|
||||
diff --git a/content/web_test/browser/web_test_content_browser_client.h b/content/web_test/browser/web_test_content_browser_client.h
|
||||
index 78eafab336717b7ec8adab23b3bd8baace7b3e09..16cfe915177d812bce5738acf2b1991b7eb1aeb1 100644
|
||||
index a7f5f09f9f5147b565f5934c6b467c4a4c04b626..2d44bafc6a7c81f7189934c61d88a5bb3e921266 100644
|
||||
--- a/content/web_test/browser/web_test_content_browser_client.h
|
||||
+++ b/content/web_test/browser/web_test_content_browser_client.h
|
||||
@@ -94,6 +94,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient {
|
||||
|
||||
@@ -49,10 +49,10 @@ index ae7eab37f12ba80ec423d229cf048021e9ba6765..507a75dc7947295db221b01356fa57ba
|
||||
// These existing cases are "grandfathered in", but there shouldn't be more.
|
||||
// See comments atop class.
|
||||
diff --git a/ui/views/widget/widget_delegate.h b/ui/views/widget/widget_delegate.h
|
||||
index 7c2463cb91d00de2b0fa4f10221ea960be860d9a..0d5c63e7efbe42d5352abdeb594175904af30c41 100644
|
||||
index 7c2463cb91d00de2b0fa4f10221ea960be860d9a..e79beefddbd815e1ba7d9be86256e49d3ee7c619 100644
|
||||
--- a/ui/views/widget/widget_delegate.h
|
||||
+++ b/ui/views/widget/widget_delegate.h
|
||||
@@ -169,6 +169,13 @@ namespace data_controls {
|
||||
@@ -169,6 +169,12 @@ namespace data_controls {
|
||||
class DesktopDataControlsDialog;
|
||||
}
|
||||
|
||||
@@ -60,13 +60,12 @@ index 7c2463cb91d00de2b0fa4f10221ea960be860d9a..0d5c63e7efbe42d5352abdeb59417590
|
||||
+class AutofillPopupView;
|
||||
+class DevToolsWindowDelegate;
|
||||
+class NativeWindowMac;
|
||||
+class NativeWindowViews;
|
||||
+}
|
||||
+
|
||||
namespace enterprise_connectors {
|
||||
class ContentAnalysisDialog;
|
||||
class ContentAnalysisDialogBehaviorBrowserTest;
|
||||
@@ -371,6 +378,7 @@ class VIEWS_EXPORT WidgetDelegate {
|
||||
@@ -371,6 +377,7 @@ class VIEWS_EXPORT WidgetDelegate {
|
||||
|
||||
class OwnedByWidgetPassKey {
|
||||
private:
|
||||
@@ -74,16 +73,15 @@ index 7c2463cb91d00de2b0fa4f10221ea960be860d9a..0d5c63e7efbe42d5352abdeb59417590
|
||||
// DO NOT ADD TO THIS LIST!
|
||||
// These existing cases are "grandfathered in", but there shouldn't be more.
|
||||
// See comments atop `SetOwnedByWidget()`.
|
||||
@@ -468,6 +476,8 @@ class VIEWS_EXPORT WidgetDelegate {
|
||||
@@ -468,6 +475,7 @@ class VIEWS_EXPORT WidgetDelegate {
|
||||
};
|
||||
class RegisterDeleteCallbackPassKey {
|
||||
private:
|
||||
+ friend class electron::NativeWindowMac;
|
||||
+ friend class electron::NativeWindowViews;
|
||||
// DO NOT ADD TO THIS LIST!
|
||||
// These existing cases are "grandfathered in", but there shouldn't be more.
|
||||
// See comments atop `RegisterDeleteDelegateCallback()`.
|
||||
@@ -918,6 +928,7 @@ class VIEWS_EXPORT WidgetDelegateView : public WidgetDelegate, public View {
|
||||
@@ -918,6 +926,7 @@ class VIEWS_EXPORT WidgetDelegateView : public WidgetDelegate, public View {
|
||||
View* GetContentsView() override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -14,10 +14,10 @@ track down the source of this problem & figure out if we can fix it
|
||||
by changing something in Electron.
|
||||
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 4c30f71ced0da645637c989c08ccc93e463e755f..56b2fb93d5d85f520081de9e42e26ef3f8f6090e 100644
|
||||
index da05a4f28cc03bc555a99bd4e10097cd175b479c..dd94f88d353eb9291e2a64f0281e3fc1d53b68da 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -5045,7 +5045,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -5050,7 +5050,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
: IsGuest();
|
||||
// While some guest types do not have a guest SiteInstance, the ones that
|
||||
// don't all override WebContents creation above.
|
||||
|
||||
@@ -14,10 +14,10 @@ This change patches it out to prevent the DCHECK.
|
||||
It can be removed once/if we see a better solution to the problem.
|
||||
|
||||
diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc
|
||||
index adaa1cd426c138972b088d0d0093b0e1653af231..be4684c94ba2214255c5dbe9cdcf1ea316c60c06 100644
|
||||
index 4007e92316a6ac59145fa9bc021904fd1b3b0136..afedeaea7fd419f3374ffeebb7ee931219a90f93 100644
|
||||
--- a/content/browser/site_instance_impl.cc
|
||||
+++ b/content/browser/site_instance_impl.cc
|
||||
@@ -229,7 +229,7 @@ scoped_refptr<SiteInstanceImpl> SiteInstanceImpl::CreateForGuest(
|
||||
@@ -226,7 +226,7 @@ scoped_refptr<SiteInstanceImpl> SiteInstanceImpl::CreateForGuest(
|
||||
BrowserContext* browser_context,
|
||||
const StoragePartitionConfig& partition_config) {
|
||||
DCHECK(browser_context);
|
||||
|
||||
@@ -80,10 +80,10 @@ index 4fd8dff1089cd6afa6a66dc185734d7671657281..0a1f4268ea771a3d5d4a2668928c6e5d
|
||||
content::WebContents* source,
|
||||
const content::OpenURLParams& params,
|
||||
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
|
||||
index 435235c067f70f7f3d219dfc0bf91c9be40d1389..cc6c860ec51075fc047a77c26c5b42296bb6ab19 100644
|
||||
index de3f9f56b47628e1104b5f64b3c17cc35e10bfc7..3a19c28386fd3a0b8755a06510895c685f2c0cdb 100644
|
||||
--- a/chrome/browser/ui/browser.cc
|
||||
+++ b/chrome/browser/ui/browser.cc
|
||||
@@ -2323,12 +2323,11 @@ bool Browser::IsWebContentsCreationOverridden(
|
||||
@@ -2327,12 +2327,11 @@ bool Browser::IsWebContentsCreationOverridden(
|
||||
content::SiteInstance* source_site_instance,
|
||||
content::mojom::WindowContainerType window_container_type,
|
||||
const GURL& opener_url,
|
||||
@@ -99,10 +99,10 @@ index 435235c067f70f7f3d219dfc0bf91c9be40d1389..cc6c860ec51075fc047a77c26c5b4229
|
||||
|
||||
WebContents* Browser::CreateCustomWebContents(
|
||||
diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h
|
||||
index c4cea0b6e8c4c95ebcddf5497d731d1d63934f22..7686b75c5504d093dcd9dd8a7ffd28e0c2fd036c 100644
|
||||
index 0bcb2fc072e47c2c259b724209b4814486329fe1..db674988cf87f198ed1af7e0f4def24776fbaa89 100644
|
||||
--- a/chrome/browser/ui/browser.h
|
||||
+++ b/chrome/browser/ui/browser.h
|
||||
@@ -1026,8 +1026,7 @@ class Browser : public TabStripModelObserver,
|
||||
@@ -1027,8 +1027,7 @@ class Browser : public TabStripModelObserver,
|
||||
content::SiteInstance* source_site_instance,
|
||||
content::mojom::WindowContainerType window_container_type,
|
||||
const GURL& opener_url,
|
||||
@@ -218,10 +218,10 @@ index c6838c83ef971b88769b1f3fba8095025ae25464..2da6a4e08340e72ba7de5d03444c2f17
|
||||
content::WebContents* AddNewContents(
|
||||
content::WebContents* source,
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 7a8d7ce6f628123f5288d693046ca7602eeccac1..f73f2ac411c0af45d7c0a4ba94222b2bd1d4841c 100644
|
||||
index 5df2433b30213ba5683a864dcf42a07a5deb56e7..7500958c41904c61705d49f75b7a152005ce4890 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -5008,8 +5008,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -5013,8 +5013,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
// TODO(crbug.com/40202416): Support a way for MPArch guests to support this.
|
||||
if (delegate_ && delegate_->IsWebContentsCreationOverridden(
|
||||
source_site_instance, params.window_container_type,
|
||||
@@ -274,7 +274,7 @@ index 8d6fc67cb9b1d653bce64d1ba22aa7ec2d79257c..d5ce746373a1a4310e1eb530aee011a7
|
||||
|
||||
return true;
|
||||
diff --git a/extensions/browser/guest_view/app_view/app_view_guest.h b/extensions/browser/guest_view/app_view/app_view_guest.h
|
||||
index 136448c9df06b9704e95d2797a60907d7ec5170a..21cc7b08dd8f9e4a32d29dd35c42ec2ce9f6cd53 100644
|
||||
index 775cfbf5adac0017f343bc091daee1b8883c75bb..dc97e5d60d3663ef7f7c78c28603f9e1c5aea4ff 100644
|
||||
--- a/extensions/browser/guest_view/app_view/app_view_guest.h
|
||||
+++ b/extensions/browser/guest_view/app_view/app_view_guest.h
|
||||
@@ -10,6 +10,7 @@
|
||||
@@ -352,7 +352,7 @@ index 2dcf51f335f5dac39f431c3e0f56f8789f33d40b..2b433624d0604e0b9da5117b9e83cc15
|
||||
content::RenderFrameHost* opener,
|
||||
content::SiteInstance* source_site_instance,
|
||||
diff --git a/fuchsia_web/webengine/browser/frame_impl.cc b/fuchsia_web/webengine/browser/frame_impl.cc
|
||||
index 45c7aa83272dfa0d55ac3582a109b376184b389b..2841f550ac1724de4631aae0dd614e2ce3f522f5 100644
|
||||
index c10903a8e7e5fb66a1b038eab9015658a93672df..5a3afdb8ababf6e465c6166ca6229af7b4d6941d 100644
|
||||
--- a/fuchsia_web/webengine/browser/frame_impl.cc
|
||||
+++ b/fuchsia_web/webengine/browser/frame_impl.cc
|
||||
@@ -576,8 +576,7 @@ bool FrameImpl::IsWebContentsCreationOverridden(
|
||||
|
||||
@@ -39,10 +39,10 @@ index e87c180342b967756efeb701c73207fcee8754f1..42e37564e585987d367921568f0f1d2b
|
||||
NOTREACHED();
|
||||
}
|
||||
diff --git a/ui/base/accelerators/global_accelerator_listener/global_accelerator_listener_ozone.cc b/ui/base/accelerators/global_accelerator_listener/global_accelerator_listener_ozone.cc
|
||||
index c98ecc36007185052481b6479b2ba4608e326021..dd0e4553b78997beea0f11242eeb9f759359066f 100644
|
||||
index b6985bd63a34c55154fcfae601add6ce6c451704..fb44cc65b1a15c8b69410a2a2cb925a0326bb438 100644
|
||||
--- a/ui/base/accelerators/global_accelerator_listener/global_accelerator_listener_ozone.cc
|
||||
+++ b/ui/base/accelerators/global_accelerator_listener/global_accelerator_listener_ozone.cc
|
||||
@@ -111,7 +111,8 @@ bool GlobalAcceleratorListenerOzone::StartListeningForAccelerator(
|
||||
@@ -147,7 +147,8 @@ bool GlobalAcceleratorListenerOzone::StartListeningForAccelerator(
|
||||
const bool registered =
|
||||
platform_global_shortcut_listener_->RegisterAccelerator(
|
||||
accelerator.key_code(), accelerator.IsAltDown(),
|
||||
@@ -52,7 +52,7 @@ index c98ecc36007185052481b6479b2ba4608e326021..dd0e4553b78997beea0f11242eeb9f75
|
||||
if (registered) {
|
||||
registered_hot_keys_.insert(accelerator);
|
||||
}
|
||||
@@ -126,14 +127,15 @@ void GlobalAcceleratorListenerOzone::StopListeningForAccelerator(
|
||||
@@ -162,14 +163,15 @@ void GlobalAcceleratorListenerOzone::StopListeningForAccelerator(
|
||||
|
||||
platform_global_shortcut_listener_->UnregisterAccelerator(
|
||||
accelerator.key_code(), accelerator.IsAltDown(), accelerator.IsCtrlDown(),
|
||||
@@ -70,7 +70,7 @@ index c98ecc36007185052481b6479b2ba4608e326021..dd0e4553b78997beea0f11242eeb9f75
|
||||
int modifiers = 0;
|
||||
if (is_alt_down) {
|
||||
modifiers |= ui::EF_ALT_DOWN;
|
||||
@@ -144,6 +146,9 @@ void GlobalAcceleratorListenerOzone::OnKeyPressed(ui::KeyboardCode key_code,
|
||||
@@ -180,6 +182,9 @@ void GlobalAcceleratorListenerOzone::OnKeyPressed(ui::KeyboardCode key_code,
|
||||
if (is_shift_down) {
|
||||
modifiers |= ui::EF_SHIFT_DOWN;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ By default, chromium sets up one v8 snapshot to be used in all v8 contexts. This
|
||||
to have a dedicated browser process v8 snapshot defined by the file `browser_v8_context_snapshot.bin`.
|
||||
|
||||
diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc
|
||||
index a23d9b8fc451078708fd1a39f3d74357de7c244f..f619f8a360b43b43174647cd596ab9c75c8ea1f1 100644
|
||||
index d55c408557e15650897c9ed6d5b6bd83178a551f..f1c54919990af204004380b0d84ee750de5e3c35 100644
|
||||
--- a/content/app/content_main_runner_impl.cc
|
||||
+++ b/content/app/content_main_runner_impl.cc
|
||||
@@ -275,8 +275,13 @@ void AsanProcessInfoCB(const char*, bool*) {
|
||||
@@ -40,7 +40,7 @@ index a23d9b8fc451078708fd1a39f3d74357de7c244f..f619f8a360b43b43174647cd596ab9c7
|
||||
#endif // V8_USE_EXTERNAL_STARTUP_DATA
|
||||
}
|
||||
|
||||
@@ -982,7 +988,7 @@ int ContentMainRunnerImpl::Initialize(ContentMainParams params) {
|
||||
@@ -1005,7 +1011,7 @@ int ContentMainRunnerImpl::Initialize(ContentMainParams params) {
|
||||
return TerminateForFatalInitializationError();
|
||||
#endif // BUILDFLAG(IS_ANDROID) && (ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE)
|
||||
|
||||
|
||||
@@ -8,10 +8,10 @@ Allow registering custom protocols to handle service worker main script fetching
|
||||
Refs https://bugs.chromium.org/p/chromium/issues/detail?id=996511
|
||||
|
||||
diff --git a/content/browser/service_worker/service_worker_context_wrapper.cc b/content/browser/service_worker/service_worker_context_wrapper.cc
|
||||
index aa342545b9e629c4194b8da90380e612ede423d6..3ef48ead14bde84dac0207c1b9ceaf3abf1e637e 100644
|
||||
index b4c984e0dd22f148a426ce0ea04988798ed95aaa..5fd099b6396fc51d29fce2843531d5fc89642d35 100644
|
||||
--- a/content/browser/service_worker/service_worker_context_wrapper.cc
|
||||
+++ b/content/browser/service_worker/service_worker_context_wrapper.cc
|
||||
@@ -1971,6 +1971,26 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
|
||||
@@ -1961,6 +1961,26 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
|
||||
loader_factory_bundle_info =
|
||||
context()->loader_factory_bundle_for_update_check()->Clone();
|
||||
|
||||
@@ -38,7 +38,7 @@ index aa342545b9e629c4194b8da90380e612ede423d6..3ef48ead14bde84dac0207c1b9ceaf3a
|
||||
if (auto* config = content::WebUIConfigMap::GetInstance().GetConfig(
|
||||
browser_context(), scope)) {
|
||||
// If this is a Service Worker for a WebUI, the WebUI's URLDataSource
|
||||
@@ -1990,9 +2010,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
|
||||
@@ -1980,9 +2000,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
|
||||
features::kEnableServiceWorkersForChromeScheme) &&
|
||||
scope.scheme_piece() == kChromeUIScheme) {
|
||||
config->RegisterURLDataSource(browser_context());
|
||||
@@ -49,7 +49,7 @@ index aa342545b9e629c4194b8da90380e612ede423d6..3ef48ead14bde84dac0207c1b9ceaf3a
|
||||
.emplace(kChromeUIScheme, CreateWebUIServiceWorkerLoaderFactory(
|
||||
browser_context(), kChromeUIScheme,
|
||||
base::flat_set<std::string>()));
|
||||
@@ -2000,9 +2018,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
|
||||
@@ -1990,9 +2008,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
|
||||
features::kEnableServiceWorkersForChromeUntrusted) &&
|
||||
scope.scheme_piece() == kChromeUIUntrustedScheme) {
|
||||
config->RegisterURLDataSource(browser_context());
|
||||
|
||||
@@ -15,10 +15,10 @@ at some point be an API to "unfreeze" the flags, or we may be able to refactor
|
||||
node initialization to not update flags after V8 initialization.
|
||||
|
||||
diff --git a/content/renderer/render_process_impl.cc b/content/renderer/render_process_impl.cc
|
||||
index eb11068e932b7b94cbf215d6f84ae427ce77fcd5..9744e45974af215bfbe9e5feb2db7274f8efebf0 100644
|
||||
index 7a20f5199bd6cb5d13f31ec5db3e3cc03821bc3a..22167f808cb7b27d5b2a8e517cdeee63205ab9ad 100644
|
||||
--- a/content/renderer/render_process_impl.cc
|
||||
+++ b/content/renderer/render_process_impl.cc
|
||||
@@ -208,6 +208,9 @@ RenderProcessImpl::RenderProcessImpl()
|
||||
@@ -212,6 +212,9 @@ RenderProcessImpl::RenderProcessImpl()
|
||||
v8::V8::SetFlagsFromString(kSABPerContextFlag, sizeof(kSABPerContextFlag));
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ This patch temporarily disables the metrics so we can have green CI, and we
|
||||
should continue seeking for a real fix.
|
||||
|
||||
diff --git a/content/browser/renderer_host/navigator.cc b/content/browser/renderer_host/navigator.cc
|
||||
index ed7d7512c7112eedcbbddf30ed4a0a0cff4b7e34..fbdf54a1003f30e5113309fa74e851a4eebea85d 100644
|
||||
index 54ce1ea5ac11c9831a9553fbb5c5584c05440071..be95785fa144a4f11a3c97fea562dd4635ffe7b0 100644
|
||||
--- a/content/browser/renderer_host/navigator.cc
|
||||
+++ b/content/browser/renderer_host/navigator.cc
|
||||
@@ -1476,6 +1476,7 @@ void Navigator::RecordNavigationMetrics(
|
||||
|
||||
@@ -149,7 +149,7 @@ index 402355cb836cea14e9ee725a142a4bad44fd5bed..7e7f028dcfb87c7b80adebabac19ced8
|
||||
|
||||
void* FromV8Impl(v8::Isolate* isolate, v8::Local<v8::Value> val,
|
||||
diff --git a/gin/wrappable.h b/gin/wrappable.h
|
||||
index 4e7115685a5bf6997e78edcc1851e28bd00b1aa2..ca51fe33605e855438e88969e3d3cc734ef4523e 100644
|
||||
index 2ae2cf67157ce8b161ae917291a913d237b7d535..c8c8cbe84e946cebde97a71b42815c62ccaf7b96 100644
|
||||
--- a/gin/wrappable.h
|
||||
+++ b/gin/wrappable.h
|
||||
@@ -80,6 +80,13 @@ class GIN_EXPORT WrappableBase {
|
||||
|
||||
@@ -10,6 +10,8 @@ This CL adds support for the following features to //shell_dialogs:
|
||||
|
||||
It also:
|
||||
* Changes XDG Portal implementation behavior to set default path regardless of dialog type.
|
||||
* XDG Portal implementation calls into //electron to perform version checks on the dbus thread
|
||||
Refs https://github.com/electron/electron/issues/46652.
|
||||
|
||||
This may be partially upstreamed to Chromium in the future.
|
||||
|
||||
@@ -345,83 +347,52 @@ index 9d45ec49a4fb5e12407b65b83c1ba0c13cd0dfd8..400cce91b020ecd5e48566f125515d2c
|
||||
+
|
||||
} // namespace ui
|
||||
diff --git a/ui/shell_dialogs/select_file_dialog_linux_portal.cc b/ui/shell_dialogs/select_file_dialog_linux_portal.cc
|
||||
index b23d357d4e21f10be82f0ea37b1ec3e959fc2c0b..d29de35ac813cc68b1faa11e803ace9a78df74ba 100644
|
||||
index b23d357d4e21f10be82f0ea37b1ec3e959fc2c0b..e768afc05b42d4d026c88f1516d4e9db84e8dff6 100644
|
||||
--- a/ui/shell_dialogs/select_file_dialog_linux_portal.cc
|
||||
+++ b/ui/shell_dialogs/select_file_dialog_linux_portal.cc
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <string_view>
|
||||
|
||||
#include "base/check.h"
|
||||
+#include "base/command_line.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/logging.h"
|
||||
@@ -45,6 +46,8 @@ namespace {
|
||||
constexpr char kXdgPortalService[] = "org.freedesktop.portal.Desktop";
|
||||
constexpr char kXdgPortalObject[] = "/org/freedesktop/portal/desktop";
|
||||
|
||||
+// Version 4 includes support for current_folder option to the OpenFile method via
|
||||
+// https://github.com/flatpak/xdg-desktop-portal/commit/71165a5.
|
||||
constexpr int kXdgPortalRequiredVersion = 3;
|
||||
|
||||
constexpr char kFileChooserInterfaceName[] =
|
||||
@@ -66,6 +69,8 @@ constexpr uint32_t kFileChooserFilterKindGlob = 0;
|
||||
|
||||
constexpr char kFileUriPrefix[] = "file://";
|
||||
|
||||
+const char kXdgPortalRequiredVersionFlag[] = "xdg-portal-required-version";
|
||||
+
|
||||
enum class ServiceAvailability {
|
||||
kNotStarted,
|
||||
kInProgress,
|
||||
@@ -75,6 +80,9 @@ enum class ServiceAvailability {
|
||||
|
||||
ServiceAvailability g_service_availability = ServiceAvailability::kNotStarted;
|
||||
|
||||
+uint32_t g_available_portal_version = 0;
|
||||
+uint32_t g_required_portal_version = kXdgPortalRequiredVersion;
|
||||
+
|
||||
scoped_refptr<base::SequencedTaskRunner>& GetMainTaskRunner() {
|
||||
static base::NoDestructor<scoped_refptr<base::SequencedTaskRunner>>
|
||||
main_task_runner;
|
||||
@@ -94,9 +102,10 @@ void OnGetPropertyReply(dbus::Response* response) {
|
||||
return;
|
||||
}
|
||||
|
||||
- g_service_availability = version >= kXdgPortalRequiredVersion
|
||||
+ g_service_availability = version >= g_required_portal_version
|
||||
? ServiceAvailability::kAvailable
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "dbus/message.h"
|
||||
#include "dbus/object_path.h"
|
||||
#include "dbus/object_proxy.h"
|
||||
+#include "electron/shell/browser/ui/file_dialog.h"
|
||||
#include "ui/aura/window_tree_host.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
#include "ui/gfx/native_widget_types.h"
|
||||
@@ -99,7 +100,7 @@ void OnGetPropertyReply(dbus::Response* response) {
|
||||
: ServiceAvailability::kNotAvailable;
|
||||
+ g_available_portal_version = version;
|
||||
}
|
||||
|
||||
void OnServiceStarted(std::optional<bool> service_started) {
|
||||
@@ -164,6 +173,12 @@ void SelectFileDialogLinuxPortal::StartAvailabilityTestInBackground() {
|
||||
}
|
||||
g_service_availability = ServiceAvailability::kInProgress;
|
||||
-void OnServiceStarted(std::optional<bool> service_started) {
|
||||
+[[maybe_unused]] void OnServiceStarted(std::optional<bool> service_started) {
|
||||
if (!service_started.value_or(false)) {
|
||||
g_service_availability = ServiceAvailability::kNotAvailable;
|
||||
return;
|
||||
@@ -166,18 +167,24 @@ void SelectFileDialogLinuxPortal::StartAvailabilityTestInBackground() {
|
||||
|
||||
+ auto* cmd = base::CommandLine::ForCurrentProcess();
|
||||
+ if (!base::StringToUint(cmd->GetSwitchValueASCII(kXdgPortalRequiredVersionFlag),
|
||||
+ &g_required_portal_version)) {
|
||||
+ g_required_portal_version = kXdgPortalRequiredVersion;
|
||||
+ }
|
||||
+
|
||||
GetMainTaskRunner() = base::SequencedTaskRunner::GetCurrentDefault();
|
||||
|
||||
+#if 0
|
||||
dbus_utils::CheckForServiceAndStart(dbus_thread_linux::GetSharedSessionBus(),
|
||||
@@ -180,6 +195,11 @@ bool SelectFileDialogLinuxPortal::IsPortalAvailable() {
|
||||
return g_service_availability == ServiceAvailability::kAvailable;
|
||||
kXdgPortalService,
|
||||
base::BindOnce(&OnServiceStarted));
|
||||
+#endif
|
||||
+ file_dialog::StartPortalAvailabilityTestInBackground();
|
||||
}
|
||||
|
||||
// static
|
||||
bool SelectFileDialogLinuxPortal::IsPortalAvailable() {
|
||||
+#if 0
|
||||
if (g_service_availability == ServiceAvailability::kInProgress) {
|
||||
LOG(WARNING) << "Portal availability checked before test was complete";
|
||||
}
|
||||
|
||||
return g_service_availability == ServiceAvailability::kAvailable;
|
||||
+#endif
|
||||
+ return file_dialog::IsPortalAvailable();
|
||||
}
|
||||
|
||||
+// static
|
||||
+uint32_t SelectFileDialogLinuxPortal::GetPortalVersion() {
|
||||
+ return g_available_portal_version;
|
||||
+}
|
||||
+
|
||||
bool SelectFileDialogLinuxPortal::IsRunning(
|
||||
gfx::NativeWindow parent_window) const {
|
||||
return parent_window && host_ && host_.get() == parent_window->GetHost();
|
||||
@@ -382,11 +402,14 @@ DbusDictionary SelectFileDialogLinuxPortal::BuildOptionsDictionary(
|
||||
@@ -382,11 +389,14 @@ DbusDictionary SelectFileDialogLinuxPortal::BuildOptionsDictionary(
|
||||
const PortalFilterSet& filter_set) {
|
||||
DbusDictionary dict;
|
||||
|
||||
@@ -439,7 +410,7 @@ index b23d357d4e21f10be82f0ea37b1ec3e959fc2c0b..d29de35ac813cc68b1faa11e803ace9a
|
||||
[[fallthrough]];
|
||||
case SelectFileDialog::SELECT_FOLDER:
|
||||
case SelectFileDialog::Type::SELECT_EXISTING_FOLDER:
|
||||
@@ -399,6 +422,10 @@ DbusDictionary SelectFileDialogLinuxPortal::BuildOptionsDictionary(
|
||||
@@ -399,6 +409,10 @@ DbusDictionary SelectFileDialogLinuxPortal::BuildOptionsDictionary(
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -450,17 +421,3 @@ index b23d357d4e21f10be82f0ea37b1ec3e959fc2c0b..d29de35ac813cc68b1faa11e803ace9a
|
||||
if (!default_path.empty()) {
|
||||
if (default_path_exists) {
|
||||
// If this is an existing directory, navigate to that directory, with no
|
||||
diff --git a/ui/shell_dialogs/select_file_dialog_linux_portal.h b/ui/shell_dialogs/select_file_dialog_linux_portal.h
|
||||
index 651684b1840eaff664f3d73d99bbea40e097c866..9a9d541f1e9586d9d545f8547d3f09ff33dce48d 100644
|
||||
--- a/ui/shell_dialogs/select_file_dialog_linux_portal.h
|
||||
+++ b/ui/shell_dialogs/select_file_dialog_linux_portal.h
|
||||
@@ -45,6 +45,9 @@ class SelectFileDialogLinuxPortal : public SelectFileDialogLinux {
|
||||
// availability test has not yet completed.
|
||||
static bool IsPortalAvailable();
|
||||
|
||||
+ // Get version of portal if available.
|
||||
+ static uint32_t GetPortalVersion();
|
||||
+
|
||||
protected:
|
||||
~SelectFileDialogLinuxPortal() override;
|
||||
|
||||
|
||||
@@ -187,7 +187,7 @@ index 96c9563aac5847e742de5d9c9236f78bcb6cfd9c..73c9d585579ad5bdc407687b8becd0b7
|
||||
host->GetChildProcess()->BindServiceInterface(std::move(receiver));
|
||||
}
|
||||
diff --git a/content/browser/service_host/utility_process_host.cc b/content/browser/service_host/utility_process_host.cc
|
||||
index 9e01e61bf1fce448a93eaa3d5f363fc835b78538..d210af6fb317c922a8415a67a7ccd1d8a4a88ea1 100644
|
||||
index e2c72b43f75b57ef1f49b82d3ecdfb425f8596de..51f8ff9b8424d098979a24c2e8628cdf7c4b758d 100644
|
||||
--- a/content/browser/service_host/utility_process_host.cc
|
||||
+++ b/content/browser/service_host/utility_process_host.cc
|
||||
@@ -190,11 +190,13 @@ const ChildProcessData& UtilityProcessHost::GetData() {
|
||||
|
||||
@@ -307,7 +307,7 @@ index 2c2f4f405074e5baa4a26f255283404f86b40e21..ebeb7d6988ee9e6a4e78cb82fc01fdad
|
||||
|
||||
ContouredRect PixelSnappedContouredBorderInternal(
|
||||
diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/renderer/platform/BUILD.gn
|
||||
index 6718aad4a16cd99c8dd7118ca62cebd29ffbfe97..39d426936b266d8f44ab8a614a48247462ceea2d 100644
|
||||
index b5a309cb7bad79f80fb43dcbcccbd8dc2fcdfef8..c90d8f2f283e9bd05184171d3971d0060731f67d 100644
|
||||
--- a/third_party/blink/renderer/platform/BUILD.gn
|
||||
+++ b/third_party/blink/renderer/platform/BUILD.gn
|
||||
@@ -1658,6 +1658,8 @@ component("platform") {
|
||||
|
||||
@@ -90,7 +90,7 @@ index 8af69cac78b7488d28f1f05ccb174793fe5148cd..9f74e511c263d147b5fbe81fe100d217
|
||||
private:
|
||||
const HWND hwnd_;
|
||||
diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn
|
||||
index d29bdc038fc6934c69b10b7a694d9cbf54839b02..6cc09172e0975387d614f67350215c80915c406d 100644
|
||||
index 3c43af49c5d6d5f604c71e9a9dc1f7afe9aaf0f7..857e422776e7ec33eaf4c9983d42d6433b7723cc 100644
|
||||
--- a/components/viz/service/BUILD.gn
|
||||
+++ b/components/viz/service/BUILD.gn
|
||||
@@ -178,6 +178,8 @@ viz_component("service") {
|
||||
@@ -522,7 +522,7 @@ index f0aca972c4a81c3dfb536e14244daafae21ee716..a15afbc1a3519e657121b4952444d2f4
|
||||
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 ed921225298fbb4f6d12d7c49be825ee586d009c..78a393d96ddf4dc3bf8d1af297ed2642eacac495 100644
|
||||
index 391004b202e6f20ad06eb6a53a6d55f5e8981c75..acb849f4e737de45e7aa4640b6866791424f010b 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
|
||||
@@ -130,7 +130,8 @@ RootCompositorFrameSinkImpl::Create(
|
||||
|
||||
@@ -80,7 +80,7 @@ index 801db538979ba62facdcf3a472dade56723ca639..7abac9a5b13b393713534ae51664c2e5
|
||||
private:
|
||||
const std::string service_interface_name_;
|
||||
diff --git a/content/browser/service_host/utility_process_host.cc b/content/browser/service_host/utility_process_host.cc
|
||||
index d210af6fb317c922a8415a67a7ccd1d8a4a88ea1..0de01879f618555030e87ea79a94d41232811c2c 100644
|
||||
index 51f8ff9b8424d098979a24c2e8628cdf7c4b758d..19d8ed89211402e93632c4d83dbf452d4194a14c 100644
|
||||
--- a/content/browser/service_host/utility_process_host.cc
|
||||
+++ b/content/browser/service_host/utility_process_host.cc
|
||||
@@ -541,7 +541,7 @@ void UtilityProcessHost::OnProcessCrashed(int exit_code) {
|
||||
|
||||
@@ -78,7 +78,7 @@ index 3d388a85aaf52acdcc2b7aaea56f5a24b2435bff..7a0d28cbf1651e76a4356f1193b502d2
|
||||
}
|
||||
|
||||
diff --git a/crypto/apple_keychain.h b/crypto/apple_keychain.h
|
||||
index c2aeebc449c7cc2d2e2fcd30dde3e8b9732aa0b3..4acd945d31cb6cb5f3c74548ef9b9cc23ee80205 100644
|
||||
index bcff49c4bcee4a67b97172c3abc12dedda1eedda..43e0b9f8b421a1c0dc62cc2d66b6fdd0eae496ce 100644
|
||||
--- a/crypto/apple_keychain.h
|
||||
+++ b/crypto/apple_keychain.h
|
||||
@@ -18,6 +18,12 @@
|
||||
@@ -94,35 +94,65 @@ index c2aeebc449c7cc2d2e2fcd30dde3e8b9732aa0b3..4acd945d31cb6cb5f3c74548ef9b9cc2
|
||||
// DEPRECATED: use `AppleKeychainV2` instead.
|
||||
// Wraps the KeychainServices API in a very thin layer, to allow it to be
|
||||
// mocked out for testing.
|
||||
@@ -43,11 +49,16 @@ class CRYPTO_EXPORT AppleKeychain {
|
||||
@@ -46,13 +52,18 @@ class CRYPTO_EXPORT AppleKeychain {
|
||||
// std::vector<uint8_t> arm is populated instead.
|
||||
virtual base::expected<std::vector<uint8_t>, OSStatus> FindGenericPassword(
|
||||
std::string_view service_name,
|
||||
- std::string_view account_name) const;
|
||||
- std::string_view account_name) const = 0;
|
||||
+ std::string_view account_name,
|
||||
+ AppleSecKeychainItemRef* item = nullptr) const;
|
||||
+ AppleSecKeychainItemRef* item = nullptr) const = 0;
|
||||
|
||||
virtual OSStatus AddGenericPassword(
|
||||
std::string_view service_name,
|
||||
std::string_view account_name,
|
||||
base::span<const uint8_t> password) const = 0;
|
||||
|
||||
virtual OSStatus AddGenericPassword(std::string_view service_name,
|
||||
std::string_view account_name,
|
||||
base::span<const uint8_t> password) const;
|
||||
+
|
||||
+#if BUILDFLAG(IS_MAC)
|
||||
+ virtual OSStatus ItemDelete(AppleSecKeychainItemRef item) const;
|
||||
+#endif // !BUILDFLAG(IS_MAC)
|
||||
+
|
||||
protected:
|
||||
AppleKeychain();
|
||||
};
|
||||
diff --git a/crypto/apple_keychain_secitem.h b/crypto/apple_keychain_secitem.h
|
||||
index 1632c22c669607f9da8b4fe7783ee716c6467f6e..3f0e3e0af568627a0aae352a65be4cc7d5d40802 100644
|
||||
--- a/crypto/apple_keychain_secitem.h
|
||||
+++ b/crypto/apple_keychain_secitem.h
|
||||
@@ -17,7 +17,8 @@ class CRYPTO_EXPORT AppleKeychainSecItem : public AppleKeychain {
|
||||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
diff --git a/crypto/apple_keychain_mac.cc b/crypto/apple_keychain_mac.cc
|
||||
index 0613e22fc0ce35378dc3580d797badd5f2680ae6..3ec4a2ba2fa5679363fabfa007be6200a0660ce7 100644
|
||||
--- a/crypto/apple_keychain_mac.cc
|
||||
+++ b/crypto/apple_keychain_mac.cc
|
||||
@@ -58,14 +58,15 @@ AppleKeychain::~AppleKeychain() = default;
|
||||
base::expected<std::vector<uint8_t>, OSStatus> FindGenericPassword(
|
||||
std::string_view service_name,
|
||||
- std::string_view account_name) const override;
|
||||
+ std::string_view account_name,
|
||||
+ AppleSecKeychainItemRef* item) const override;
|
||||
|
||||
OSStatus AddGenericPassword(
|
||||
std::string_view service_name,
|
||||
diff --git a/crypto/apple_keychain_secitem.mm b/crypto/apple_keychain_secitem.mm
|
||||
index 12b400a1f2d6c11bc4ac67d0a2c98984d0be24e0..1abb4623bfabacbca34068113fac2030fea2c065 100644
|
||||
--- a/crypto/apple_keychain_secitem.mm
|
||||
+++ b/crypto/apple_keychain_secitem.mm
|
||||
@@ -118,7 +118,8 @@
|
||||
|
||||
base::expected<std::vector<uint8_t>, OSStatus>
|
||||
AppleKeychain::FindGenericPassword(std::string_view service_name,
|
||||
- std::string_view account_name) const {
|
||||
+ std::string_view account_name,
|
||||
+ AppleSecKeychainItemRef* item) const {
|
||||
AppleKeychainSecItem::FindGenericPassword(std::string_view service_name,
|
||||
- std::string_view account_name) const {
|
||||
+ std::string_view account_name,
|
||||
+ AppleSecKeychainItemRef* item) const {
|
||||
base::apple::ScopedCFTypeRef<CFDictionaryRef> query =
|
||||
MakeGenericPasswordQuery(service_name, account_name);
|
||||
|
||||
diff --git a/crypto/apple_keychain_seckeychain.cc b/crypto/apple_keychain_seckeychain.cc
|
||||
index 3fa4feac6de46a65bcb306329d0fc923525330ed..61a90e531c7cf8060425bf1cde571818d2da7979 100644
|
||||
--- a/crypto/apple_keychain_seckeychain.cc
|
||||
+++ b/crypto/apple_keychain_seckeychain.cc
|
||||
@@ -59,14 +59,15 @@ AppleKeychainSecKeychain::~AppleKeychainSecKeychain() = default;
|
||||
base::expected<std::vector<uint8_t>, OSStatus>
|
||||
AppleKeychainSecKeychain::FindGenericPassword(
|
||||
std::string_view service_name,
|
||||
- std::string_view account_name) const {
|
||||
+ std::string_view account_name,
|
||||
+ AppleSecKeychainItemRef* item) const {
|
||||
base::AutoLock lock(GetMacSecurityServicesLock());
|
||||
uint32_t password_length = 0;
|
||||
void* password_data = nullptr;
|
||||
@@ -134,7 +164,7 @@ index 0613e22fc0ce35378dc3580d797badd5f2680ae6..3ec4a2ba2fa5679363fabfa007be6200
|
||||
if (status != noErr) {
|
||||
return base::unexpected(status);
|
||||
}
|
||||
@@ -91,6 +92,11 @@ OSStatus AppleKeychain::AddGenericPassword(
|
||||
@@ -92,6 +93,11 @@ OSStatus AppleKeychainSecKeychain::AddGenericPassword(
|
||||
password.data(), nullptr);
|
||||
}
|
||||
|
||||
@@ -146,11 +176,25 @@ index 0613e22fc0ce35378dc3580d797badd5f2680ae6..3ec4a2ba2fa5679363fabfa007be6200
|
||||
ScopedKeychainUserInteractionAllowed::ScopedKeychainUserInteractionAllowed(
|
||||
Boolean allowed,
|
||||
OSStatus* status) {
|
||||
diff --git a/crypto/apple_keychain_seckeychain.h b/crypto/apple_keychain_seckeychain.h
|
||||
index ecf5e229c8f05a27574b635abc9c781d175c1773..6afb09c59011035337a287783bbef0c6b7d29d9a 100644
|
||||
--- a/crypto/apple_keychain_seckeychain.h
|
||||
+++ b/crypto/apple_keychain_seckeychain.h
|
||||
@@ -20,7 +20,8 @@ class CRYPTO_EXPORT AppleKeychainSecKeychain : public AppleKeychain {
|
||||
|
||||
base::expected<std::vector<uint8_t>, OSStatus> FindGenericPassword(
|
||||
std::string_view service_name,
|
||||
- std::string_view account_name) const override;
|
||||
+ std::string_view account_name,
|
||||
+ AppleSecKeychainItemRef* item) const override;
|
||||
|
||||
OSStatus AddGenericPassword(
|
||||
std::string_view service_name,
|
||||
diff --git a/crypto/mock_apple_keychain.cc b/crypto/mock_apple_keychain.cc
|
||||
index 9b48805aacd161ff8d5550edf993217d5c6acfad..3b9fa4dc7f020740edb55a5aa80c9b526e4f585b 100644
|
||||
index d766dc41299f32bc766e4efce5925c93f21b60c5..7f09d477ba152cbca798f3ef7a213786cc95a338 100644
|
||||
--- a/crypto/mock_apple_keychain.cc
|
||||
+++ b/crypto/mock_apple_keychain.cc
|
||||
@@ -30,7 +30,8 @@ MockAppleKeychain::~MockAppleKeychain() = default;
|
||||
@@ -32,7 +32,8 @@ MockAppleKeychain::~MockAppleKeychain() = default;
|
||||
|
||||
base::expected<std::vector<uint8_t>, OSStatus>
|
||||
MockAppleKeychain::FindGenericPassword(std::string_view service_name,
|
||||
|
||||
@@ -112,10 +112,10 @@ index 99bf736ebe303d46ab1ced924ba929a0cd258909..e10c8782d2704ff9cff8062d201a4339
|
||||
string mime_type;
|
||||
|
||||
diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc
|
||||
index 937a7b2ba05c11514d2d980a6fb2eaa9102c2774..6ffe746744beccbf224ad1a36ad102da5164580f 100644
|
||||
index 35d3acb1a088a7b4cba7b062a62e8033c31dfe52..9770306449b39f26c047ed0c15cba9feae55c5d3 100644
|
||||
--- a/services/network/url_loader.cc
|
||||
+++ b/services/network/url_loader.cc
|
||||
@@ -387,6 +387,9 @@ URLLoader::URLLoader(
|
||||
@@ -386,6 +386,9 @@ URLLoader::URLLoader(
|
||||
mojo::SimpleWatcher::ArmingPolicy::MANUAL,
|
||||
base::SequencedTaskRunner::GetCurrentDefault()),
|
||||
per_factory_orb_state_(context.GetMutableOrbState()),
|
||||
@@ -125,7 +125,7 @@ index 937a7b2ba05c11514d2d980a6fb2eaa9102c2774..6ffe746744beccbf224ad1a36ad102da
|
||||
devtools_request_id_(request.devtools_request_id),
|
||||
options_(PopulateOptions(options,
|
||||
factory_params_->is_orb_enabled,
|
||||
@@ -544,7 +547,7 @@ void URLLoader::SetUpUrlRequestCallbacks(
|
||||
@@ -521,7 +524,7 @@ void URLLoader::SetUpUrlRequestCallbacks(
|
||||
&URLLoader::IsSharedDictionaryReadAllowed, base::Unretained(this)));
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ index 937a7b2ba05c11514d2d980a6fb2eaa9102c2774..6ffe746744beccbf224ad1a36ad102da
|
||||
url_request_->SetResponseHeadersCallback(base::BindRepeating(
|
||||
&URLLoader::SetRawResponseHeaders, base::Unretained(this)));
|
||||
}
|
||||
@@ -1225,6 +1228,19 @@ void URLLoader::OnResponseStarted(net::URLRequest* url_request, int net_error) {
|
||||
@@ -1126,6 +1129,19 @@ void URLLoader::OnResponseStarted(net::URLRequest* url_request, int net_error) {
|
||||
}
|
||||
|
||||
response_ = BuildResponseHead();
|
||||
@@ -155,10 +155,10 @@ index 937a7b2ba05c11514d2d980a6fb2eaa9102c2774..6ffe746744beccbf224ad1a36ad102da
|
||||
|
||||
ad_auction_event_record_request_helper_.HandleResponse(
|
||||
diff --git a/services/network/url_loader.h b/services/network/url_loader.h
|
||||
index 6832aca0d487d5cbf2fc445f1f07a17565cf9d45..78618a2c3d79455ff685d58d11b61d3d8468b7e1 100644
|
||||
index f4d16508d4a34f9991b1b2f4e519e6cb2a7f5a73..099e146bc04bb4eb768c79099c5646ad7a029382 100644
|
||||
--- a/services/network/url_loader.h
|
||||
+++ b/services/network/url_loader.h
|
||||
@@ -625,6 +625,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
|
||||
@@ -599,6 +599,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
|
||||
std::unique_ptr<ResourceScheduler::ScheduledResourceRequest>
|
||||
resource_scheduler_request_handle_;
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ index 0aae1d3b2777d5f6db711d1ade99b4bde24e76bf..e350f6789c710826e0885ccdc19e66e2
|
||||
break;
|
||||
}
|
||||
diff --git a/content/browser/permissions/permission_controller_impl.cc b/content/browser/permissions/permission_controller_impl.cc
|
||||
index f53158596f935545afde6a175138347a752f73e7..b267734bf2273253aa921728e12c753adfade02e 100644
|
||||
index bc4dd4c643f2aa4cba07c0560e14f65f3c6aa291..b1c9f2d59559ed33cd32ad1f22b221029018cf0f 100644
|
||||
--- a/content/browser/permissions/permission_controller_impl.cc
|
||||
+++ b/content/browser/permissions/permission_controller_impl.cc
|
||||
@@ -87,6 +87,7 @@ PermissionToSchedulingFeature(PermissionType permission_name) {
|
||||
|
||||
@@ -28,10 +28,10 @@ The patch should be removed in favor of either:
|
||||
Upstream bug https://bugs.chromium.org/p/chromium/issues/detail?id=1081397.
|
||||
|
||||
diff --git a/content/browser/renderer_host/navigation_request.cc b/content/browser/renderer_host/navigation_request.cc
|
||||
index 4c78563c29ce92c8217d288ed03f73fb482c6b49..aee0097df986cb4b3b75112fab828c59803e28d1 100644
|
||||
index dccc2e00d6bc52d25d35dbee95898a03960da28f..c3baeec8bbec12e4cb4d85413b77830d344b622c 100644
|
||||
--- a/content/browser/renderer_host/navigation_request.cc
|
||||
+++ b/content/browser/renderer_host/navigation_request.cc
|
||||
@@ -11159,6 +11159,12 @@ NavigationRequest::GetOriginForURLLoaderFactoryUncheckedWithDebugInfo() {
|
||||
@@ -11107,6 +11107,12 @@ NavigationRequest::GetOriginForURLLoaderFactoryUncheckedWithDebugInfo() {
|
||||
"blob");
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ messages in the legacy window handle layer.
|
||||
These conditions are regularly hit with WCO-enabled windows on Windows.
|
||||
|
||||
diff --git a/content/browser/renderer_host/legacy_render_widget_host_win.cc b/content/browser/renderer_host/legacy_render_widget_host_win.cc
|
||||
index c6e88cee8640c56aad01721ab667b4255bd64a60..2742df0532c890fe97adf4a0c430c7718e5e73b5 100644
|
||||
index 1c03162fbcda8ab75dcd53722f92e10403fbae08..a21c58d3f13fadf3a7888f4fe16c0e6cf6c215b0 100644
|
||||
--- a/content/browser/renderer_host/legacy_render_widget_host_win.cc
|
||||
+++ b/content/browser/renderer_host/legacy_render_widget_host_win.cc
|
||||
@@ -328,12 +328,12 @@ LRESULT LegacyRenderWidgetHostHWND::OnMouseRange(UINT message,
|
||||
|
||||
@@ -87,10 +87,10 @@ index 75df43e3cd2721a92c90c18154d53d5c203e2465..ce42c75c8face36d21f53f44c0201ac4
|
||||
// The view with active text input state, i.e., a focused <input> element.
|
||||
// It will be nullptr if no such view exists. Note that the active view
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 3b9e634245986b1ef22e8bf4e116470343f5ff60..4c30f71ced0da645637c989c08ccc93e463e755f 100644
|
||||
index c34bcb4f4a6ac03b4e3a6c87c3ac29e4450ffa71..da05a4f28cc03bc555a99bd4e10097cd175b479c 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -9992,7 +9992,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame(
|
||||
@@ -9972,7 +9972,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame(
|
||||
"WebContentsImpl::OnFocusedElementChangedInFrame",
|
||||
"render_frame_host", frame);
|
||||
RenderWidgetHostViewBase* root_view =
|
||||
|
||||
@@ -20,10 +20,10 @@ index fc9cb7e68bdad4c40fab63f70243e09ad005ab80..199fbceda530da31aab9126d78b4bd21
|
||||
injector_->ExpectsResults(), injector_->ShouldWaitForPromise());
|
||||
}
|
||||
diff --git a/third_party/blink/public/web/web_local_frame.h b/third_party/blink/public/web/web_local_frame.h
|
||||
index 7934e6a8a2498acbe822df05e6087b885384c6d7..3026ebee29af3ead9f505292317160409a190b29 100644
|
||||
index 6ea4a0f04eab4e85ec4c9b67f50c5c4e5c6e01e1..5f055fe422904c95e05af5cb0e92241a5d9d53c1 100644
|
||||
--- a/third_party/blink/public/web/web_local_frame.h
|
||||
+++ b/third_party/blink/public/web/web_local_frame.h
|
||||
@@ -460,6 +460,7 @@ class BLINK_EXPORT WebLocalFrame : public WebFrame {
|
||||
@@ -461,6 +461,7 @@ class BLINK_EXPORT WebLocalFrame : public WebFrame {
|
||||
mojom::EvaluationTiming,
|
||||
mojom::LoadEventBlockingOption,
|
||||
WebScriptExecutionCallback,
|
||||
@@ -59,7 +59,7 @@ index cba373664bec3a32abad6fe0396bd67b53b7e67f..a54f1b3351efd2d8f324436f7f35cd43
|
||||
|
||||
#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 fbfd4d96e8082df8c5db5d354ac7c39bc329d4ee..c8be9f437cc19668f8349e8777135e66a67fb9cb 100644
|
||||
index dd148eb3cce762d20e9117b4f8030c881057b8bb..e626d63f295b2d0fa62b179c76c45df125bbaeeb 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
@@ -3113,6 +3113,7 @@ void LocalFrame::RequestExecuteScript(
|
||||
@@ -215,10 +215,10 @@ index 5e12b61ba14cd1afb07b71ff15e73e905da0addc..685a2ebb6694c173471d045014932125
|
||||
mojom::blink::WantResultOption::kWantResult, wait_for_promise);
|
||||
}
|
||||
diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
|
||||
index f5adaadb9058e5fcad69d131f54ea06cb298b514..3315b02953685503d49a7e871fedf04262e80b71 100644
|
||||
index dd0c441d45ebb30c5a32822365f2ebe273b8cd16..164daddaccb84a28cf4bd387f382afddfc2613d3 100644
|
||||
--- a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
|
||||
@@ -1109,14 +1109,15 @@ void WebLocalFrameImpl::RequestExecuteScript(
|
||||
@@ -1111,14 +1111,15 @@ void WebLocalFrameImpl::RequestExecuteScript(
|
||||
mojom::blink::EvaluationTiming evaluation_timing,
|
||||
mojom::blink::LoadEventBlockingOption blocking_option,
|
||||
WebScriptExecutionCallback callback,
|
||||
@@ -237,10 +237,10 @@ index f5adaadb9058e5fcad69d131f54ea06cb298b514..3315b02953685503d49a7e871fedf042
|
||||
|
||||
bool WebLocalFrameImpl::IsInspectorConnected() {
|
||||
diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.h b/third_party/blink/renderer/core/frame/web_local_frame_impl.h
|
||||
index 1b5e7a1a2bb5eb0b986dd6c61b4915d29a9a5667..19c8fdb320cbc84ba00b5e0b4b33a385b61b0db1 100644
|
||||
index 87d933b2e413f404a9b80480bdf676eb0c8a2bfa..17329fb46c0d19645ad5411bbfba33dadfea4529 100644
|
||||
--- a/third_party/blink/renderer/core/frame/web_local_frame_impl.h
|
||||
+++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.h
|
||||
@@ -196,6 +196,7 @@ class CORE_EXPORT WebLocalFrameImpl final
|
||||
@@ -198,6 +198,7 @@ class CORE_EXPORT WebLocalFrameImpl final
|
||||
mojom::blink::EvaluationTiming,
|
||||
mojom::blink::LoadEventBlockingOption,
|
||||
WebScriptExecutionCallback,
|
||||
@@ -249,10 +249,10 @@ index 1b5e7a1a2bb5eb0b986dd6c61b4915d29a9a5667..19c8fdb320cbc84ba00b5e0b4b33a385
|
||||
mojom::blink::WantResultOption,
|
||||
mojom::blink::PromiseResultOption) override;
|
||||
diff --git a/third_party/blink/renderer/core/scheduler_integration_tests/virtual_time_test.cc b/third_party/blink/renderer/core/scheduler_integration_tests/virtual_time_test.cc
|
||||
index 4eb146c0798514e9201f2d68dcfebfacc82b97ea..27398228f87982e5c53476d5dee13fde5a6fa64e 100644
|
||||
index 5e66719cf6d8170039c011ad03d56ea55ee8f2cb..5a71dd5172c88aed1498dea02f790a7f278ac174 100644
|
||||
--- a/third_party/blink/renderer/core/scheduler_integration_tests/virtual_time_test.cc
|
||||
+++ b/third_party/blink/renderer/core/scheduler_integration_tests/virtual_time_test.cc
|
||||
@@ -63,6 +63,7 @@ class VirtualTimeTest : public SimTest {
|
||||
@@ -59,6 +59,7 @@ class VirtualTimeTest : public SimTest {
|
||||
mojom::blink::LoadEventBlockingOption::kDoNotBlock,
|
||||
WTF::BindOnce(&ScriptExecutionCallbackHelper::Completed,
|
||||
base::Unretained(&callback_helper)),
|
||||
|
||||
@@ -6,14 +6,16 @@ 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 a777b6b4c61c24cd2885134cccd5ada7d035cd5e..1a41b716ce5366497e60a691c23c7e62627b5748 100644
|
||||
index d3e06148b22f06e6676bcda5fd8907595389887e..35f22b679494940ae1b1d64fa4eb17c41c0cc623 100644
|
||||
--- a/ui/views/controls/menu/menu_controller.cc
|
||||
+++ b/ui/views/controls/menu/menu_controller.cc
|
||||
@@ -701,6 +701,14 @@ void MenuController::Run(Widget* parent,
|
||||
@@ -711,6 +711,16 @@ void MenuController::Run(Widget* parent,
|
||||
SetSelection(root, SELECTION_OPEN_SUBMENU | SELECTION_UPDATE_IMMEDIATELY);
|
||||
}
|
||||
|
||||
+ if (source_type == ui::mojom::MenuSourceType::kKeyboard && context_menu && root->HasSubmenu()) {
|
||||
+ if (source_type == ui::mojom::MenuSourceType::kKeyboard &&
|
||||
+ (menu_type == MenuType::kContextMenu || menu_type == MenuType::kMenuItemContextMenu) &&
|
||||
+ root->HasSubmenu()) {
|
||||
+ // For context menus opened via the keyboard we select the first item by default
|
||||
+ // to match accessibility expectations
|
||||
+ MenuItemView* first_item = FindInitialSelectableMenuItem(root, INCREMENT_SELECTION_DOWN);
|
||||
@@ -24,7 +26,7 @@ index a777b6b4c61c24cd2885134cccd5ada7d035cd5e..1a41b716ce5366497e60a691c23c7e62
|
||||
if (button_controller) {
|
||||
pressed_lock_ = button_controller->TakeLock(
|
||||
false, ui::LocatedEvent::FromIfValid(event));
|
||||
@@ -2407,19 +2415,15 @@ void MenuController::OpenMenuImpl(MenuItemView* item, bool show) {
|
||||
@@ -2426,19 +2436,15 @@ void MenuController::OpenMenuImpl(MenuItemView* item, bool show) {
|
||||
}
|
||||
item->GetSubmenu()->ShowAt(params);
|
||||
|
||||
|
||||
@@ -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 d26c850e28b7df6992bf07fda2abe260ed4da769..008c131e5b4f84daeaee5ffe6ab7ae8836725ea5 100644
|
||||
index b61dfcc8e3306a2c3eb8808c204254af4ad8c248..cec49ddafd46b0296cc548a17efd67527a48f157 100644
|
||||
--- a/content/browser/renderer_host/render_frame_host_manager.cc
|
||||
+++ b/content/browser/renderer_host/render_frame_host_manager.cc
|
||||
@@ -4782,6 +4782,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
|
||||
@@ -4684,6 +4684,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
|
||||
request->ResetStateForSiteInstanceChange();
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ index d26c850e28b7df6992bf07fda2abe260ed4da769..008c131e5b4f84daeaee5ffe6ab7ae88
|
||||
}
|
||||
|
||||
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
|
||||
index 3a7a6dc0a4e75c151379f8488d371439a808f1a9..0869aef8fce2829f7827d36c73af65ad71f7fdd3 100644
|
||||
index cabdb73fa092683cdd2dad38f7b62b6bac974d0d..6bd13985764981ccbc547faccdec78bce18600a0 100644
|
||||
--- a/content/public/browser/content_browser_client.h
|
||||
+++ b/content/public/browser/content_browser_client.h
|
||||
@@ -340,6 +340,11 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
|
||||
@@ -11,7 +11,7 @@ If removing this patch causes no sync failures, it's safe to delete :+1:
|
||||
Ref https://chromium-review.googlesource.com/c/chromium/src/+/2953903
|
||||
|
||||
diff --git a/tools/clang/scripts/update.py b/tools/clang/scripts/update.py
|
||||
index 108d33c2e6380749b80631b57931af6beaf44404..ad7b3f3a4e0190983ee68b1503a38847d9f94014 100755
|
||||
index 420c106a5f6fbbcfc77f2409e6272689ec71cf87..dad329cec5786323a981e150129c97357122c617 100755
|
||||
--- a/tools/clang/scripts/update.py
|
||||
+++ b/tools/clang/scripts/update.py
|
||||
@@ -307,6 +307,8 @@ def GetDefaultHostOs():
|
||||
|
||||
@@ -9,7 +9,7 @@ but due to the nature of electron, we need to load the v8 snapshot
|
||||
in the browser process.
|
||||
|
||||
diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc
|
||||
index 24f6f89cfa430ed26476e1a3f79a8ed9464c45f3..a23d9b8fc451078708fd1a39f3d74357de7c244f 100644
|
||||
index 48363b920c780064a6d49f4a521b476bda5ac27b..d55c408557e15650897c9ed6d5b6bd83178a551f 100644
|
||||
--- a/content/app/content_main_runner_impl.cc
|
||||
+++ b/content/app/content_main_runner_impl.cc
|
||||
@@ -296,11 +296,8 @@ void LoadV8SnapshotFile(const base::CommandLine& command_line) {
|
||||
|
||||
@@ -35,7 +35,7 @@ system font by checking if it's kCTFontPriorityAttribute is set to
|
||||
system priority.
|
||||
|
||||
diff --git a/base/BUILD.gn b/base/BUILD.gn
|
||||
index 59721ed3c9e26fd83c553d82030f3e76af0c3dfd..e8a9715e9004e5d10aa96298332237c78796bf5b 100644
|
||||
index 82219748cc05ee4781731da17879f50dc1cea05f..25f5e50259e093d814271e53236d3be0647cb12b 100644
|
||||
--- a/base/BUILD.gn
|
||||
+++ b/base/BUILD.gn
|
||||
@@ -1045,6 +1045,7 @@ component("base") {
|
||||
@@ -477,7 +477,7 @@ index ff96d22a11051391423f4a49c7b1478b8176baf8..c7e640e968f8ef183d48a226d43cdac8
|
||||
// Beware: This view was briefly removed (in favor of a bare CALayer) in
|
||||
// https://crrev.com/c/1236675. The ordering of unassociated layers relative
|
||||
diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn
|
||||
index e522423645bf313ad1504a7ec47ecf3619888e35..d29bdc038fc6934c69b10b7a694d9cbf54839b02 100644
|
||||
index 15297546aa2641af1a249ff99bcf51764b107dbd..3c43af49c5d6d5f604c71e9a9dc1f7afe9aaf0f7 100644
|
||||
--- a/components/viz/service/BUILD.gn
|
||||
+++ b/components/viz/service/BUILD.gn
|
||||
@@ -385,6 +385,7 @@ viz_component("service") {
|
||||
@@ -548,18 +548,18 @@ index dbf334caa3a6d10017b69ad76802e389a011436b..da828823e8195cc9e497866363c9af93
|
||||
|
||||
void ForwardKeyboardEvent(const input::NativeWebKeyboardEvent& key_event,
|
||||
diff --git a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
|
||||
index eca43bf620111c27c400ae2d95880e47c34fbc59..12ee7e75e437426f28002c7c9f4d5f5b5016ec53 100644
|
||||
index 371b7b3ba73ee7b88027fcc31cb0a346cae40eea..c4b0654a56f4f2b4ab57ef05a119e38862b5fd2d 100644
|
||||
--- a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
|
||||
+++ b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "content/public/browser/browser_accessibility_state.h"
|
||||
@@ -36,6 +36,7 @@
|
||||
#import "content/public/browser/render_widget_host_view_mac_delegate.h"
|
||||
#include "content/public/browser/scoped_accessibility_mode.h"
|
||||
#include "content/public/common/content_features.h"
|
||||
+#include "electron/mas.h"
|
||||
#include "skia/ext/skia_utils_mac.h"
|
||||
#include "third_party/blink/public/common/features.h"
|
||||
#include "third_party/blink/public/mojom/input/input_handler.mojom.h"
|
||||
@@ -2136,15 +2137,21 @@ - (NSAccessibilityRole)accessibilityRole {
|
||||
@@ -2138,15 +2139,21 @@ - (NSAccessibilityRole)accessibilityRole {
|
||||
// Since this implementation doesn't have to wait any IPC calls, this doesn't
|
||||
// make any key-typing jank. --hbono 7/23/09
|
||||
//
|
||||
@@ -582,7 +582,7 @@ index eca43bf620111c27c400ae2d95880e47c34fbc59..12ee7e75e437426f28002c7c9f4d5f5b
|
||||
return kAttributes;
|
||||
}
|
||||
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
|
||||
index 3256304fe1bfb80af0312f9046b1a78a2469956e..29281a0d8a4383ed4b2d5d8bac934acd54040aa8 100644
|
||||
index cf87c4749846d98e56f130ac10c9004029f56464..27327923cfdd0c05ad0368b5f4678ff8ecf835fc 100644
|
||||
--- a/content/browser/BUILD.gn
|
||||
+++ b/content/browser/BUILD.gn
|
||||
@@ -342,6 +342,7 @@ source_set("browser") {
|
||||
@@ -797,7 +797,7 @@ index a1068589ad844518038ee7bc15a3de9bc5cba525..1ff781c49f086ec8015c7d3c44567dbe
|
||||
|
||||
} // namespace content
|
||||
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn
|
||||
index 126c0d51647ef46a12b2c47930f7bd49e55dd736..d61474fb3478a27450a037f50d2a734097eb4ca9 100644
|
||||
index 4c59b6c62ad3fed9717b0330c7b46b8dc83a51a1..1c88c8f449387258259bcd65c13709d70f03117b 100644
|
||||
--- a/content/test/BUILD.gn
|
||||
+++ b/content/test/BUILD.gn
|
||||
@@ -662,6 +662,7 @@ static_library("test_support") {
|
||||
@@ -824,7 +824,7 @@ index 126c0d51647ef46a12b2c47930f7bd49e55dd736..d61474fb3478a27450a037f50d2a7340
|
||||
]
|
||||
|
||||
if (!(is_chromeos && target_cpu == "arm64" && current_cpu == "arm")) {
|
||||
@@ -3283,6 +3286,7 @@ test("content_unittests") {
|
||||
@@ -3284,6 +3287,7 @@ test("content_unittests") {
|
||||
"//ui/shell_dialogs:shell_dialogs",
|
||||
"//ui/webui:test_support",
|
||||
"//url",
|
||||
@@ -833,10 +833,10 @@ index 126c0d51647ef46a12b2c47930f7bd49e55dd736..d61474fb3478a27450a037f50d2a7340
|
||||
|
||||
if (enable_nocompile_tests) {
|
||||
diff --git a/content/web_test/BUILD.gn b/content/web_test/BUILD.gn
|
||||
index c17535742efb9a229120953ecb00c73ad391c07d..8142161f2ed49d7ce4f3785b86d846bf0728a92f 100644
|
||||
index dacf6fe8bbb3008e548a757aafaebc0d0a5cd66e..1e06aed0d22e460e5b5ad3bf72d767295454ddcf 100644
|
||||
--- a/content/web_test/BUILD.gn
|
||||
+++ b/content/web_test/BUILD.gn
|
||||
@@ -229,6 +229,7 @@ static_library("web_test_browser") {
|
||||
@@ -231,6 +231,7 @@ static_library("web_test_browser") {
|
||||
"//ui/gl",
|
||||
"//ui/shell_dialogs:shell_dialogs",
|
||||
"//url",
|
||||
@@ -1436,7 +1436,7 @@ index eb81a70e4d5d5cd3e6ae9b45f8cd1c795ea76c51..9921ccb10d3455600eddd85f77f10228
|
||||
|
||||
} // namespace sandbox
|
||||
diff --git a/third_party/blink/renderer/core/BUILD.gn b/third_party/blink/renderer/core/BUILD.gn
|
||||
index 3ff395b3ff3b646a64c43503d2c172776bf68c84..e40030307e8d9df7e00a402e241e00664b236c7d 100644
|
||||
index f2b874b368c6857013f6fbb7522d5d590f0540b5..1593565d61d284902ea364bf7bbee065e95acb48 100644
|
||||
--- a/third_party/blink/renderer/core/BUILD.gn
|
||||
+++ b/third_party/blink/renderer/core/BUILD.gn
|
||||
@@ -414,6 +414,7 @@ component("core") {
|
||||
@@ -1678,7 +1678,7 @@ index 6846060ef9622d8fc8d1d6c8da16e2f1b785e6bd..05c22db87e882b246bd7034e027cf149
|
||||
// Accessible object
|
||||
if (AXElementWrapper::IsValidElement(value)) {
|
||||
diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn
|
||||
index dfca458adb5b38cb1e597c16e9e6b6cc1521dea2..2372ff1193d1d52b719b6ee311cc07ac472a2f8d 100644
|
||||
index d2bd63f57da9b3ff84ebe36053ec18978d86c9f3..a6261be96e00548af7eba8a5fc7461586b9dbf53 100644
|
||||
--- a/ui/base/BUILD.gn
|
||||
+++ b/ui/base/BUILD.gn
|
||||
@@ -365,6 +365,13 @@ component("base") {
|
||||
@@ -1695,7 +1695,7 @@ index dfca458adb5b38cb1e597c16e9e6b6cc1521dea2..2372ff1193d1d52b719b6ee311cc07ac
|
||||
if (is_ios) {
|
||||
sources += [
|
||||
"device_form_factor_ios.mm",
|
||||
@@ -518,6 +525,12 @@ component("base") {
|
||||
@@ -511,6 +518,12 @@ component("base") {
|
||||
"//url",
|
||||
]
|
||||
|
||||
@@ -1848,7 +1848,7 @@ index 874ac9d572931fe175ccab8beb7738fe0a7b3c1b..b70e2a8a7be9e00a379f47c77589dde6
|
||||
// Query the display's refresh rate.
|
||||
if (@available(macos 12.0, *)) {
|
||||
diff --git a/ui/gfx/BUILD.gn b/ui/gfx/BUILD.gn
|
||||
index e531cb42cde9863ff1c4a13150f35877b564226c..0c0ec308be02297b090d08b52cc713c22652da36 100644
|
||||
index c8f01a88e0d1797baf53c517341c735d9c6e6b4a..345743dd19f862cf2b4304d70cb47ce68e6895d1 100644
|
||||
--- a/ui/gfx/BUILD.gn
|
||||
+++ b/ui/gfx/BUILD.gn
|
||||
@@ -337,6 +337,12 @@ component("gfx") {
|
||||
|
||||
@@ -10,7 +10,7 @@ an about:blank check to this area.
|
||||
Ref: https://chromium-review.googlesource.com/c/chromium/src/+/5403876
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
index 5870b90b02ba5cf4b197e91ae9c9dc8fa3ebf7e4..bab3c9fdb1a90dd42394ab77732976e0b444a4e5 100644
|
||||
index eaf36446678a3d079149377a6954c04f01573c8d..b060a69fef72b11d3bc932064d29e39ce827fb32 100644
|
||||
--- a/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
@@ -807,8 +807,8 @@ void VerifyThatBrowserAndRendererCalculatedOriginsToCommitMatch(
|
||||
|
||||
@@ -881,10 +881,10 @@ index 97cb6458bc9eec767db89b56abfc5f4b4136ff7b..d9a0b343158b8464b5c9aa8e0e655c0b
|
||||
ScriptingThrottler scripting_throttler_;
|
||||
|
||||
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
|
||||
index 29281a0d8a4383ed4b2d5d8bac934acd54040aa8..0b943e7a4324b8ce9524d76f1cf4c6a2f187c595 100644
|
||||
index 27327923cfdd0c05ad0368b5f4678ff8ecf835fc..0bff462eff763b5f5b1ecca6ca723c2c52199350 100644
|
||||
--- a/content/browser/BUILD.gn
|
||||
+++ b/content/browser/BUILD.gn
|
||||
@@ -3159,8 +3159,9 @@ source_set("browser") {
|
||||
@@ -3154,8 +3154,9 @@ source_set("browser") {
|
||||
"//ppapi/shared_impl",
|
||||
]
|
||||
|
||||
|
||||
@@ -44,10 +44,10 @@ index 8637d83c1d3a912bbc48effcc095b426640351ad..3419628c08b62a16c62778cc124c365a
|
||||
|
||||
void RenderWidgetHostImpl::ShowContextMenuAtPoint(
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 4f87894219452e736311ad25a62b71b8aec4d158..7a8d7ce6f628123f5288d693046ca7602eeccac1 100644
|
||||
index a99621ef317ec59f1368e5c7959f73de8ed32c54..5df2433b30213ba5683a864dcf42a07a5deb56e7 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -5878,6 +5878,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
|
||||
@@ -5883,6 +5883,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
|
||||
return text_input_manager_.get();
|
||||
}
|
||||
|
||||
@@ -60,10 +60,10 @@ index 4f87894219452e736311ad25a62b71b8aec4d158..7a8d7ce6f628123f5288d693046ca760
|
||||
RenderWidgetHostImpl* render_widget_host) {
|
||||
return render_widget_host == GetPrimaryMainFrame()->GetRenderWidgetHost();
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
|
||||
index ff2a3cc31a9c8e24222d3614c58d0884c1fde260..641840c371a76a729d62d59703a5d5566ef76b3c 100644
|
||||
index ebbefa02e163c9f38fc7057a592684f869c880e2..6d66b554acd09a32684ef6343db795134d9d5c15 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.h
|
||||
+++ b/content/browser/web_contents/web_contents_impl.h
|
||||
@@ -1186,6 +1186,7 @@ class CONTENT_EXPORT WebContentsImpl
|
||||
@@ -1183,6 +1183,7 @@ class CONTENT_EXPORT WebContentsImpl
|
||||
void SendScreenRects() override;
|
||||
void SendActiveState(bool active) override;
|
||||
TextInputManager* GetTextInputManager() override;
|
||||
@@ -72,7 +72,7 @@ index ff2a3cc31a9c8e24222d3614c58d0884c1fde260..641840c371a76a729d62d59703a5d556
|
||||
RenderWidgetHostImpl* render_widget_host) override;
|
||||
bool IsShowingContextMenuOnPage() const override;
|
||||
diff --git a/content/public/browser/web_contents_observer.h b/content/public/browser/web_contents_observer.h
|
||||
index 4f97e13f9125e653f44acad78f8f35ee38e90b6d..f3c712e3f970dcccaac37e4dd407f14b52871269 100644
|
||||
index 7e0dd469a7059ea38120cfd6cd17469a3c06c1fa..4fd3ab75b462cf169443473b968db64c765930b8 100644
|
||||
--- a/content/public/browser/web_contents_observer.h
|
||||
+++ b/content/public/browser/web_contents_observer.h
|
||||
@@ -37,6 +37,7 @@
|
||||
|
||||
@@ -28,7 +28,7 @@ index e350f6789c710826e0885ccdc19e66e2213820df..b8ba008470f39f6f3559d29b9eff0a23
|
||||
break;
|
||||
}
|
||||
diff --git a/content/browser/permissions/permission_controller_impl.cc b/content/browser/permissions/permission_controller_impl.cc
|
||||
index b267734bf2273253aa921728e12c753adfade02e..fd72e7d62ac45f51b2e7e295930ed25bb376056b 100644
|
||||
index b1c9f2d59559ed33cd32ad1f22b221029018cf0f..81deda95c71f025b723571ca9a6ac20bc7bb4b0c 100644
|
||||
--- a/content/browser/permissions/permission_controller_impl.cc
|
||||
+++ b/content/browser/permissions/permission_controller_impl.cc
|
||||
@@ -87,7 +87,15 @@ PermissionToSchedulingFeature(PermissionType permission_name) {
|
||||
|
||||
@@ -15,10 +15,10 @@ This CL removes these filters so the unresponsive event can still be
|
||||
accessed from our JS event. The filtering is moved into Electron's code.
|
||||
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 56b2fb93d5d85f520081de9e42e26ef3f8f6090e..b32e75e7c1922e63fdca891dfd7d4bcb27c5096e 100644
|
||||
index dd94f88d353eb9291e2a64f0281e3fc1d53b68da..60a21da52a9a0f301e3b5e320fe69e766951db4d 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -10129,25 +10129,13 @@ void WebContentsImpl::RendererUnresponsive(
|
||||
@@ -10109,25 +10109,13 @@ void WebContentsImpl::RendererUnresponsive(
|
||||
base::RepeatingClosure hang_monitor_restarter) {
|
||||
OPTIONAL_TRACE_EVENT1("content", "WebContentsImpl::RendererUnresponsive",
|
||||
"render_widget_host", render_widget_host);
|
||||
|
||||
@@ -8,10 +8,10 @@ respond to the first mouse click in their window, which is desirable for some
|
||||
kinds of utility windows. Similarly for `disableAutoHideCursor`.
|
||||
|
||||
diff --git a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
|
||||
index a6b6917ee2c02c091aa51b55449d93fa55e06ac2..eca43bf620111c27c400ae2d95880e47c34fbc59 100644
|
||||
index 91e5beaa68fc0b8231fce4bf195efa924744a532..371b7b3ba73ee7b88027fcc31cb0a346cae40eea 100644
|
||||
--- a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
|
||||
+++ b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
|
||||
@@ -170,6 +170,15 @@ void ExtractUnderlines(NSAttributedString* string,
|
||||
@@ -171,6 +171,15 @@ void ExtractUnderlines(NSAttributedString* string,
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -27,7 +27,7 @@ index a6b6917ee2c02c091aa51b55449d93fa55e06ac2..eca43bf620111c27c400ae2d95880e47
|
||||
// RenderWidgetHostViewCocoa ---------------------------------------------------
|
||||
|
||||
// Private methods:
|
||||
@@ -774,6 +783,9 @@ - (AcceptMouseEventsOption)acceptsMouseEventsOption {
|
||||
@@ -776,6 +785,9 @@ - (AcceptMouseEventsOption)acceptsMouseEventsOption {
|
||||
}
|
||||
|
||||
- (BOOL)acceptsFirstMouse:(NSEvent*)theEvent {
|
||||
@@ -37,7 +37,7 @@ index a6b6917ee2c02c091aa51b55449d93fa55e06ac2..eca43bf620111c27c400ae2d95880e47
|
||||
// Enable "click-through" if mouse clicks are accepted in inactive windows
|
||||
return [self acceptsMouseEventsOption] > kAcceptMouseEventsInActiveWindow;
|
||||
}
|
||||
@@ -919,6 +931,10 @@ - (BOOL)shouldIgnoreMouseEvent:(NSEvent*)theEvent {
|
||||
@@ -921,6 +933,10 @@ - (BOOL)shouldIgnoreMouseEvent:(NSEvent*)theEvent {
|
||||
// its parent view.
|
||||
BOOL hitSelf = NO;
|
||||
while (view) {
|
||||
@@ -48,7 +48,7 @@ index a6b6917ee2c02c091aa51b55449d93fa55e06ac2..eca43bf620111c27c400ae2d95880e47
|
||||
if (view == self)
|
||||
hitSelf = YES;
|
||||
if ([view isKindOfClass:[self class]] && ![view isEqual:self] &&
|
||||
@@ -1253,6 +1269,10 @@ - (void)keyEvent:(NSEvent*)theEvent wasKeyEquivalent:(BOOL)equiv {
|
||||
@@ -1255,6 +1271,10 @@ - (void)keyEvent:(NSEvent*)theEvent wasKeyEquivalent:(BOOL)equiv {
|
||||
eventType == NSEventTypeKeyDown &&
|
||||
!(modifierFlags & NSEventModifierFlagCommand);
|
||||
|
||||
|
||||
@@ -233,10 +233,10 @@ index 7c99a9512e6f65713fe8483cef7b7c9b494b4491..8fb6cf252961c9773d1a6a09d47bec6a
|
||||
}
|
||||
|
||||
diff --git a/content/common/features.cc b/content/common/features.cc
|
||||
index 9a619bf9a4e2801d7a67bd26104066d03dcfb465..6aa5f4cb75bc8e22048b6b9bb8456a958ad7b80d 100644
|
||||
index 9119155650ed4249c699cc57eaef9149b99e7297..13e2c0da07938d73b5a689cea19df4a445c4e5e5 100644
|
||||
--- a/content/common/features.cc
|
||||
+++ b/content/common/features.cc
|
||||
@@ -300,6 +300,14 @@ BASE_FEATURE(kIOSurfaceCapturer,
|
||||
@@ -294,6 +294,14 @@ BASE_FEATURE(kIOSurfaceCapturer,
|
||||
base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
#endif
|
||||
|
||||
@@ -252,10 +252,10 @@ index 9a619bf9a4e2801d7a67bd26104066d03dcfb465..6aa5f4cb75bc8e22048b6b9bb8456a95
|
||||
// invalidated upon notifications sent by base::SystemMonitor. If disabled, the
|
||||
// cache is considered invalid on every enumeration request.
|
||||
diff --git a/content/common/features.h b/content/common/features.h
|
||||
index 7bc79ead73e5e51d7735d6964cf96990120670ca..83b5666e735aa99a8e2300b37154da1769baa2b0 100644
|
||||
index 0764c2fd1086bb0da16df91c95b171eea0a06bb1..3bc7a54999ec5e1f3afa45fe59d43ba12ec10286 100644
|
||||
--- a/content/common/features.h
|
||||
+++ b/content/common/features.h
|
||||
@@ -100,6 +100,9 @@ CONTENT_EXPORT BASE_DECLARE_FEATURE(kInterestGroupUpdateIfOlderThan);
|
||||
@@ -99,6 +99,9 @@ CONTENT_EXPORT BASE_DECLARE_FEATURE(kInterestGroupUpdateIfOlderThan);
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
CONTENT_EXPORT BASE_DECLARE_FEATURE(kIOSurfaceCapturer);
|
||||
#endif
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Maddock <smaddock@slack-corp.com>
|
||||
Date: Fri, 28 Mar 2025 20:22:26 -0400
|
||||
Subject: revert: Enable CREL for arm32 targets
|
||||
|
||||
Enabling CREL on Linux ARM64 seems to cause it to segfault. Disable for Electron
|
||||
as its one of our supported platforms.
|
||||
https://chromium-review.googlesource.com/q/I3a62f02f564f07be63173b0773b4ecaffbe939b9
|
||||
|
||||
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
|
||||
index e579cc9a9d1fd01d390a64886f649dc53102166e..de1f3b7b1a33bf5ab4f6922f0cb2d305a8af7550 100644
|
||||
--- a/build/config/compiler/BUILD.gn
|
||||
+++ b/build/config/compiler/BUILD.gn
|
||||
@@ -619,7 +619,8 @@ config("compiler") {
|
||||
|
||||
# Enable ELF CREL (see crbug.com/357878242) for all platforms that use ELF
|
||||
# (excluding toolchains that use an older version of LLVM).
|
||||
- if (is_linux && use_lld && !llvm_android_mainline &&
|
||||
+ # TODO(crbug.com/376278218): This causes segfault on Linux ARM builds.
|
||||
+ if (is_linux && use_lld && !llvm_android_mainline && current_cpu != "arm" &&
|
||||
default_toolchain != "//build/toolchain/cros:target") {
|
||||
cflags += [ "-Wa,--crel,--allow-experimental-crel" ]
|
||||
}
|
||||
@@ -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 f73f2ac411c0af45d7c0a4ba94222b2bd1d4841c..3ec3dd8f89bb167ed82c0da95a0f1d3d9738ac72 100644
|
||||
index 7500958c41904c61705d49f75b7a152005ce4890..95bffa1a93ce1b103c129503414f7832d87fd493 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -3947,6 +3947,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
@@ -3952,6 +3952,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 f73f2ac411c0af45d7c0a4ba94222b2bd1d4841c..3ec3dd8f89bb167ed82c0da95a0f1d3d
|
||||
std::unique_ptr<WebContentsViewDelegate> delegate =
|
||||
GetContentClient()->browser()->GetWebContentsViewDelegate(this);
|
||||
|
||||
@@ -3957,6 +3964,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
@@ -3962,6 +3969,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
view_ = CreateWebContentsView(this, std::move(delegate),
|
||||
&render_view_host_delegate_view_);
|
||||
}
|
||||
@@ -35,7 +35,7 @@ index f73f2ac411c0af45d7c0a4ba94222b2bd1d4841c..3ec3dd8f89bb167ed82c0da95a0f1d3d
|
||||
CHECK(view_.get());
|
||||
|
||||
diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h
|
||||
index 437060750090e974a3257979c215d13d036afa4e..5dce8d4e37845e1bb1922d7c4da3208939549b27 100644
|
||||
index 9360a2b080ebe4d6c0a475b0a536a5d7212c8a86..6e5eebfb199d322028f6b2bc72d666c24f334bba 100644
|
||||
--- a/content/public/browser/web_contents.h
|
||||
+++ b/content/public/browser/web_contents.h
|
||||
@@ -121,10 +121,13 @@ class BrowserPluginGuestDelegate;
|
||||
@@ -52,7 +52,7 @@ index 437060750090e974a3257979c215d13d036afa4e..5dce8d4e37845e1bb1922d7c4da32089
|
||||
class WebUI;
|
||||
struct DropData;
|
||||
struct MHTMLGenerationParams;
|
||||
@@ -270,6 +273,10 @@ class WebContents : public PageNavigator, public base::SupportsUserData {
|
||||
@@ -274,6 +277,10 @@ class WebContents : public PageNavigator, public base::SupportsUserData {
|
||||
network::mojom::WebSandboxFlags starting_sandbox_flags =
|
||||
network::mojom::WebSandboxFlags::kNone;
|
||||
|
||||
|
||||
@@ -15,10 +15,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 7b45a0006af60400f5d8ba5b925f971cb5cf393e..5870b90b02ba5cf4b197e91ae9c9dc8fa3ebf7e4 100644
|
||||
index 7578b4f9056b9be79645fa0eed9476ab9b80c509..eaf36446678a3d079149377a6954c04f01573c8d 100644
|
||||
--- a/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
@@ -8884,6 +8884,17 @@ void RenderFrameHostImpl::EnterFullscreen(
|
||||
@@ -8881,6 +8881,17 @@ void RenderFrameHostImpl::EnterFullscreen(
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,10 +37,10 @@ index 7b45a0006af60400f5d8ba5b925f971cb5cf393e..5870b90b02ba5cf4b197e91ae9c9dc8f
|
||||
if (had_fullscreen_token && !GetView()->HasFocus())
|
||||
GetView()->Focus();
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 3ec3dd8f89bb167ed82c0da95a0f1d3d9738ac72..3b9e634245986b1ef22e8bf4e116470343f5ff60 100644
|
||||
index 95bffa1a93ce1b103c129503414f7832d87fd493..c34bcb4f4a6ac03b4e3a6c87c3ac29e4450ffa71 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -4222,21 +4222,25 @@ KeyboardEventProcessingResult WebContentsImpl::PreHandleKeyboardEvent(
|
||||
@@ -4227,21 +4227,25 @@ KeyboardEventProcessingResult WebContentsImpl::PreHandleKeyboardEvent(
|
||||
const input::NativeWebKeyboardEvent& event) {
|
||||
OPTIONAL_TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("content.verbose"),
|
||||
"WebContentsImpl::PreHandleKeyboardEvent");
|
||||
@@ -78,7 +78,7 @@ index 3ec3dd8f89bb167ed82c0da95a0f1d3d9738ac72..3b9e634245986b1ef22e8bf4e1164703
|
||||
}
|
||||
|
||||
bool WebContentsImpl::HandleMouseEvent(const blink::WebMouseEvent& event) {
|
||||
@@ -4395,7 +4399,7 @@ void WebContentsImpl::EnterFullscreenMode(
|
||||
@@ -4400,7 +4404,7 @@ void WebContentsImpl::EnterFullscreenMode(
|
||||
OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::EnterFullscreenMode");
|
||||
DCHECK(CanEnterFullscreenMode(requesting_frame));
|
||||
DCHECK(requesting_frame->IsActive());
|
||||
|
||||
@@ -10,10 +10,10 @@ to handle this without patching, but this is fairly clean for now and no longer
|
||||
patching legacy devtools code.
|
||||
|
||||
diff --git a/front_end/entrypoints/main/MainImpl.ts b/front_end/entrypoints/main/MainImpl.ts
|
||||
index 0f3a5d69bef697a7787b68cd1c8261c67993edf3..1d49c1190ba7d47a76993b7f291119be243d189e 100644
|
||||
index 20ffe01d89e65b3eb6dc97b75761166ae3c9acb9..0444f2d81e53a01a81861c158713336a8062434f 100644
|
||||
--- a/front_end/entrypoints/main/MainImpl.ts
|
||||
+++ b/front_end/entrypoints/main/MainImpl.ts
|
||||
@@ -741,6 +741,8 @@ export class MainImpl {
|
||||
@@ -736,6 +736,8 @@ export class MainImpl {
|
||||
globalThis.Main = globalThis.Main || {};
|
||||
// @ts-expect-error Exported for Tests.js
|
||||
globalThis.Main.Main = MainImpl;
|
||||
|
||||
@@ -46,7 +46,7 @@ index 3e57ae8efe33f326ef0e5d609c311d4be5b8afd6..dc521d39c2280dfc3217e97c1e413b2b
|
||||
V8_INLINE static void* GetAlignedPointerFromInternalField(
|
||||
const BasicTracedReference<Object>& object, int index) {
|
||||
diff --git a/src/api/api.cc b/src/api/api.cc
|
||||
index 0ab95ba54d1829ea0fda9a5678a906850b4b509b..2a01241d7db654098720f00a9130996e79d63261 100644
|
||||
index 62a71b9cb7594e5fcc86f32d7af160c32b8e8944..0b2d5bfa9480ea90eb0adb89132505b8cabafc08 100644
|
||||
--- a/src/api/api.cc
|
||||
+++ b/src/api/api.cc
|
||||
@@ -6313,14 +6313,33 @@ Local<Data> v8::Object::SlowGetInternalField(int index) {
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/strings/cstring_view.h"
|
||||
#include "chrome/common/chrome_paths.h"
|
||||
#include "chrome/common/chrome_switches.h"
|
||||
#include "components/content_settings/core/common/content_settings_pattern.h"
|
||||
@@ -81,8 +82,9 @@ namespace {
|
||||
|
||||
constexpr std::string_view kRelauncherProcess = "relauncher";
|
||||
|
||||
constexpr std::string_view kElectronDisableSandbox{"ELECTRON_DISABLE_SANDBOX"};
|
||||
constexpr std::string_view kElectronEnableStackDumping{
|
||||
constexpr base::cstring_view kElectronDisableSandbox{
|
||||
"ELECTRON_DISABLE_SANDBOX"};
|
||||
constexpr base::cstring_view kElectronEnableStackDumping{
|
||||
"ELECTRON_ENABLE_STACK_DUMPING"};
|
||||
|
||||
// Returns true if this subprocess type needs the ResourceBundle initialized
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "base/containers/fixed_flat_set.h"
|
||||
#include "base/environment.h"
|
||||
#include "base/feature_list.h"
|
||||
#include "base/strings/cstring_view.h"
|
||||
#include "base/task/single_thread_task_runner.h"
|
||||
#include "base/task/thread_pool/thread_pool_instance.h"
|
||||
#include "content/public/common/content_switches.h"
|
||||
@@ -85,12 +86,13 @@ void ExitIfContainsDisallowedFlags(const std::vector<std::string>& argv) {
|
||||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
// A list of node envs that may be used to inject scripts.
|
||||
const char* kHijackableEnvs[] = {"NODE_OPTIONS", "NODE_REPL_EXTERNAL_MODULE"};
|
||||
constexpr base::cstring_view kHijackableEnvs[] = {"NODE_OPTIONS",
|
||||
"NODE_REPL_EXTERNAL_MODULE"};
|
||||
|
||||
// Return true if there is any env in kHijackableEnvs.
|
||||
bool UnsetHijackableEnvs(base::Environment* env) {
|
||||
bool has = false;
|
||||
for (const char* name : kHijackableEnvs) {
|
||||
for (base::cstring_view name : kHijackableEnvs) {
|
||||
if (env->HasVar(name)) {
|
||||
env->UnSetVar(name);
|
||||
has = true;
|
||||
|
||||
@@ -1167,13 +1167,12 @@ void App::SetAccessibilitySupportEnabled(gin_helper::ErrorThrower thrower,
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO(wg-upgrades): crbug.com/1470199 remove use of deprecated
|
||||
// AddAccessibilityModeFlags() and RemoveAccessibilityModeFlags()
|
||||
auto* ax_state = content::BrowserAccessibilityState::GetInstance();
|
||||
if (enabled) {
|
||||
ax_state->AddAccessibilityModeFlags(ui::kAXModeComplete);
|
||||
} else {
|
||||
ax_state->RemoveAccessibilityModeFlags(ui::kAXModeComplete);
|
||||
if (!enabled) {
|
||||
scoped_accessibility_mode_.reset();
|
||||
} else if (!scoped_accessibility_mode_) {
|
||||
scoped_accessibility_mode_ =
|
||||
content::BrowserAccessibilityState::GetInstance()
|
||||
->CreateScopedModeForProcess(ui::kAXModeComplete);
|
||||
}
|
||||
Browser::Get()->OnAccessibilitySupportChanged();
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "content/public/browser/browser_child_process_observer.h"
|
||||
#include "content/public/browser/gpu_data_manager_observer.h"
|
||||
#include "content/public/browser/render_process_host.h"
|
||||
#include "content/public/browser/scoped_accessibility_mode.h"
|
||||
#include "crypto/crypto_buildflags.h"
|
||||
#include "electron/mas.h"
|
||||
#include "net/base/completion_once_callback.h"
|
||||
@@ -276,6 +277,8 @@ class App final : public ElectronBrowserClient::Delegate,
|
||||
bool disable_hw_acceleration_ = false;
|
||||
bool disable_domain_blocking_for_3DAPIs_ = false;
|
||||
bool watch_singleton_socket_on_ready_ = false;
|
||||
|
||||
std::unique_ptr<content::ScopedAccessibilityMode> scoped_accessibility_mode_;
|
||||
};
|
||||
|
||||
} // namespace api
|
||||
|
||||
@@ -362,8 +362,7 @@ void BaseWindow::SetContentView(gin::Handle<View> view) {
|
||||
}
|
||||
|
||||
void BaseWindow::CloseImmediately() {
|
||||
if (!window_->IsClosed())
|
||||
window_->CloseImmediately();
|
||||
window_->CloseImmediately();
|
||||
}
|
||||
|
||||
void BaseWindow::Close() {
|
||||
|
||||
@@ -20,11 +20,18 @@
|
||||
#include "ui/display/display.h"
|
||||
#include "ui/display/screen.h"
|
||||
#include "ui/gfx/geometry/point.h"
|
||||
#include "ui/gfx/geometry/point_conversions.h"
|
||||
#include "ui/gfx/geometry/point_f.h"
|
||||
#include "ui/gfx/geometry/vector2d_conversions.h"
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
#include "ui/display/win/screen_win.h"
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_LINUX)
|
||||
#include "shell/browser/linux/x11_util.h"
|
||||
#endif
|
||||
|
||||
#if defined(USE_OZONE)
|
||||
#include "ui/ozone/public/ozone_platform.h"
|
||||
#endif
|
||||
@@ -102,14 +109,6 @@ static gfx::Rect DIPToScreenRect(electron::NativeWindow* window,
|
||||
return display::win::GetScreenWin()->DIPToScreenRect(hwnd, rect);
|
||||
}
|
||||
|
||||
static gfx::PointF ScreenToDIPPoint(const gfx::PointF& pixel_point) {
|
||||
return display::win::GetScreenWin()->ScreenToDIPPoint(pixel_point);
|
||||
}
|
||||
|
||||
static gfx::Point DIPToScreenPoint(const gfx::Point& dip_point) {
|
||||
return display::win::GetScreenWin()->DIPToScreenPoint(dip_point);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void Screen::OnDisplayAdded(const display::Display& new_display) {
|
||||
@@ -134,6 +133,44 @@ void Screen::OnDisplayMetricsChanged(const display::Display& display,
|
||||
MetricsToArray(changed_metrics)));
|
||||
}
|
||||
|
||||
gfx::PointF Screen::ScreenToDIPPoint(const gfx::PointF& point_px) {
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
return display::win::GetScreenWin()->ScreenToDIPPoint(point_px);
|
||||
#elif BUILDFLAG(IS_LINUX)
|
||||
if (x11_util::IsX11()) {
|
||||
gfx::Point pt_px = gfx::ToFlooredPoint(point_px);
|
||||
display::Display display = GetDisplayNearestPoint(pt_px);
|
||||
gfx::Vector2d delta_px = pt_px - display.native_origin();
|
||||
gfx::Vector2dF delta_dip =
|
||||
gfx::ScaleVector2d(delta_px, 1.0 / display.device_scale_factor());
|
||||
return gfx::PointF(display.bounds().origin()) + delta_dip;
|
||||
} else {
|
||||
return point_px;
|
||||
}
|
||||
#else
|
||||
return point_px;
|
||||
#endif
|
||||
}
|
||||
|
||||
gfx::Point Screen::DIPToScreenPoint(const gfx::Point& point_dip) {
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
return display::win::GetScreenWin()->DIPToScreenPoint(point_dip);
|
||||
#elif BUILDFLAG(IS_LINUX)
|
||||
if (x11_util::IsX11()) {
|
||||
display::Display display = GetDisplayNearestPoint(point_dip);
|
||||
gfx::Rect bounds_dip = display.bounds();
|
||||
gfx::Vector2d delta_dip = point_dip - bounds_dip.origin();
|
||||
gfx::Vector2d delta_px = gfx::ToFlooredVector2d(
|
||||
gfx::ScaleVector2d(delta_dip, display.device_scale_factor()));
|
||||
return display.native_origin() + delta_px;
|
||||
} else {
|
||||
return point_dip;
|
||||
}
|
||||
#else
|
||||
return point_dip;
|
||||
#endif
|
||||
}
|
||||
|
||||
// static
|
||||
v8::Local<v8::Value> Screen::Create(gin_helper::ErrorThrower error_thrower) {
|
||||
if (!Browser::Get()->is_ready()) {
|
||||
@@ -161,9 +198,11 @@ gin::ObjectTemplateBuilder Screen::GetObjectTemplateBuilder(
|
||||
.SetMethod("getPrimaryDisplay", &Screen::GetPrimaryDisplay)
|
||||
.SetMethod("getAllDisplays", &Screen::GetAllDisplays)
|
||||
.SetMethod("getDisplayNearestPoint", &Screen::GetDisplayNearestPoint)
|
||||
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
|
||||
.SetMethod("screenToDipPoint", &Screen::ScreenToDIPPoint)
|
||||
.SetMethod("dipToScreenPoint", &Screen::DIPToScreenPoint)
|
||||
#endif
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
.SetMethod("screenToDipPoint", &ScreenToDIPPoint)
|
||||
.SetMethod("dipToScreenPoint", &DIPToScreenPoint)
|
||||
.SetMethod("screenToDipRect", &ScreenToDIPRect)
|
||||
.SetMethod("dipToScreenRect", &DIPToScreenRect)
|
||||
#endif
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
namespace gfx {
|
||||
class Point;
|
||||
class PointF;
|
||||
class Rect;
|
||||
class Screen;
|
||||
} // namespace gfx
|
||||
@@ -58,6 +59,9 @@ class Screen final : public gin::Wrappable<Screen>,
|
||||
return screen_->GetDisplayMatching(match_rect);
|
||||
}
|
||||
|
||||
gfx::PointF ScreenToDIPPoint(const gfx::PointF& point_px);
|
||||
gfx::Point DIPToScreenPoint(const gfx::Point& point_dip);
|
||||
|
||||
// display::DisplayObserver:
|
||||
void OnDisplayAdded(const display::Display& new_display) override;
|
||||
void OnDisplaysRemoved(const display::Displays& removed_displays) override;
|
||||
|
||||
@@ -1299,8 +1299,7 @@ void WebContents::BeforeUnloadFired(content::WebContents* tab,
|
||||
void WebContents::SetContentsBounds(content::WebContents* source,
|
||||
const gfx::Rect& rect) {
|
||||
if (!Emit("content-bounds-updated", rect))
|
||||
for (ExtendedWebContentsObserver& observer : observers_)
|
||||
observer.OnSetContentBounds(rect);
|
||||
observers_.Notify(&ExtendedWebContentsObserver::OnSetContentBounds, rect);
|
||||
}
|
||||
|
||||
void WebContents::CloseContents(content::WebContents* source) {
|
||||
@@ -1316,8 +1315,7 @@ void WebContents::CloseContents(content::WebContents* source) {
|
||||
}
|
||||
|
||||
void WebContents::ActivateContents(content::WebContents* source) {
|
||||
for (ExtendedWebContentsObserver& observer : observers_)
|
||||
observer.OnActivateContents();
|
||||
observers_.Notify(&ExtendedWebContentsObserver::OnActivateContents);
|
||||
}
|
||||
|
||||
void WebContents::UpdateTargetURL(content::WebContents* source,
|
||||
@@ -2112,8 +2110,8 @@ void WebContents::TitleWasSet(content::NavigationEntry* entry) {
|
||||
} else {
|
||||
final_title = web_contents()->GetTitle();
|
||||
}
|
||||
for (ExtendedWebContentsObserver& observer : observers_)
|
||||
observer.OnPageTitleUpdated(final_title, explicit_set);
|
||||
observers_.Notify(&ExtendedWebContentsObserver::OnPageTitleUpdated,
|
||||
final_title, explicit_set);
|
||||
Emit("page-title-updated", final_title, explicit_set);
|
||||
}
|
||||
|
||||
@@ -2169,8 +2167,7 @@ void WebContents::DevToolsClosed() {
|
||||
}
|
||||
|
||||
void WebContents::DevToolsResized() {
|
||||
for (ExtendedWebContentsObserver& observer : observers_)
|
||||
observer.OnDevToolsResized();
|
||||
observers_.Notify(&ExtendedWebContentsObserver::OnDevToolsResized);
|
||||
}
|
||||
|
||||
void WebContents::SetOwnerWindow(NativeWindow* owner_window) {
|
||||
|
||||
@@ -666,10 +666,9 @@ void WebRequest::SetListener(Event event,
|
||||
}
|
||||
|
||||
if (filter_include_patterns.empty()) {
|
||||
util::EmitWarning(
|
||||
util::EmitDeprecationWarning(
|
||||
"The urls array in WebRequestFilter is empty, which is deprecated. "
|
||||
"Please use '<all_urls>' to match all URLs.",
|
||||
"DeprecationWarning");
|
||||
"Please use '<all_urls>' to match all URLs.");
|
||||
filter_include_patterns.insert("<all_urls>");
|
||||
}
|
||||
|
||||
|
||||
@@ -129,8 +129,7 @@ void Browser::Shutdown() {
|
||||
is_shutdown_ = true;
|
||||
is_quitting_ = true;
|
||||
|
||||
for (BrowserObserver& observer : observers_)
|
||||
observer.OnQuit();
|
||||
observers_.Notify(&BrowserObserver::OnQuit);
|
||||
|
||||
if (quit_main_message_loop_) {
|
||||
RunQuitClosure(std::move(quit_main_message_loop_));
|
||||
@@ -165,25 +164,20 @@ void Browser::SetName(const std::string& name) {
|
||||
|
||||
bool Browser::OpenFile(const std::string& file_path) {
|
||||
bool prevent_default = false;
|
||||
for (BrowserObserver& observer : observers_)
|
||||
observer.OnOpenFile(&prevent_default, file_path);
|
||||
|
||||
observers_.Notify(&BrowserObserver::OnOpenFile, &prevent_default, file_path);
|
||||
return prevent_default;
|
||||
}
|
||||
|
||||
void Browser::OpenURL(const std::string& url) {
|
||||
for (BrowserObserver& observer : observers_)
|
||||
observer.OnOpenURL(url);
|
||||
observers_.Notify(&BrowserObserver::OnOpenURL, url);
|
||||
}
|
||||
|
||||
void Browser::Activate(bool has_visible_windows) {
|
||||
for (BrowserObserver& observer : observers_)
|
||||
observer.OnActivate(has_visible_windows);
|
||||
observers_.Notify(&BrowserObserver::OnActivate, has_visible_windows);
|
||||
}
|
||||
|
||||
void Browser::WillFinishLaunching() {
|
||||
for (BrowserObserver& observer : observers_)
|
||||
observer.OnWillFinishLaunching();
|
||||
observers_.Notify(&BrowserObserver::OnWillFinishLaunching);
|
||||
}
|
||||
|
||||
void Browser::DidFinishLaunching(base::Value::Dict launch_info) {
|
||||
@@ -201,6 +195,7 @@ void Browser::DidFinishLaunching(base::Value::Dict launch_info) {
|
||||
if (ready_promise_) {
|
||||
ready_promise_->Resolve();
|
||||
}
|
||||
|
||||
for (BrowserObserver& observer : observers_)
|
||||
observer.OnFinishLaunching(launch_info.Clone());
|
||||
}
|
||||
@@ -216,20 +211,15 @@ v8::Local<v8::Value> Browser::WhenReady(v8::Isolate* isolate) {
|
||||
}
|
||||
|
||||
void Browser::OnAccessibilitySupportChanged() {
|
||||
for (BrowserObserver& observer : observers_)
|
||||
observer.OnAccessibilitySupportChanged();
|
||||
observers_.Notify(&BrowserObserver::OnAccessibilitySupportChanged);
|
||||
}
|
||||
|
||||
void Browser::PreMainMessageLoopRun() {
|
||||
for (BrowserObserver& observer : observers_) {
|
||||
observer.OnPreMainMessageLoopRun();
|
||||
}
|
||||
observers_.Notify(&BrowserObserver::OnPreMainMessageLoopRun);
|
||||
}
|
||||
|
||||
void Browser::PreCreateThreads() {
|
||||
for (BrowserObserver& observer : observers_) {
|
||||
observer.OnPreCreateThreads();
|
||||
}
|
||||
observers_.Notify(&BrowserObserver::OnPreCreateThreads);
|
||||
}
|
||||
|
||||
void Browser::SetMainMessageLoopQuitClosure(base::OnceClosure quit_closure) {
|
||||
@@ -244,9 +234,7 @@ void Browser::NotifyAndShutdown() {
|
||||
return;
|
||||
|
||||
bool prevent_default = false;
|
||||
for (BrowserObserver& observer : observers_)
|
||||
observer.OnWillQuit(&prevent_default);
|
||||
|
||||
observers_.Notify(&BrowserObserver::OnWillQuit, &prevent_default);
|
||||
if (prevent_default) {
|
||||
is_quitting_ = false;
|
||||
return;
|
||||
@@ -257,9 +245,7 @@ void Browser::NotifyAndShutdown() {
|
||||
|
||||
bool Browser::HandleBeforeQuit() {
|
||||
bool prevent_default = false;
|
||||
for (BrowserObserver& observer : observers_)
|
||||
observer.OnBeforeQuit(&prevent_default);
|
||||
|
||||
observers_.Notify(&BrowserObserver::OnBeforeQuit, &prevent_default);
|
||||
return !prevent_default;
|
||||
}
|
||||
|
||||
@@ -276,25 +262,21 @@ void Browser::OnWindowAllClosed() {
|
||||
} else if (is_quitting_) {
|
||||
NotifyAndShutdown();
|
||||
} else {
|
||||
for (BrowserObserver& observer : observers_)
|
||||
observer.OnWindowAllClosed();
|
||||
observers_.Notify(&BrowserObserver::OnWindowAllClosed);
|
||||
}
|
||||
}
|
||||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
void Browser::NewWindowForTab() {
|
||||
for (BrowserObserver& observer : observers_)
|
||||
observer.OnNewWindowForTab();
|
||||
observers_.Notify(&BrowserObserver::OnNewWindowForTab);
|
||||
}
|
||||
|
||||
void Browser::DidBecomeActive() {
|
||||
for (BrowserObserver& observer : observers_)
|
||||
observer.OnDidBecomeActive();
|
||||
observers_.Notify(&BrowserObserver::OnDidBecomeActive);
|
||||
}
|
||||
|
||||
void Browser::DidResignActive() {
|
||||
for (BrowserObserver& observer : observers_)
|
||||
observer.OnDidResignActive();
|
||||
observers_.Notify(&BrowserObserver::OnDidResignActive);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -4,10 +4,9 @@
|
||||
|
||||
#include "shell/browser/electron_browser_main_parts.h"
|
||||
|
||||
#include <string_view>
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "base/environment.h"
|
||||
#include "base/strings/cstring_view.h"
|
||||
#include "ui/base/ozone_buildflags.h"
|
||||
#include "ui/ozone/public/ozone_switches.h"
|
||||
|
||||
@@ -22,7 +21,7 @@ namespace electron {
|
||||
|
||||
namespace {
|
||||
|
||||
constexpr std::string_view kElectronOzonePlatformHint{
|
||||
constexpr base::cstring_view kElectronOzonePlatformHint{
|
||||
"ELECTRON_OZONE_PLATFORM_HINT"};
|
||||
|
||||
#if BUILDFLAG(IS_OZONE_WAYLAND)
|
||||
|
||||
@@ -56,25 +56,25 @@ class ElectronHidDelegate::ContextObservation
|
||||
|
||||
// HidChooserContext::DeviceObserver:
|
||||
void OnDeviceAdded(const device::mojom::HidDeviceInfo& device_info) override {
|
||||
for (auto& observer : observer_list_)
|
||||
observer.OnDeviceAdded(device_info);
|
||||
observer_list_.Notify(&content::HidDelegate::Observer::OnDeviceAdded,
|
||||
device_info);
|
||||
}
|
||||
|
||||
void OnDeviceRemoved(
|
||||
const device::mojom::HidDeviceInfo& device_info) override {
|
||||
for (auto& observer : observer_list_)
|
||||
observer.OnDeviceRemoved(device_info);
|
||||
observer_list_.Notify(&content::HidDelegate::Observer::OnDeviceRemoved,
|
||||
device_info);
|
||||
}
|
||||
|
||||
void OnDeviceChanged(
|
||||
const device::mojom::HidDeviceInfo& device_info) override {
|
||||
for (auto& observer : observer_list_)
|
||||
observer.OnDeviceChanged(device_info);
|
||||
observer_list_.Notify(&content::HidDelegate::Observer::OnDeviceChanged,
|
||||
device_info);
|
||||
}
|
||||
|
||||
void OnHidManagerConnectionError() override {
|
||||
for (auto& observer : observer_list_)
|
||||
observer.OnHidManagerConnectionError();
|
||||
observer_list_.Notify(
|
||||
&content::HidDelegate::Observer::OnHidManagerConnectionError);
|
||||
}
|
||||
|
||||
void OnHidChooserContextShutdown() override {
|
||||
|
||||
@@ -244,8 +244,7 @@ void HidChooserContext::DeviceAdded(device::mojom::HidDeviceInfoPtr device) {
|
||||
devices_.insert({device->guid, device->Clone()});
|
||||
|
||||
// Notify all observers.
|
||||
for (auto& observer : device_observer_list_)
|
||||
observer.OnDeviceAdded(*device);
|
||||
device_observer_list_.Notify(&DeviceObserver::OnDeviceAdded, *device);
|
||||
}
|
||||
|
||||
void HidChooserContext::DeviceRemoved(device::mojom::HidDeviceInfoPtr device) {
|
||||
@@ -256,8 +255,7 @@ void HidChooserContext::DeviceRemoved(device::mojom::HidDeviceInfoPtr device) {
|
||||
DCHECK_EQ(n_erased, 1U);
|
||||
|
||||
// Notify all device observers.
|
||||
for (auto& observer : device_observer_list_)
|
||||
observer.OnDeviceRemoved(*device);
|
||||
device_observer_list_.Notify(&DeviceObserver::OnDeviceRemoved, *device);
|
||||
|
||||
// Next we'll notify observers for revoked permissions. If the device does not
|
||||
// support persistent permissions then device permissions are revoked on
|
||||
@@ -278,8 +276,7 @@ void HidChooserContext::DeviceChanged(device::mojom::HidDeviceInfoPtr device) {
|
||||
mapped = device->Clone();
|
||||
|
||||
// Notify all observers.
|
||||
for (auto& observer : device_observer_list_)
|
||||
observer.OnDeviceChanged(*device);
|
||||
device_observer_list_.Notify(&DeviceObserver::OnDeviceChanged, *device);
|
||||
}
|
||||
|
||||
void HidChooserContext::EnsureHidManagerConnection() {
|
||||
@@ -329,8 +326,7 @@ void HidChooserContext::OnHidManagerConnectionError() {
|
||||
ephemeral_devices_.clear();
|
||||
|
||||
// Notify all device observers.
|
||||
for (auto& observer : device_observer_list_)
|
||||
observer.OnHidManagerConnectionError();
|
||||
device_observer_list_.Notify(&DeviceObserver::OnHidManagerConnectionError);
|
||||
}
|
||||
|
||||
} // namespace electron
|
||||
|
||||
17
shell/browser/linux/x11_util.cc
Normal file
17
shell/browser/linux/x11_util.cc
Normal file
@@ -0,0 +1,17 @@
|
||||
// Copyright (c) 2025 Microsoft GmbH.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "shell/browser/linux/x11_util.h"
|
||||
|
||||
#include "ui/ozone/public/ozone_platform.h"
|
||||
|
||||
namespace x11_util {
|
||||
|
||||
bool IsX11() {
|
||||
return ui::OzonePlatform::GetInstance()
|
||||
->GetPlatformProperties()
|
||||
.electron_can_call_x11;
|
||||
}
|
||||
|
||||
} // namespace x11_util
|
||||
14
shell/browser/linux/x11_util.h
Normal file
14
shell/browser/linux/x11_util.h
Normal file
@@ -0,0 +1,14 @@
|
||||
// Copyright (c) 2025 Microsoft GmbH.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef ELECTRON_SHELL_BROWSER_LINUX_X11_UTIL_H_
|
||||
#define ELECTRON_SHELL_BROWSER_LINUX_X11_UTIL_H_
|
||||
|
||||
namespace x11_util {
|
||||
|
||||
bool IsX11();
|
||||
|
||||
} // namespace x11_util
|
||||
|
||||
#endif // ELECTRON_SHELL_BROWSER_LINUX_X11_UTIL_H_
|
||||
@@ -13,9 +13,11 @@
|
||||
#include "content/public/browser/browser_accessibility_state.h"
|
||||
#include "content/public/browser/native_event_processor_mac.h"
|
||||
#include "content/public/browser/native_event_processor_observer_mac.h"
|
||||
#include "content/public/browser/scoped_accessibility_mode.h"
|
||||
#include "shell/browser/browser.h"
|
||||
#include "shell/browser/mac/dict_util.h"
|
||||
#import "shell/browser/mac/electron_application_delegate.h"
|
||||
#include "ui/accessibility/ax_mode.h"
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -34,7 +36,10 @@ inline void dispatch_sync_main(dispatch_block_t block) {
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation AtomApplication
|
||||
@implementation AtomApplication {
|
||||
std::unique_ptr<content::ScopedAccessibilityMode>
|
||||
_scoped_accessibility_mode_general;
|
||||
}
|
||||
|
||||
+ (AtomApplication*)sharedApplication {
|
||||
return (AtomApplication*)[super sharedApplication];
|
||||
@@ -209,13 +214,12 @@ inline void dispatch_sync_main(dispatch_block_t block) {
|
||||
- (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute {
|
||||
bool is_manual_ax = [attribute isEqualToString:@"AXManualAccessibility"];
|
||||
if ([attribute isEqualToString:@"AXEnhancedUserInterface"] || is_manual_ax) {
|
||||
auto* ax_state = content::BrowserAccessibilityState::GetInstance();
|
||||
// TODO(wg-upgrades): crbug.com/1470199 remove use of deprecated
|
||||
// AddAccessibilityModeFlags() and RemoveAccessibilityModeFlags()
|
||||
if ([value boolValue]) {
|
||||
ax_state->AddAccessibilityModeFlags(ui::kAXModeComplete);
|
||||
} else {
|
||||
ax_state->RemoveAccessibilityModeFlags(ui::kAXModeComplete);
|
||||
if (![value boolValue]) {
|
||||
_scoped_accessibility_mode_general.reset();
|
||||
} else if (!_scoped_accessibility_mode_general) {
|
||||
_scoped_accessibility_mode_general =
|
||||
content::BrowserAccessibilityState::GetInstance()
|
||||
->CreateScopedModeForProcess(ui::kAXModeComplete);
|
||||
}
|
||||
|
||||
electron::Browser::Get()->OnAccessibilitySupportChanged();
|
||||
@@ -230,15 +234,21 @@ inline void dispatch_sync_main(dispatch_block_t block) {
|
||||
return [super accessibilitySetValue:value forAttribute:attribute];
|
||||
}
|
||||
|
||||
// FROM:
|
||||
// https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/chrome_browser_application_mac.mm;l=549;drc=4341cc4e529444bd201ad3aeeed0ec561e04103f
|
||||
- (NSAccessibilityRole)accessibilityRole {
|
||||
// For non-VoiceOver AT, such as Voice Control, Apple recommends turning on
|
||||
// a11y when an AT accesses the 'accessibilityRole' property. This function
|
||||
// is accessed frequently so we only change the accessibility state when
|
||||
// accessibility is disabled.
|
||||
auto* ax_state = content::BrowserAccessibilityState::GetInstance();
|
||||
if (!ax_state->GetAccessibilityMode().has_mode(ui::kAXModeBasic.flags())) {
|
||||
ax_state->AddAccessibilityModeFlags(ui::kAXModeBasic);
|
||||
// For non-VoiceOver assistive technology (AT), such as Voice Control, Apple
|
||||
// recommends turning on a11y when an AT accesses the 'accessibilityRole'
|
||||
// property. This function is accessed frequently, so we only change the
|
||||
// accessibility state when accessibility is already disabled.
|
||||
if (!_scoped_accessibility_mode_general) {
|
||||
ui::AXMode target_mode = ui::kAXModeBasic;
|
||||
_scoped_accessibility_mode_general =
|
||||
content::BrowserAccessibilityState::GetInstance()
|
||||
->CreateScopedModeForProcess(target_mode |
|
||||
ui::AXMode::kFromPlatform);
|
||||
}
|
||||
|
||||
return [super accessibilityRole];
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include "shell/common/options_switches.h"
|
||||
#include "ui/base/hit_test.h"
|
||||
#include "ui/compositor/compositor.h"
|
||||
#include "ui/views/widget/native_widget_private.h"
|
||||
#include "ui/views/widget/widget.h"
|
||||
|
||||
#if !BUILDFLAG(IS_MAC)
|
||||
@@ -285,10 +284,6 @@ void NativeWindow::InitFromOptions(const gin_helper::Dictionary& options) {
|
||||
Show();
|
||||
}
|
||||
|
||||
bool NativeWindow::IsClosed() const {
|
||||
return is_closed_;
|
||||
}
|
||||
|
||||
void NativeWindow::SetSize(const gfx::Size& size, bool animate) {
|
||||
SetBounds(gfx::Rect(GetPosition(), size), animate);
|
||||
}
|
||||
@@ -505,36 +500,48 @@ void NativeWindow::SetWindowControlsOverlayRect(const gfx::Rect& overlay_rect) {
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyWindowRequestPreferredWidth(int* width) {
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.RequestPreferredWidth(width);
|
||||
observers_.Notify(&NativeWindowObserver::RequestPreferredWidth, width);
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyWindowCloseButtonClicked() {
|
||||
// First ask the observers whether we want to close.
|
||||
bool prevent_default = false;
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.WillCloseWindow(&prevent_default);
|
||||
observers_.Notify(&NativeWindowObserver::WillCloseWindow, &prevent_default);
|
||||
if (prevent_default) {
|
||||
WindowList::WindowCloseCancelled(this);
|
||||
return;
|
||||
}
|
||||
|
||||
// Then ask the observers how should we close the window.
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnCloseButtonClicked(&prevent_default);
|
||||
observers_.Notify(&NativeWindowObserver::OnCloseButtonClicked,
|
||||
&prevent_default);
|
||||
if (prevent_default)
|
||||
return;
|
||||
|
||||
CloseImmediately();
|
||||
}
|
||||
|
||||
void NativeWindow::Close() {
|
||||
if (!IsClosable()) {
|
||||
WindowList::WindowCloseCancelled(this);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!is_closed())
|
||||
CloseImpl();
|
||||
}
|
||||
|
||||
void NativeWindow::CloseImmediately() {
|
||||
if (!is_closed())
|
||||
CloseImmediatelyImpl();
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyWindowClosed() {
|
||||
if (is_closed_)
|
||||
if (is_closed())
|
||||
return;
|
||||
|
||||
is_closed_ = true;
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnWindowClosed();
|
||||
observers_.Notify(&NativeWindowObserver::OnWindowClosed);
|
||||
|
||||
WindowList::RemoveWindow(this);
|
||||
}
|
||||
@@ -542,180 +549,153 @@ void NativeWindow::NotifyWindowClosed() {
|
||||
void NativeWindow::NotifyWindowQueryEndSession(
|
||||
const std::vector<std::string>& reasons,
|
||||
bool* prevent_default) {
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnWindowQueryEndSession(reasons, prevent_default);
|
||||
observers_.Notify(&NativeWindowObserver::OnWindowQueryEndSession, reasons,
|
||||
prevent_default);
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyWindowEndSession(
|
||||
const std::vector<std::string>& reasons) {
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnWindowEndSession(reasons);
|
||||
observers_.Notify(&NativeWindowObserver::OnWindowEndSession, reasons);
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyWindowBlur() {
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnWindowBlur();
|
||||
observers_.Notify(&NativeWindowObserver::OnWindowBlur);
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyWindowFocus() {
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnWindowFocus();
|
||||
observers_.Notify(&NativeWindowObserver::OnWindowFocus);
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyWindowIsKeyChanged(bool is_key) {
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnWindowIsKeyChanged(is_key);
|
||||
observers_.Notify(&NativeWindowObserver::OnWindowIsKeyChanged, is_key);
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyWindowShow() {
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnWindowShow();
|
||||
observers_.Notify(&NativeWindowObserver::OnWindowShow);
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyWindowHide() {
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnWindowHide();
|
||||
observers_.Notify(&NativeWindowObserver::OnWindowHide);
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyWindowMaximize() {
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnWindowMaximize();
|
||||
observers_.Notify(&NativeWindowObserver::OnWindowMaximize);
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyWindowUnmaximize() {
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnWindowUnmaximize();
|
||||
observers_.Notify(&NativeWindowObserver::OnWindowUnmaximize);
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyWindowMinimize() {
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnWindowMinimize();
|
||||
observers_.Notify(&NativeWindowObserver::OnWindowMinimize);
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyWindowRestore() {
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnWindowRestore();
|
||||
observers_.Notify(&NativeWindowObserver::OnWindowRestore);
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyWindowWillResize(const gfx::Rect& new_bounds,
|
||||
const gfx::ResizeEdge& edge,
|
||||
bool* prevent_default) {
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnWindowWillResize(new_bounds, edge, prevent_default);
|
||||
observers_.Notify(&NativeWindowObserver::OnWindowWillResize, new_bounds, edge,
|
||||
prevent_default);
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyWindowWillMove(const gfx::Rect& new_bounds,
|
||||
bool* prevent_default) {
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnWindowWillMove(new_bounds, prevent_default);
|
||||
observers_.Notify(&NativeWindowObserver::OnWindowWillMove, new_bounds,
|
||||
prevent_default);
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyWindowResize() {
|
||||
NotifyLayoutWindowControlsOverlay();
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnWindowResize();
|
||||
observers_.Notify(&NativeWindowObserver::OnWindowResize);
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyWindowResized() {
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnWindowResized();
|
||||
observers_.Notify(&NativeWindowObserver::OnWindowResized);
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyWindowMove() {
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnWindowMove();
|
||||
observers_.Notify(&NativeWindowObserver::OnWindowMove);
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyWindowMoved() {
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnWindowMoved();
|
||||
observers_.Notify(&NativeWindowObserver::OnWindowMoved);
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyWindowEnterFullScreen() {
|
||||
NotifyLayoutWindowControlsOverlay();
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnWindowEnterFullScreen();
|
||||
observers_.Notify(&NativeWindowObserver::OnWindowEnterFullScreen);
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyWindowSwipe(const std::string& direction) {
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnWindowSwipe(direction);
|
||||
observers_.Notify(&NativeWindowObserver::OnWindowSwipe, direction);
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyWindowRotateGesture(float rotation) {
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnWindowRotateGesture(rotation);
|
||||
observers_.Notify(&NativeWindowObserver::OnWindowRotateGesture, rotation);
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyWindowSheetBegin() {
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnWindowSheetBegin();
|
||||
observers_.Notify(&NativeWindowObserver::OnWindowSheetBegin);
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyWindowSheetEnd() {
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnWindowSheetEnd();
|
||||
observers_.Notify(&NativeWindowObserver::OnWindowSheetEnd);
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyWindowLeaveFullScreen() {
|
||||
NotifyLayoutWindowControlsOverlay();
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnWindowLeaveFullScreen();
|
||||
observers_.Notify(&NativeWindowObserver::OnWindowLeaveFullScreen);
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyWindowEnterHtmlFullScreen() {
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnWindowEnterHtmlFullScreen();
|
||||
observers_.Notify(&NativeWindowObserver::OnWindowEnterHtmlFullScreen);
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyWindowLeaveHtmlFullScreen() {
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnWindowLeaveHtmlFullScreen();
|
||||
observers_.Notify(&NativeWindowObserver::OnWindowLeaveHtmlFullScreen);
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyWindowAlwaysOnTopChanged() {
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnWindowAlwaysOnTopChanged();
|
||||
observers_.Notify(&NativeWindowObserver::OnWindowAlwaysOnTopChanged);
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyWindowExecuteAppCommand(
|
||||
const std::string_view command_name) {
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnExecuteAppCommand(command_name);
|
||||
observers_.Notify(&NativeWindowObserver::OnExecuteAppCommand, command_name);
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyTouchBarItemInteraction(const std::string& item_id,
|
||||
base::Value::Dict details) {
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnTouchBarItemResult(item_id, details);
|
||||
observers_.Notify(&NativeWindowObserver::OnTouchBarItemResult, item_id,
|
||||
details);
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyNewWindowForTab() {
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnNewWindowForTab();
|
||||
observers_.Notify(&NativeWindowObserver::OnNewWindowForTab);
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyWindowSystemContextMenu(int x,
|
||||
int y,
|
||||
bool* prevent_default) {
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnSystemContextMenu(x, y, prevent_default);
|
||||
observers_.Notify(&NativeWindowObserver::OnSystemContextMenu, x, y,
|
||||
prevent_default);
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyLayoutWindowControlsOverlay() {
|
||||
auto bounding_rect = GetWindowControlsOverlayRect();
|
||||
if (bounding_rect.has_value()) {
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.UpdateWindowControlsOverlay(bounding_rect.value());
|
||||
}
|
||||
if (const auto bounds = GetWindowControlsOverlayRect())
|
||||
observers_.Notify(&NativeWindowObserver::UpdateWindowControlsOverlay,
|
||||
*bounds);
|
||||
}
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
void NativeWindow::NotifyWindowMessage(UINT message,
|
||||
WPARAM w_param,
|
||||
LPARAM l_param) {
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnWindowMessage(message, w_param, l_param);
|
||||
observers_.Notify(&NativeWindowObserver::OnWindowMessage, message, w_param,
|
||||
l_param);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -823,20 +803,6 @@ void NativeWindow::HandlePendingFullscreenTransitions() {
|
||||
SetFullScreen(next_transition);
|
||||
}
|
||||
|
||||
void NativeWindow::SetContentProtection(bool enable) {
|
||||
#if !BUILDFLAG(IS_LINUX)
|
||||
widget()->native_widget_private()->SetAllowScreenshots(!enable);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool NativeWindow::IsContentProtected() const {
|
||||
#if !BUILDFLAG(IS_LINUX)
|
||||
return !widget()->native_widget_private()->AreScreenshotsAllowed();
|
||||
#else // Not implemented on Linux
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool NativeWindow::IsTranslucent() const {
|
||||
// Transparent windows are translucent
|
||||
if (transparent()) {
|
||||
|
||||
@@ -82,9 +82,10 @@ class NativeWindow : public base::SupportsUserData,
|
||||
|
||||
virtual void SetContentView(views::View* view) = 0;
|
||||
|
||||
virtual void Close() = 0;
|
||||
virtual void CloseImmediately() = 0;
|
||||
virtual bool IsClosed() const;
|
||||
// wrapper around CloseImpl that checks that window_ can be closed
|
||||
void Close();
|
||||
// wrapper around CloseImmediatelyImpl that checks that window_ can be closed
|
||||
void CloseImmediately();
|
||||
virtual void Focus(bool focus) = 0;
|
||||
virtual bool IsFocused() const = 0;
|
||||
virtual void Show() = 0;
|
||||
@@ -186,8 +187,8 @@ class NativeWindow : public base::SupportsUserData,
|
||||
virtual void SetDocumentEdited(bool edited) {}
|
||||
virtual bool IsDocumentEdited() const;
|
||||
virtual void SetIgnoreMouseEvents(bool ignore, bool forward) = 0;
|
||||
void SetContentProtection(bool enable);
|
||||
bool IsContentProtected() const;
|
||||
virtual void SetContentProtection(bool enable) = 0;
|
||||
virtual bool IsContentProtected() const = 0;
|
||||
virtual void SetFocusable(bool focusable) {}
|
||||
virtual bool IsFocusable() const;
|
||||
virtual void SetMenu(ElectronMenuModel* menu) {}
|
||||
@@ -435,6 +436,8 @@ class NativeWindow : public base::SupportsUserData,
|
||||
protected:
|
||||
friend class api::BrowserView;
|
||||
|
||||
[[nodiscard]] constexpr bool is_closed() const { return is_closed_; }
|
||||
|
||||
NativeWindow(const gin_helper::Dictionary& options, NativeWindow* parent);
|
||||
|
||||
// views::WidgetDelegate:
|
||||
@@ -444,6 +447,9 @@ class NativeWindow : public base::SupportsUserData,
|
||||
|
||||
void set_content_view(views::View* view) { content_view_ = view; }
|
||||
|
||||
virtual void CloseImpl() = 0;
|
||||
virtual void CloseImmediatelyImpl() = 0;
|
||||
|
||||
// The boolean parsing of the "titleBarOverlay" option
|
||||
bool titlebar_overlay_ = false;
|
||||
|
||||
|
||||
@@ -38,8 +38,8 @@ class NativeWindowMac : public NativeWindow,
|
||||
|
||||
// NativeWindow:
|
||||
void SetContentView(views::View* view) override;
|
||||
void Close() override;
|
||||
void CloseImmediately() override;
|
||||
void CloseImpl() override;
|
||||
void CloseImmediatelyImpl() override;
|
||||
void Focus(bool focus) override;
|
||||
bool IsFocused() const override;
|
||||
void Show() override;
|
||||
@@ -109,6 +109,8 @@ class NativeWindowMac : public NativeWindow,
|
||||
void SetIgnoreMouseEvents(bool ignore, bool forward) override;
|
||||
bool IsHiddenInMissionControl() const override;
|
||||
void SetHiddenInMissionControl(bool hidden) override;
|
||||
void SetContentProtection(bool enable) override;
|
||||
bool IsContentProtected() const override;
|
||||
void SetFocusable(bool focusable) override;
|
||||
bool IsFocusable() const override;
|
||||
void SetParentWindow(NativeWindow* parent) override;
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
#include "shell/browser/ui/cocoa/root_view_mac.h"
|
||||
#include "shell/browser/ui/cocoa/window_buttons_proxy.h"
|
||||
#include "shell/browser/ui/drag_util.h"
|
||||
#include "shell/browser/window_list.h"
|
||||
#include "shell/common/gin_converters/gfx_converter.h"
|
||||
#include "shell/common/gin_helper/dictionary.h"
|
||||
#include "shell/common/node_util.h"
|
||||
@@ -182,9 +181,8 @@ NativeWindowMac::NativeWindowMac(const gin_helper::Dictionary& options,
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
if (windowType == "textured" && (transparent() || !has_frame())) {
|
||||
util::EmitWarning(
|
||||
"The 'textured' window type is deprecated and will be removed",
|
||||
"DeprecationWarning");
|
||||
util::EmitDeprecationWarning(
|
||||
"The 'textured' window type is deprecated and will be removed");
|
||||
styleMask |= NSWindowStyleMaskTexturedBackground;
|
||||
}
|
||||
#pragma clang diagnostic pop
|
||||
@@ -332,12 +330,7 @@ void NativeWindowMac::SetContentView(views::View* view) {
|
||||
root_view->DeprecatedLayoutImmediately();
|
||||
}
|
||||
|
||||
void NativeWindowMac::Close() {
|
||||
if (!IsClosable()) {
|
||||
WindowList::WindowCloseCancelled(this);
|
||||
return;
|
||||
}
|
||||
|
||||
void NativeWindowMac::CloseImpl() {
|
||||
if (fullscreen_transition_state() != FullScreenTransitionState::kNone) {
|
||||
SetHasDeferredWindowClose(true);
|
||||
return;
|
||||
@@ -373,7 +366,7 @@ void NativeWindowMac::Close() {
|
||||
}
|
||||
}
|
||||
|
||||
void NativeWindowMac::CloseImmediately() {
|
||||
void NativeWindowMac::CloseImmediatelyImpl() {
|
||||
// Ensure we're detached from the parent window before closing.
|
||||
RemoveChildFromParentWindow();
|
||||
|
||||
@@ -1172,6 +1165,15 @@ void NativeWindowMac::SetIgnoreMouseEvents(bool ignore, bool forward) {
|
||||
}
|
||||
}
|
||||
|
||||
void NativeWindowMac::SetContentProtection(bool enable) {
|
||||
[window_
|
||||
setSharingType:enable ? NSWindowSharingNone : NSWindowSharingReadOnly];
|
||||
}
|
||||
|
||||
bool NativeWindowMac::IsContentProtected() const {
|
||||
return [window_ sharingType] == NSWindowSharingNone;
|
||||
}
|
||||
|
||||
void NativeWindowMac::SetFocusable(bool focusable) {
|
||||
// No known way to unfocus the window if it had the focus. Here we do not
|
||||
// want to call Focus(false) because it moves the window to the back, i.e.
|
||||
@@ -1684,7 +1686,7 @@ bool NativeWindowMac::IsActive() const {
|
||||
}
|
||||
|
||||
void NativeWindowMac::Cleanup() {
|
||||
DCHECK(!IsClosed());
|
||||
DCHECK(!is_closed());
|
||||
ui::NativeTheme::GetInstanceForNativeUi()->RemoveObserver(this);
|
||||
display::Screen::GetScreen()->RemoveObserver(this);
|
||||
[window_ cleanup];
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
#include "shell/browser/ui/views/root_view.h"
|
||||
#include "shell/browser/web_contents_preferences.h"
|
||||
#include "shell/browser/web_view_manager.h"
|
||||
#include "shell/browser/window_list.h"
|
||||
#include "shell/common/electron_constants.h"
|
||||
#include "shell/common/gin_converters/image_converter.h"
|
||||
#include "shell/common/gin_helper/dictionary.h"
|
||||
@@ -44,6 +43,7 @@
|
||||
#include "ui/ozone/public/ozone_platform.h"
|
||||
#include "ui/views/background.h"
|
||||
#include "ui/views/controls/webview/webview.h"
|
||||
#include "ui/views/widget/native_widget_private.h"
|
||||
#include "ui/views/widget/widget.h"
|
||||
#include "ui/views/window/client_view.h"
|
||||
#include "ui/wm/core/shadow_types.h"
|
||||
@@ -53,6 +53,7 @@
|
||||
#include "base/strings/string_util.h"
|
||||
#include "shell/browser/browser.h"
|
||||
#include "shell/browser/linux/unity_service.h"
|
||||
#include "shell/browser/linux/x11_util.h"
|
||||
#include "shell/browser/ui/electron_desktop_window_tree_host_linux.h"
|
||||
#include "shell/browser/ui/views/client_frame_view_linux.h"
|
||||
#include "shell/browser/ui/views/native_frame_view.h"
|
||||
@@ -163,13 +164,6 @@ gfx::Size WindowSizeToContentSizeBuggy(HWND hwnd, const gfx::Size& size) {
|
||||
|
||||
#endif
|
||||
|
||||
[[maybe_unused, nodiscard]] bool IsX11() {
|
||||
static const bool is_x11 = ui::OzonePlatform::GetInstance()
|
||||
->GetPlatformProperties()
|
||||
.electron_can_call_x11;
|
||||
return is_x11;
|
||||
}
|
||||
|
||||
class NativeWindowClientView : public views::ClientView {
|
||||
public:
|
||||
NativeWindowClientView(views::Widget* widget,
|
||||
@@ -331,7 +325,7 @@ NativeWindowViews::NativeWindowViews(const gin_helper::Dictionary& options,
|
||||
if (parent)
|
||||
SetParentWindow(parent);
|
||||
|
||||
if (IsX11()) {
|
||||
if (x11_util::IsX11()) {
|
||||
// Before the window is mapped the SetWMSpecState can not work, so we have
|
||||
// to manually set the _NET_WM_STATE.
|
||||
std::vector<x11::Atom> state_atom_list;
|
||||
@@ -435,22 +429,6 @@ NativeWindowViews::NativeWindowViews(const gin_helper::Dictionary& options,
|
||||
// bounds if the bounds are smaller than the current display
|
||||
SetBounds(gfx::Rect(GetPosition(), bounds.size()), false);
|
||||
#endif
|
||||
|
||||
RegisterDeleteDelegateCallback(
|
||||
RegisterDeleteCallbackPassKey(),
|
||||
base::BindOnce(
|
||||
[](NativeWindowViews* window) {
|
||||
if (window->is_modal() && window->parent()) {
|
||||
auto* parent = window->parent();
|
||||
// Enable parent window after current window gets closed.
|
||||
static_cast<NativeWindowViews*>(parent)->DecrementChildModals();
|
||||
// Focus on parent window.
|
||||
parent->Focus(true);
|
||||
}
|
||||
|
||||
window->NotifyWindowClosed();
|
||||
},
|
||||
this));
|
||||
}
|
||||
|
||||
NativeWindowViews::~NativeWindowViews() {
|
||||
@@ -468,7 +446,7 @@ NativeWindowViews::~NativeWindowViews() {
|
||||
|
||||
void NativeWindowViews::SetGTKDarkThemeEnabled(bool use_dark_theme) {
|
||||
#if BUILDFLAG(IS_LINUX)
|
||||
if (IsX11()) {
|
||||
if (x11_util::IsX11()) {
|
||||
const std::string color = use_dark_theme ? "dark" : "light";
|
||||
auto* connection = x11::Connection::Get();
|
||||
connection->SetStringProperty(
|
||||
@@ -488,16 +466,11 @@ void NativeWindowViews::SetContentView(views::View* view) {
|
||||
root_view_.GetMainView()->DeprecatedLayoutImmediately();
|
||||
}
|
||||
|
||||
void NativeWindowViews::Close() {
|
||||
if (!IsClosable()) {
|
||||
WindowList::WindowCloseCancelled(this);
|
||||
return;
|
||||
}
|
||||
|
||||
void NativeWindowViews::CloseImpl() {
|
||||
widget()->Close();
|
||||
}
|
||||
|
||||
void NativeWindowViews::CloseImmediately() {
|
||||
void NativeWindowViews::CloseImmediatelyImpl() {
|
||||
widget()->CloseNow();
|
||||
}
|
||||
|
||||
@@ -535,7 +508,7 @@ void NativeWindowViews::Show() {
|
||||
|
||||
// On X11, setting Z order before showing the window doesn't take effect,
|
||||
// so we have to call it again.
|
||||
if (IsX11())
|
||||
if (x11_util::IsX11())
|
||||
widget()->SetZOrderLevel(widget()->GetZOrderLevel());
|
||||
#endif
|
||||
}
|
||||
@@ -551,7 +524,7 @@ void NativeWindowViews::ShowInactive() {
|
||||
|
||||
// On X11, setting Z order before showing the window doesn't take effect,
|
||||
// so we have to call it again.
|
||||
if (IsX11())
|
||||
if (x11_util::IsX11())
|
||||
widget()->SetZOrderLevel(widget()->GetZOrderLevel());
|
||||
#endif
|
||||
}
|
||||
@@ -596,7 +569,7 @@ bool NativeWindowViews::IsEnabled() const {
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
return ::IsWindowEnabled(GetAcceleratedWidget());
|
||||
#elif BUILDFLAG(IS_LINUX)
|
||||
if (IsX11())
|
||||
if (x11_util::IsX11())
|
||||
return !event_disabler_.get();
|
||||
NOTIMPLEMENTED();
|
||||
return true;
|
||||
@@ -633,7 +606,7 @@ void NativeWindowViews::SetEnabledInternal(bool enable) {
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
::EnableWindow(GetAcceleratedWidget(), enable);
|
||||
#else
|
||||
if (IsX11()) {
|
||||
if (x11_util::IsX11()) {
|
||||
views::DesktopWindowTreeHostPlatform* tree_host =
|
||||
views::DesktopWindowTreeHostLinux::GetHostForWidget(
|
||||
GetAcceleratedWidget());
|
||||
@@ -965,7 +938,7 @@ bool NativeWindowViews::MoveAbove(const std::string& sourceId) {
|
||||
0, 0, 0,
|
||||
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
|
||||
#else
|
||||
if (IsX11()) {
|
||||
if (x11_util::IsX11()) {
|
||||
if (!IsWindowValid(static_cast<x11::Window>(id.id)))
|
||||
return false;
|
||||
|
||||
@@ -987,7 +960,7 @@ void NativeWindowViews::MoveTop() {
|
||||
size.width(), size.height(),
|
||||
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
|
||||
#else
|
||||
if (IsX11())
|
||||
if (x11_util::IsX11())
|
||||
electron::MoveWindowToForeground(
|
||||
static_cast<x11::Window>(GetAcceleratedWidget()));
|
||||
#endif
|
||||
@@ -1301,7 +1274,7 @@ void NativeWindowViews::SetIgnoreMouseEvents(bool ignore, bool forward) {
|
||||
SetForwardMouseMessages(forward);
|
||||
}
|
||||
#else
|
||||
if (IsX11()) {
|
||||
if (x11_util::IsX11()) {
|
||||
auto* connection = x11::Connection::Get();
|
||||
if (ignore) {
|
||||
x11::Rectangle r{0, 0, 1, 1};
|
||||
@@ -1326,6 +1299,20 @@ void NativeWindowViews::SetIgnoreMouseEvents(bool ignore, bool forward) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void NativeWindowViews::SetContentProtection(bool enable) {
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
widget()->native_widget_private()->SetAllowScreenshots(!enable);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool NativeWindowViews::IsContentProtected() const {
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
return !widget()->native_widget_private()->AreScreenshotsAllowed();
|
||||
#else // Not implemented on Linux
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
void NativeWindowViews::SetFocusable(bool focusable) {
|
||||
widget()->widget_delegate()->SetCanActivate(focusable);
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
@@ -1408,7 +1395,7 @@ void NativeWindowViews::SetParentWindow(NativeWindow* parent) {
|
||||
NativeWindow::SetParentWindow(parent);
|
||||
|
||||
#if BUILDFLAG(IS_LINUX)
|
||||
if (IsX11()) {
|
||||
if (x11_util::IsX11()) {
|
||||
auto* connection = x11::Connection::Get();
|
||||
connection->SetProperty(
|
||||
static_cast<x11::Window>(GetAcceleratedWidget()),
|
||||
@@ -1725,13 +1712,22 @@ void NativeWindowViews::OnWidgetBoundsChanged(views::Widget* changed_widget,
|
||||
}
|
||||
|
||||
void NativeWindowViews::OnWidgetDestroying(views::Widget* widget) {
|
||||
aura::Window* window = GetNativeWindow();
|
||||
if (window)
|
||||
if (aura::Window* window = GetNativeWindow())
|
||||
window->RemovePreTargetHandler(this);
|
||||
|
||||
if (is_modal()) {
|
||||
if (NativeWindow* const parent = this->parent()) {
|
||||
// Enable parent window after current window gets closed.
|
||||
static_cast<NativeWindowViews*>(parent)->DecrementChildModals();
|
||||
// Focus on parent window.
|
||||
parent->Focus(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void NativeWindowViews::OnWidgetDestroyed(views::Widget* changed_widget) {
|
||||
widget_destroyed_ = true;
|
||||
NotifyWindowClosed();
|
||||
}
|
||||
|
||||
views::View* NativeWindowViews::GetInitiallyFocusedView() {
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
#include "base/win/scoped_gdi_object.h"
|
||||
#include "content/public/browser/scoped_accessibility_mode.h"
|
||||
#include "shell/browser/ui/win/taskbar_host.h"
|
||||
#endif
|
||||
|
||||
@@ -47,8 +48,8 @@ class NativeWindowViews : public NativeWindow,
|
||||
|
||||
// NativeWindow:
|
||||
void SetContentView(views::View* view) override;
|
||||
void Close() override;
|
||||
void CloseImmediately() override;
|
||||
void CloseImpl() override;
|
||||
void CloseImmediatelyImpl() override;
|
||||
void Focus(bool focus) override;
|
||||
bool IsFocused() const override;
|
||||
void Show() override;
|
||||
@@ -115,6 +116,8 @@ class NativeWindowViews : public NativeWindow,
|
||||
void SetOpacity(const double opacity) override;
|
||||
double GetOpacity() const override;
|
||||
void SetIgnoreMouseEvents(bool ignore, bool forward) override;
|
||||
void SetContentProtection(bool enable) override;
|
||||
bool IsContentProtected() const override;
|
||||
void SetFocusable(bool focusable) override;
|
||||
bool IsFocusable() const override;
|
||||
void SetMenu(ElectronMenuModel* menu_model) override;
|
||||
@@ -307,6 +310,8 @@ class NativeWindowViews : public NativeWindow,
|
||||
// The message ID of the "TaskbarCreated" message, sent to us when we need to
|
||||
// reset our thumbar buttons.
|
||||
UINT taskbar_created_message_ = 0;
|
||||
|
||||
std::unique_ptr<content::ScopedAccessibilityMode> scoped_accessibility_mode_;
|
||||
#endif
|
||||
|
||||
// Handles unhandled keyboard messages coming back from the renderer process.
|
||||
|
||||
@@ -280,11 +280,11 @@ bool NativeWindowViews::PreHandleMSG(UINT message,
|
||||
|
||||
checked_for_a11y_support_ = true;
|
||||
|
||||
// TODO(wg-upgrades): crbug.com/1470199 remove use of deprecated
|
||||
// AddAccessibilityModeFlags() and RemoveAccessibilityModeFlags()
|
||||
auto* const axState = content::BrowserAccessibilityState::GetInstance();
|
||||
if (axState && axState->GetAccessibilityMode() != ui::kAXModeComplete) {
|
||||
axState->AddAccessibilityModeFlags(ui::kAXModeComplete);
|
||||
scoped_accessibility_mode_ =
|
||||
content::BrowserAccessibilityState::GetInstance()
|
||||
->CreateScopedModeForProcess(ui::kAXModeComplete);
|
||||
Browser::Get()->OnAccessibilitySupportChanged();
|
||||
}
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ void OffScreenVideoConsumer::OnFrameCaptured(
|
||||
texture.shared_texture_handle =
|
||||
reinterpret_cast<uintptr_t>(gmb_handle.io_surface.get());
|
||||
#elif BUILDFLAG(IS_LINUX)
|
||||
const auto& native_pixmap = gmb_handle.native_pixmap_handle;
|
||||
const auto& native_pixmap = gmb_handle.native_pixmap_handle();
|
||||
texture.modifier = native_pixmap.modifier;
|
||||
for (const auto& plane : native_pixmap.planes) {
|
||||
texture.planes.emplace_back(plane.stride, plane.offset, plane.size,
|
||||
|
||||
@@ -128,20 +128,19 @@ void ElectronSerialDelegate::DeleteControllerForFrame(
|
||||
// SerialChooserContext::PortObserver:
|
||||
void ElectronSerialDelegate::OnPortAdded(
|
||||
const device::mojom::SerialPortInfo& port) {
|
||||
for (auto& observer : observer_list_)
|
||||
observer.OnPortAdded(port);
|
||||
observer_list_.Notify(&content::SerialDelegate::Observer::OnPortAdded, port);
|
||||
}
|
||||
|
||||
void ElectronSerialDelegate::OnPortRemoved(
|
||||
const device::mojom::SerialPortInfo& port) {
|
||||
for (auto& observer : observer_list_)
|
||||
observer.OnPortRemoved(port);
|
||||
observer_list_.Notify(&content::SerialDelegate::Observer::OnPortRemoved,
|
||||
port);
|
||||
}
|
||||
|
||||
void ElectronSerialDelegate::OnPortManagerConnectionError() {
|
||||
port_observation_.Reset();
|
||||
for (auto& observer : observer_list_)
|
||||
observer.OnPortManagerConnectionError();
|
||||
observer_list_.Notify(
|
||||
&content::SerialDelegate::Observer::OnPortManagerConnectionError);
|
||||
}
|
||||
|
||||
void ElectronSerialDelegate::OnSerialChooserContextShutdown() {
|
||||
|
||||
@@ -238,15 +238,12 @@ void SerialChooserContext::OnPortAdded(device::mojom::SerialPortInfoPtr port) {
|
||||
ports.erase(port->token);
|
||||
}
|
||||
|
||||
for (auto& observer : port_observer_list_)
|
||||
observer.OnPortAdded(*port);
|
||||
port_observer_list_.Notify(&PortObserver::OnPortAdded, *port);
|
||||
}
|
||||
|
||||
void SerialChooserContext::OnPortRemoved(
|
||||
device::mojom::SerialPortInfoPtr port) {
|
||||
for (auto& observer : port_observer_list_)
|
||||
observer.OnPortRemoved(*port);
|
||||
|
||||
port_observer_list_.Notify(&PortObserver::OnPortRemoved, *port);
|
||||
port_info_.erase(port->token);
|
||||
}
|
||||
|
||||
|
||||
@@ -101,16 +101,12 @@ void ElectronMenuModel::SetSharingItem(SharingItem item) {
|
||||
|
||||
void ElectronMenuModel::MenuWillClose() {
|
||||
ui::SimpleMenuModel::MenuWillClose();
|
||||
for (Observer& observer : observers_) {
|
||||
observer.OnMenuWillClose();
|
||||
}
|
||||
observers_.Notify(&Observer::OnMenuWillClose);
|
||||
}
|
||||
|
||||
void ElectronMenuModel::MenuWillShow() {
|
||||
ui::SimpleMenuModel::MenuWillShow();
|
||||
for (Observer& observer : observers_) {
|
||||
observer.OnMenuWillShow();
|
||||
}
|
||||
observers_.Notify(&Observer::OnMenuWillShow);
|
||||
}
|
||||
|
||||
ElectronMenuModel* ElectronMenuModel::GetSubmenuModelAt(size_t index) {
|
||||
|
||||
@@ -77,6 +77,16 @@ bool ShowSaveDialogSync(const DialogSettings& settings, base::FilePath* path);
|
||||
void ShowSaveDialog(const DialogSettings& settings,
|
||||
gin_helper::Promise<gin_helper::Dictionary> promise);
|
||||
|
||||
#if BUILDFLAG(IS_LINUX)
|
||||
// Rewrite of SelectFileDialogLinuxPortal equivalent functions with primary
|
||||
// difference being that dbus_thread_linux::GetSharedSessionBus is not used
|
||||
// so that version detection can be initiated and compeleted on the dbus thread
|
||||
// Refs https://github.com/electron/electron/issues/46652
|
||||
void StartPortalAvailabilityTestInBackground();
|
||||
bool IsPortalAvailable();
|
||||
uint32_t GetPortalVersion();
|
||||
#endif
|
||||
|
||||
} // namespace file_dialog
|
||||
|
||||
#endif // ELECTRON_SHELL_BROWSER_UI_FILE_DIALOG_H_
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#include "shell/common/gin_helper/dictionary.h"
|
||||
#include "shell/common/gin_helper/promise.h"
|
||||
#include "ui/shell_dialogs/select_file_dialog.h"
|
||||
#include "ui/shell_dialogs/select_file_dialog_linux_portal.h"
|
||||
#include "ui/shell_dialogs/select_file_policy.h"
|
||||
#include "ui/shell_dialogs/selected_file_info.h"
|
||||
|
||||
@@ -60,11 +59,9 @@ ui::SelectFileDialog::FileTypeInfo GetFilterInfo(const Filters& filters) {
|
||||
}
|
||||
|
||||
void LogIfNeededAboutUnsupportedPortalFeature(const DialogSettings& settings) {
|
||||
if (!settings.default_path.empty() &&
|
||||
ui::SelectFileDialogLinuxPortal::IsPortalAvailable() &&
|
||||
ui::SelectFileDialogLinuxPortal::GetPortalVersion() < 4) {
|
||||
LOG(INFO) << "Available portal version "
|
||||
<< ui::SelectFileDialogLinuxPortal::GetPortalVersion()
|
||||
if (!settings.default_path.empty() && IsPortalAvailable() &&
|
||||
GetPortalVersion() < 4) {
|
||||
LOG(INFO) << "Available portal version " << GetPortalVersion()
|
||||
<< " does not support defaultPath option, try the non-portal"
|
||||
<< " file chooser dialogs by launching with"
|
||||
<< " --xdg-portal-required-version";
|
||||
|
||||
121
shell/browser/ui/file_dialog_linux_portal.cc
Normal file
121
shell/browser/ui/file_dialog_linux_portal.cc
Normal file
@@ -0,0 +1,121 @@
|
||||
// Copyright (c) 2025 Microsoft, GmbH.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "shell/browser/ui/file_dialog.h"
|
||||
|
||||
#include <optional>
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/scoped_refptr.h"
|
||||
#include "base/no_destructor.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/synchronization/atomic_flag.h"
|
||||
#include "components/dbus/thread_linux/dbus_thread_linux.h"
|
||||
#include "components/dbus/utils/check_for_service_and_start.h"
|
||||
#include "dbus/bus.h"
|
||||
#include "dbus/object_path.h"
|
||||
#include "dbus/object_proxy.h"
|
||||
#include "dbus/property.h"
|
||||
|
||||
namespace file_dialog {
|
||||
|
||||
namespace {
|
||||
|
||||
constexpr char kXdgPortalService[] = "org.freedesktop.portal.Desktop";
|
||||
constexpr char kXdgPortalObject[] = "/org/freedesktop/portal/desktop";
|
||||
constexpr char kFileChooserInterfaceName[] =
|
||||
"org.freedesktop.portal.FileChooser";
|
||||
|
||||
// Version 4 includes support for current_folder option to the OpenFile method
|
||||
// via https://github.com/flatpak/xdg-desktop-portal/commit/71165a5.
|
||||
uint32_t g_required_portal_version = 3;
|
||||
uint32_t g_available_portal_version = 0;
|
||||
constexpr char kXdgPortalRequiredVersionFlag[] = "xdg-portal-required-version";
|
||||
|
||||
bool g_portal_available = false;
|
||||
|
||||
struct FileChooserProperties : dbus::PropertySet {
|
||||
dbus::Property<uint32_t> version;
|
||||
|
||||
explicit FileChooserProperties(dbus::ObjectProxy* object_proxy)
|
||||
: dbus::PropertySet(object_proxy, kFileChooserInterfaceName, {}) {
|
||||
RegisterProperty("version", &version);
|
||||
}
|
||||
|
||||
~FileChooserProperties() override = default;
|
||||
};
|
||||
|
||||
base::AtomicFlag* GetAvailabilityTestCompletionFlag() {
|
||||
static base::NoDestructor<base::AtomicFlag> flag;
|
||||
return flag.get();
|
||||
}
|
||||
|
||||
void CheckPortalAvailabilityOnBusThread() {
|
||||
auto* flag = GetAvailabilityTestCompletionFlag();
|
||||
if (flag->IsSet())
|
||||
return;
|
||||
|
||||
dbus::Bus::Options options;
|
||||
options.bus_type = dbus::Bus::SESSION;
|
||||
options.connection_type = dbus::Bus::PRIVATE;
|
||||
options.dbus_task_runner = dbus_thread_linux::GetTaskRunner();
|
||||
scoped_refptr<dbus::Bus> bus = base::MakeRefCounted<dbus::Bus>(options);
|
||||
dbus_utils::CheckForServiceAndStart(
|
||||
bus, kXdgPortalService,
|
||||
base::BindOnce(
|
||||
[](scoped_refptr<dbus::Bus> bus, base::AtomicFlag* flag,
|
||||
std::optional<bool> name_has_owner) {
|
||||
if (name_has_owner.value_or(false)) {
|
||||
//
|
||||
dbus::ObjectPath portal_path(kXdgPortalObject);
|
||||
dbus::ObjectProxy* portal =
|
||||
bus->GetObjectProxy(kXdgPortalService, portal_path);
|
||||
FileChooserProperties properties(portal);
|
||||
if (!properties.GetAndBlock(&properties.version)) {
|
||||
LOG(ERROR) << "Failed to read portal version property";
|
||||
} else if (properties.version.value() >=
|
||||
g_required_portal_version) {
|
||||
g_portal_available = true;
|
||||
g_available_portal_version = properties.version.value();
|
||||
}
|
||||
}
|
||||
VLOG(1) << "File chooser portal available: "
|
||||
<< (g_portal_available ? "yes" : "no");
|
||||
flag->Set();
|
||||
bus->ShutdownAndBlock();
|
||||
},
|
||||
std::move(bus), flag));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
void StartPortalAvailabilityTestInBackground() {
|
||||
if (GetAvailabilityTestCompletionFlag()->IsSet())
|
||||
return;
|
||||
|
||||
const auto* cmd = base::CommandLine::ForCurrentProcess();
|
||||
if (!base::StringToUint(
|
||||
cmd->GetSwitchValueASCII(kXdgPortalRequiredVersionFlag),
|
||||
&g_required_portal_version)) {
|
||||
VLOG(1) << "Unable to parse --xdg-portal-required-version";
|
||||
}
|
||||
|
||||
dbus_thread_linux::GetTaskRunner()->PostTask(
|
||||
FROM_HERE, base::BindOnce(&CheckPortalAvailabilityOnBusThread));
|
||||
}
|
||||
|
||||
bool IsPortalAvailable() {
|
||||
if (!GetAvailabilityTestCompletionFlag()->IsSet())
|
||||
LOG(WARNING) << "Portal availability checked before test was complete";
|
||||
|
||||
return g_portal_available;
|
||||
}
|
||||
|
||||
uint32_t GetPortalVersion() {
|
||||
return g_available_portal_version;
|
||||
}
|
||||
|
||||
} // namespace file_dialog
|
||||
@@ -19,93 +19,75 @@ gfx::Rect TrayIcon::GetBounds() {
|
||||
void TrayIcon::NotifyClicked(const gfx::Rect& bounds,
|
||||
const gfx::Point& location,
|
||||
int modifiers) {
|
||||
for (TrayIconObserver& observer : observers_)
|
||||
observer.OnClicked(bounds, location, modifiers);
|
||||
observers_.Notify(&TrayIconObserver::OnClicked, bounds, location, modifiers);
|
||||
}
|
||||
|
||||
void TrayIcon::NotifyDoubleClicked(const gfx::Rect& bounds, int modifiers) {
|
||||
for (TrayIconObserver& observer : observers_)
|
||||
observer.OnDoubleClicked(bounds, modifiers);
|
||||
observers_.Notify(&TrayIconObserver::OnDoubleClicked, bounds, modifiers);
|
||||
}
|
||||
|
||||
void TrayIcon::NotifyMiddleClicked(const gfx::Rect& bounds, int modifiers) {
|
||||
for (TrayIconObserver& observer : observers_)
|
||||
observer.OnMiddleClicked(bounds, modifiers);
|
||||
observers_.Notify(&TrayIconObserver::OnMiddleClicked, bounds, modifiers);
|
||||
}
|
||||
|
||||
void TrayIcon::NotifyBalloonShow() {
|
||||
for (TrayIconObserver& observer : observers_)
|
||||
observer.OnBalloonShow();
|
||||
observers_.Notify(&TrayIconObserver::OnBalloonShow);
|
||||
}
|
||||
|
||||
void TrayIcon::NotifyBalloonClicked() {
|
||||
for (TrayIconObserver& observer : observers_)
|
||||
observer.OnBalloonClicked();
|
||||
observers_.Notify(&TrayIconObserver::OnBalloonClicked);
|
||||
}
|
||||
|
||||
void TrayIcon::NotifyBalloonClosed() {
|
||||
for (TrayIconObserver& observer : observers_)
|
||||
observer.OnBalloonClosed();
|
||||
observers_.Notify(&TrayIconObserver::OnBalloonClosed);
|
||||
}
|
||||
|
||||
void TrayIcon::NotifyRightClicked(const gfx::Rect& bounds, int modifiers) {
|
||||
for (TrayIconObserver& observer : observers_)
|
||||
observer.OnRightClicked(bounds, modifiers);
|
||||
observers_.Notify(&TrayIconObserver::OnRightClicked, bounds, modifiers);
|
||||
}
|
||||
|
||||
void TrayIcon::NotifyDrop() {
|
||||
for (TrayIconObserver& observer : observers_)
|
||||
observer.OnDrop();
|
||||
observers_.Notify(&TrayIconObserver::OnDrop);
|
||||
}
|
||||
|
||||
void TrayIcon::NotifyDropFiles(const std::vector<std::string>& files) {
|
||||
for (TrayIconObserver& observer : observers_)
|
||||
observer.OnDropFiles(files);
|
||||
observers_.Notify(&TrayIconObserver::OnDropFiles, files);
|
||||
}
|
||||
|
||||
void TrayIcon::NotifyDropText(const std::string& text) {
|
||||
for (TrayIconObserver& observer : observers_)
|
||||
observer.OnDropText(text);
|
||||
observers_.Notify(&TrayIconObserver::OnDropText, text);
|
||||
}
|
||||
|
||||
void TrayIcon::NotifyMouseUp(const gfx::Point& location, int modifiers) {
|
||||
for (TrayIconObserver& observer : observers_)
|
||||
observer.OnMouseUp(location, modifiers);
|
||||
observers_.Notify(&TrayIconObserver::OnMouseUp, location, modifiers);
|
||||
}
|
||||
|
||||
void TrayIcon::NotifyMouseDown(const gfx::Point& location, int modifiers) {
|
||||
for (TrayIconObserver& observer : observers_)
|
||||
observer.OnMouseDown(location, modifiers);
|
||||
observers_.Notify(&TrayIconObserver::OnMouseDown, location, modifiers);
|
||||
}
|
||||
|
||||
void TrayIcon::NotifyMouseEntered(const gfx::Point& location, int modifiers) {
|
||||
for (TrayIconObserver& observer : observers_)
|
||||
observer.OnMouseEntered(location, modifiers);
|
||||
observers_.Notify(&TrayIconObserver::OnMouseEntered, location, modifiers);
|
||||
}
|
||||
|
||||
void TrayIcon::NotifyMouseExited(const gfx::Point& location, int modifiers) {
|
||||
for (TrayIconObserver& observer : observers_)
|
||||
observer.OnMouseExited(location, modifiers);
|
||||
observers_.Notify(&TrayIconObserver::OnMouseExited, location, modifiers);
|
||||
}
|
||||
|
||||
void TrayIcon::NotifyMouseMoved(const gfx::Point& location, int modifiers) {
|
||||
for (TrayIconObserver& observer : observers_)
|
||||
observer.OnMouseMoved(location, modifiers);
|
||||
observers_.Notify(&TrayIconObserver::OnMouseMoved, location, modifiers);
|
||||
}
|
||||
|
||||
void TrayIcon::NotifyDragEntered() {
|
||||
for (TrayIconObserver& observer : observers_)
|
||||
observer.OnDragEntered();
|
||||
observers_.Notify(&TrayIconObserver::OnDragEntered);
|
||||
}
|
||||
|
||||
void TrayIcon::NotifyDragExited() {
|
||||
for (TrayIconObserver& observer : observers_)
|
||||
observer.OnDragExited();
|
||||
observers_.Notify(&TrayIconObserver::OnDragExited);
|
||||
}
|
||||
|
||||
void TrayIcon::NotifyDragEnded() {
|
||||
for (TrayIconObserver& observer : observers_)
|
||||
observer.OnDragEnded();
|
||||
observers_.Notify(&TrayIconObserver::OnDragEnded);
|
||||
}
|
||||
|
||||
} // namespace electron
|
||||
|
||||
@@ -51,14 +51,12 @@ void MenuDelegate::RunMenu(ElectronMenuModel* model,
|
||||
}
|
||||
|
||||
void MenuDelegate::ExecuteCommand(int id) {
|
||||
for (Observer& obs : observers_)
|
||||
obs.OnBeforeExecuteCommand();
|
||||
observers_.Notify(&Observer::OnBeforeExecuteCommand);
|
||||
adapter_->ExecuteCommand(id);
|
||||
}
|
||||
|
||||
void MenuDelegate::ExecuteCommand(int id, int mouse_event_flags) {
|
||||
for (Observer& obs : observers_)
|
||||
obs.OnBeforeExecuteCommand();
|
||||
observers_.Notify(&Observer::OnBeforeExecuteCommand);
|
||||
adapter_->ExecuteCommand(id, mouse_event_flags);
|
||||
}
|
||||
|
||||
@@ -104,8 +102,7 @@ void MenuDelegate::WillHideMenu(views::MenuItemView* menu) {
|
||||
}
|
||||
|
||||
void MenuDelegate::OnMenuClosed(views::MenuItemView* menu) {
|
||||
for (Observer& obs : observers_)
|
||||
obs.OnMenuClosed();
|
||||
observers_.Notify(&Observer::OnMenuClosed);
|
||||
|
||||
// Only switch to new menu when current menu is closed.
|
||||
if (button_to_open_)
|
||||
|
||||
@@ -102,19 +102,19 @@ class ElectronUsbDelegate::ContextObservation
|
||||
|
||||
// UsbChooserContext::DeviceObserver:
|
||||
void OnDeviceAdded(const device::mojom::UsbDeviceInfo& device_info) override {
|
||||
for (auto& observer : observer_list_)
|
||||
observer.OnDeviceAdded(device_info);
|
||||
observer_list_.Notify(&content::UsbDelegate::Observer::OnDeviceAdded,
|
||||
device_info);
|
||||
}
|
||||
|
||||
void OnDeviceRemoved(
|
||||
const device::mojom::UsbDeviceInfo& device_info) override {
|
||||
for (auto& observer : observer_list_)
|
||||
observer.OnDeviceRemoved(device_info);
|
||||
observer_list_.Notify(&content::UsbDelegate::Observer::OnDeviceRemoved,
|
||||
device_info);
|
||||
}
|
||||
|
||||
void OnDeviceManagerConnectionError() override {
|
||||
for (auto& observer : observer_list_)
|
||||
observer.OnDeviceManagerConnectionError();
|
||||
observer_list_.Notify(
|
||||
&content::UsbDelegate::Observer::OnDeviceManagerConnectionError);
|
||||
}
|
||||
|
||||
void OnBrowserContextShutdown() override {
|
||||
|
||||
@@ -290,8 +290,7 @@ void UsbChooserContext::OnDeviceAdded(
|
||||
devices_.try_emplace(device_info->guid, device_info->Clone());
|
||||
|
||||
// Notify all observers.
|
||||
for (auto& observer : device_observer_list_)
|
||||
observer.OnDeviceAdded(*device_info);
|
||||
device_observer_list_.Notify(&DeviceObserver::OnDeviceAdded, *device_info);
|
||||
}
|
||||
|
||||
void UsbChooserContext::OnDeviceRemoved(
|
||||
@@ -308,8 +307,7 @@ void UsbChooserContext::OnDeviceRemoved(
|
||||
DCHECK_EQ(n_erased, 1U);
|
||||
|
||||
// Notify all device observers.
|
||||
for (auto& observer : device_observer_list_)
|
||||
observer.OnDeviceRemoved(*device_info);
|
||||
device_observer_list_.Notify(&DeviceObserver::OnDeviceRemoved, *device_info);
|
||||
|
||||
// If the device was persistent, return. Otherwise, notify all permission
|
||||
// observers that its permissions were revoked.
|
||||
@@ -331,8 +329,7 @@ void UsbChooserContext::OnDeviceManagerConnectionError() {
|
||||
ephemeral_devices_.clear();
|
||||
|
||||
// Notify all device observers.
|
||||
for (auto& observer : device_observer_list_)
|
||||
observer.OnDeviceManagerConnectionError();
|
||||
device_observer_list_.Notify(&DeviceObserver::OnDeviceManagerConnectionError);
|
||||
}
|
||||
|
||||
} // namespace electron
|
||||
|
||||
@@ -48,9 +48,7 @@ WebContentsZoomController::WebContentsZoomController(
|
||||
|
||||
WebContentsZoomController::~WebContentsZoomController() {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
for (auto& observer : observers_) {
|
||||
observer.OnZoomControllerDestroyed(this);
|
||||
}
|
||||
observers_.Notify(&WebContentsZoomObserver::OnZoomControllerDestroyed, this);
|
||||
}
|
||||
|
||||
void WebContentsZoomController::AddObserver(WebContentsZoomObserver* observer) {
|
||||
@@ -90,8 +88,8 @@ bool WebContentsZoomController::SetZoomLevel(double level) {
|
||||
ZoomChangedEventData zoom_change_data(web_contents(), old_zoom_level,
|
||||
zoom_level_, true /* temporary */,
|
||||
zoom_mode_);
|
||||
for (auto& observer : observers_)
|
||||
observer.OnZoomChanged(zoom_change_data);
|
||||
observers_.Notify(&WebContentsZoomObserver::OnZoomChanged,
|
||||
zoom_change_data);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -110,8 +108,8 @@ bool WebContentsZoomController::SetZoomLevel(double level) {
|
||||
zoom_map->SetTemporaryZoomLevel(rfh_id, level);
|
||||
ZoomChangedEventData zoom_change_data(web_contents(), zoom_level_, level,
|
||||
true /* temporary */, zoom_mode_);
|
||||
for (auto& observer : observers_)
|
||||
observer.OnZoomChanged(zoom_change_data);
|
||||
observers_.Notify(&WebContentsZoomObserver::OnZoomChanged,
|
||||
zoom_change_data);
|
||||
} else {
|
||||
const GURL url = content::HostZoomMap::GetURLForRenderFrameHost(rfh_id);
|
||||
if (url.is_empty()) {
|
||||
@@ -148,8 +146,7 @@ void WebContentsZoomController::SetTemporaryZoomLevel(double level) {
|
||||
// Notify observers of zoom level changes.
|
||||
ZoomChangedEventData zoom_change_data(web_contents(), zoom_level_, level,
|
||||
true /* temporary */, zoom_mode_);
|
||||
for (auto& observer : observers_)
|
||||
observer.OnZoomChanged(zoom_change_data);
|
||||
observers_.Notify(&WebContentsZoomObserver::OnZoomChanged, zoom_change_data);
|
||||
}
|
||||
|
||||
bool WebContentsZoomController::UsesTemporaryZoomLevel() {
|
||||
@@ -213,8 +210,8 @@ void WebContentsZoomController::SetZoomMode(ZoomMode new_mode) {
|
||||
} else {
|
||||
// When we don't call any HostZoomMap set functions, we send the event
|
||||
// manually.
|
||||
for (auto& observer : observers_)
|
||||
observer.OnZoomChanged(*event_data_);
|
||||
observers_.Notify(&WebContentsZoomObserver::OnZoomChanged,
|
||||
*event_data_);
|
||||
event_data_.reset();
|
||||
}
|
||||
break;
|
||||
@@ -229,8 +226,8 @@ void WebContentsZoomController::SetZoomMode(ZoomMode new_mode) {
|
||||
} else {
|
||||
// When we don't call any HostZoomMap set functions, we send the event
|
||||
// manually.
|
||||
for (auto& observer : observers_)
|
||||
observer.OnZoomChanged(*event_data_);
|
||||
observers_.Notify(&WebContentsZoomObserver::OnZoomChanged,
|
||||
*event_data_);
|
||||
event_data_.reset();
|
||||
}
|
||||
break;
|
||||
@@ -303,9 +300,7 @@ void WebContentsZoomController::WebContentsDestroyed() {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
// At this point we should no longer be sending any zoom events with this
|
||||
// WebContents.
|
||||
for (auto& observer : observers_) {
|
||||
observer.OnZoomControllerDestroyed(this);
|
||||
}
|
||||
observers_.Notify(&WebContentsZoomObserver::OnZoomControllerDestroyed, this);
|
||||
|
||||
embedder_zoom_controller_ = nullptr;
|
||||
}
|
||||
@@ -389,14 +384,14 @@ void WebContentsZoomController::UpdateState(const std::string& host) {
|
||||
// the change should be sent.
|
||||
ZoomChangedEventData zoom_change_data = *event_data_;
|
||||
event_data_.reset();
|
||||
for (auto& observer : observers_)
|
||||
observer.OnZoomChanged(zoom_change_data);
|
||||
observers_.Notify(&WebContentsZoomObserver::OnZoomChanged,
|
||||
zoom_change_data);
|
||||
} else {
|
||||
double zoom_level = GetZoomLevel();
|
||||
ZoomChangedEventData zoom_change_data(web_contents(), zoom_level,
|
||||
zoom_level, false, zoom_mode_);
|
||||
for (auto& observer : observers_)
|
||||
observer.OnZoomChanged(zoom_change_data);
|
||||
observers_.Notify(&WebContentsZoomObserver::OnZoomChanged,
|
||||
zoom_change_data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -57,16 +57,13 @@ void WindowList::RemoveWindow(NativeWindow* window) {
|
||||
WindowVector& windows = GetInstance()->windows_;
|
||||
std::erase(windows, window);
|
||||
|
||||
if (windows.empty()) {
|
||||
for (WindowListObserver& observer : GetObservers())
|
||||
observer.OnWindowAllClosed();
|
||||
}
|
||||
if (windows.empty())
|
||||
GetObservers().Notify(&WindowListObserver::OnWindowAllClosed);
|
||||
}
|
||||
|
||||
// static
|
||||
void WindowList::WindowCloseCancelled(NativeWindow* window) {
|
||||
for (WindowListObserver& observer : GetObservers())
|
||||
observer.OnWindowCloseCancelled(window);
|
||||
GetObservers().Notify(&WindowListObserver::OnWindowCloseCancelled, window);
|
||||
}
|
||||
|
||||
// static
|
||||
@@ -87,7 +84,7 @@ void WindowList::CloseAllWindows() {
|
||||
std::ranges::reverse(weak_windows);
|
||||
#endif
|
||||
for (const auto& window : weak_windows) {
|
||||
if (window && !window->IsClosed())
|
||||
if (window)
|
||||
window->Close();
|
||||
}
|
||||
}
|
||||
@@ -98,7 +95,7 @@ void WindowList::DestroyAllWindows() {
|
||||
ConvertToWeakPtrVector(GetInstance()->windows_);
|
||||
|
||||
for (const auto& window : weak_windows) {
|
||||
if (window && !window->IsClosed())
|
||||
if (window)
|
||||
window->CloseImmediately();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,9 +286,8 @@ v8::Local<v8::Value> NativeImage::GetBitmap(gin::Arguments* args) {
|
||||
|
||||
if (!deprecated_warning_issued) {
|
||||
deprecated_warning_issued = true;
|
||||
util::EmitWarning(isolate_,
|
||||
"getBitmap() is deprecated, use toBitmap() instead.",
|
||||
"DeprecationWarning");
|
||||
util::EmitDeprecationWarning(
|
||||
isolate_, "getBitmap() is deprecated, use toBitmap() instead.");
|
||||
}
|
||||
|
||||
return ToBitmap(args);
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "base/dcheck_is_on.h"
|
||||
#include "base/logging.h"
|
||||
#include "content/public/common/content_switches.h"
|
||||
#include "shell/common/gin_helper/dictionary.h"
|
||||
#include "shell/common/node_includes.h"
|
||||
#include "v8/include/v8.h"
|
||||
@@ -34,12 +36,18 @@ void Log(int severity, std::string text) {
|
||||
}
|
||||
}
|
||||
|
||||
std::string GetLoggingDestination() {
|
||||
const auto* command_line = base::CommandLine::ForCurrentProcess();
|
||||
return command_line->GetSwitchValueASCII(switches::kEnableLogging);
|
||||
}
|
||||
|
||||
void Initialize(v8::Local<v8::Object> exports,
|
||||
v8::Local<v8::Value> unused,
|
||||
v8::Local<v8::Context> context,
|
||||
void* priv) {
|
||||
gin_helper::Dictionary dict(context->GetIsolate(), exports);
|
||||
dict.SetMethod("log", &Log);
|
||||
dict.SetMethod("getLoggingDestination", &GetLoggingDestination);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "base/json/json_reader.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/pickle.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/values.h"
|
||||
#include "electron/fuses.h"
|
||||
#include "shell/common/asar/asar_util.h"
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include "shell/common/logging.h"
|
||||
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
#include "base/base_switches.h"
|
||||
#include "base/command_line.h"
|
||||
@@ -13,14 +12,45 @@
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/strings/cstring_view.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "chrome/common/chrome_paths.h"
|
||||
#include "content/public/common/content_switches.h"
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
#include <windows.h>
|
||||
#include "base/win/scoped_handle.h"
|
||||
#include "base/win/windows_handle_util.h"
|
||||
#include "sandbox/policy/switches.h"
|
||||
#endif
|
||||
|
||||
namespace logging {
|
||||
|
||||
constexpr std::string_view kLogFileName{"ELECTRON_LOG_FILE"};
|
||||
constexpr std::string_view kElectronEnableLogging{"ELECTRON_ENABLE_LOGGING"};
|
||||
constexpr base::cstring_view kLogFileName{"ELECTRON_LOG_FILE"};
|
||||
constexpr base::cstring_view kElectronEnableLogging{"ELECTRON_ENABLE_LOGGING"};
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
base::win::ScopedHandle GetLogInheritedHandle(
|
||||
const base::CommandLine& command_line) {
|
||||
auto handle_str = command_line.GetSwitchValueNative(::switches::kLogFile);
|
||||
uint32_t handle_value = 0;
|
||||
if (!base::StringToUint(handle_str, &handle_value)) {
|
||||
return {};
|
||||
}
|
||||
// Duplicate the handle from the command line so that different things can
|
||||
// init logging. This means the handle from the parent is never closed, but
|
||||
// there will only be one of these in the process.
|
||||
HANDLE log_handle = nullptr;
|
||||
if (!::DuplicateHandle(::GetCurrentProcess(),
|
||||
base::win::Uint32ToHandle(handle_value),
|
||||
::GetCurrentProcess(), &log_handle, 0,
|
||||
/*bInheritHandle=*/FALSE, DUPLICATE_SAME_ACCESS)) {
|
||||
return {};
|
||||
}
|
||||
// Transfer ownership to the caller.
|
||||
return base::win::ScopedHandle(log_handle);
|
||||
}
|
||||
#endif
|
||||
|
||||
base::FilePath GetLogFileName(const base::CommandLine& command_line) {
|
||||
std::string filename = command_line.GetSwitchValueASCII(switches::kLogFile);
|
||||
@@ -47,9 +77,9 @@ bool HasExplicitLogFile(const base::CommandLine& command_line) {
|
||||
return !filename.empty();
|
||||
}
|
||||
|
||||
LoggingDestination DetermineLoggingDestination(
|
||||
const base::CommandLine& command_line,
|
||||
bool is_preinit) {
|
||||
std::pair<LoggingDestination, bool /* filename_is_handle */>
|
||||
DetermineLoggingDestination(const base::CommandLine& command_line,
|
||||
bool is_preinit) {
|
||||
bool enable_logging = false;
|
||||
std::string logging_destination;
|
||||
if (command_line.HasSwitch(::switches::kEnableLogging)) {
|
||||
@@ -64,7 +94,7 @@ LoggingDestination DetermineLoggingDestination(
|
||||
}
|
||||
}
|
||||
if (!enable_logging)
|
||||
return LOG_NONE;
|
||||
return {LOG_NONE, false};
|
||||
|
||||
bool also_log_to_stderr = false;
|
||||
#if !defined(NDEBUG)
|
||||
@@ -73,6 +103,16 @@ LoggingDestination DetermineLoggingDestination(
|
||||
also_log_to_stderr = !also_log_to_stderr_str->empty();
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
if (logging_destination == "handle" &&
|
||||
command_line.HasSwitch(::switches::kProcessType) &&
|
||||
command_line.HasSwitch(::switches::kLogFile)) {
|
||||
// Child processes can log to a handle duplicated from the parent, and
|
||||
// provided in the log-file switch value.
|
||||
return {LOG_TO_FILE, true};
|
||||
}
|
||||
#endif // BUILDFLAG(IS_WIN)
|
||||
|
||||
// --enable-logging logs to stderr, --enable-logging=file logs to a file.
|
||||
// NB. this differs from Chromium, in which --enable-logging logs to a file
|
||||
// and --enable-logging=stderr logs to stderr, because that's how Electron
|
||||
@@ -88,8 +128,8 @@ LoggingDestination DetermineLoggingDestination(
|
||||
// given.
|
||||
if (HasExplicitLogFile(command_line) ||
|
||||
(logging_destination == "file" && !is_preinit))
|
||||
return LOG_TO_FILE | (also_log_to_stderr ? LOG_TO_STDERR : 0);
|
||||
return LOG_TO_SYSTEM_DEBUG_LOG | LOG_TO_STDERR;
|
||||
return {LOG_TO_FILE | (also_log_to_stderr ? LOG_TO_STDERR : 0), false};
|
||||
return {LOG_TO_SYSTEM_DEBUG_LOG | LOG_TO_STDERR, false};
|
||||
}
|
||||
|
||||
} // namespace
|
||||
@@ -98,10 +138,13 @@ void InitElectronLogging(const base::CommandLine& command_line,
|
||||
bool is_preinit) {
|
||||
const std::string process_type =
|
||||
command_line.GetSwitchValueASCII(::switches::kProcessType);
|
||||
LoggingDestination logging_dest =
|
||||
auto [logging_dest, filename_is_handle] =
|
||||
DetermineLoggingDestination(command_line, is_preinit);
|
||||
LogLockingState log_locking_state = LOCK_LOG_FILE;
|
||||
base::FilePath log_path;
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
base::win::ScopedHandle log_handle;
|
||||
#endif
|
||||
|
||||
if (command_line.HasSwitch(::switches::kLoggingLevel) &&
|
||||
GetMinLogLevel() >= 0) {
|
||||
@@ -119,7 +162,19 @@ void InitElectronLogging(const base::CommandLine& command_line,
|
||||
// Don't resolve the log path unless we need to. Otherwise we leave an open
|
||||
// ALPC handle after sandbox lockdown on Windows.
|
||||
if ((logging_dest & LOG_TO_FILE) != 0) {
|
||||
log_path = GetLogFileName(command_line);
|
||||
if (filename_is_handle) {
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
// Child processes on Windows are provided a file handle if logging is
|
||||
// enabled as sandboxed processes cannot open files.
|
||||
log_handle = GetLogInheritedHandle(command_line);
|
||||
if (!log_handle.is_valid()) {
|
||||
LOG(ERROR) << "Unable to initialize logging from handle.";
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
log_path = GetLogFileName(command_line);
|
||||
}
|
||||
} else {
|
||||
log_locking_state = DONT_LOCK_LOG_FILE;
|
||||
}
|
||||
@@ -131,6 +186,13 @@ void InitElectronLogging(const base::CommandLine& command_line,
|
||||
LoggingSettings settings;
|
||||
settings.logging_dest = logging_dest;
|
||||
settings.log_file_path = log_path.value().c_str();
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
// Avoid initializing with INVALID_HANDLE_VALUE.
|
||||
// This handle is owned by the logging framework and is closed when the
|
||||
// process exits.
|
||||
// TODO(crbug.com/328285906) Use a ScopedHandle in logging settings.
|
||||
settings.log_file = log_handle.is_valid() ? log_handle.release() : nullptr;
|
||||
#endif
|
||||
settings.lock_log = log_locking_state;
|
||||
// If we're logging to an explicit file passed with --log-file, we don't want
|
||||
// to delete the log file on our second initialization.
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/values.h"
|
||||
#include "gin/converter.h"
|
||||
#include "gin/dictionary.h"
|
||||
#include "shell/browser/javascript_environment.h"
|
||||
#include "shell/common/gin_converters/callback_converter.h"
|
||||
#include "shell/common/node_includes.h"
|
||||
#include "third_party/electron_node/src/node_process-inl.h"
|
||||
|
||||
namespace electron::util {
|
||||
|
||||
@@ -65,14 +65,22 @@ void EmitWarning(const std::string_view warning_msg,
|
||||
void EmitWarning(v8::Isolate* isolate,
|
||||
const std::string_view warning_msg,
|
||||
const std::string_view warning_type) {
|
||||
v8::HandleScope scope{isolate};
|
||||
gin::Dictionary process{
|
||||
isolate, node::Environment::GetCurrent(isolate)->process_object()};
|
||||
base::RepeatingCallback<void(std::string_view, std::string_view,
|
||||
std::string_view)>
|
||||
emit_warning;
|
||||
process.Get("emitWarning", &emit_warning);
|
||||
emit_warning.Run(warning_msg, warning_type, "");
|
||||
node::ProcessEmitWarningGeneric(node::Environment::GetCurrent(isolate),
|
||||
warning_msg, warning_type);
|
||||
}
|
||||
|
||||
void EmitDeprecationWarning(const std::string_view warning_msg,
|
||||
const std::string_view deprecation_code) {
|
||||
EmitDeprecationWarning(JavascriptEnvironment::GetIsolate(), warning_msg,
|
||||
deprecation_code);
|
||||
}
|
||||
|
||||
void EmitDeprecationWarning(v8::Isolate* isolate,
|
||||
const std::string_view warning_msg,
|
||||
const std::string_view deprecation_code) {
|
||||
node::ProcessEmitWarningGeneric(node::Environment::GetCurrent(isolate),
|
||||
warning_msg, "DeprecationWarning",
|
||||
deprecation_code);
|
||||
}
|
||||
|
||||
node::Environment* CreateEnvironment(v8::Isolate* isolate,
|
||||
|
||||
@@ -30,9 +30,19 @@ void EmitWarning(v8::Isolate* isolate,
|
||||
std::string_view warning_type);
|
||||
|
||||
// Emit a warning via node's process.emitWarning(),
|
||||
// using JavscriptEnvironment's isolate
|
||||
// using JavascriptEnvironment's isolate
|
||||
void EmitWarning(std::string_view warning_msg, std::string_view warning_type);
|
||||
|
||||
// Emit a deprecation warning via node's process.emitWarning()
|
||||
void EmitDeprecationWarning(v8::Isolate* isolate,
|
||||
std::string_view warning_msg,
|
||||
std::string_view deprecation_code = "");
|
||||
|
||||
// Emit a deprecation warning via node's process.emitWarning(),
|
||||
// using JavascriptEnvironment's isolate
|
||||
void EmitDeprecationWarning(std::string_view warning_msg,
|
||||
std::string_view deprecation_code = "");
|
||||
|
||||
// Run a script with JS source bundled inside the binary as if it's wrapped
|
||||
// in a function called with a null receiver and arguments specified in C++.
|
||||
// The returned value is empty if an exception is encountered.
|
||||
|
||||
3
spec/fixtures/log-test.js
vendored
Normal file
3
spec/fixtures/log-test.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
const binding = process._linkedBinding('electron_common_testing');
|
||||
binding.log(1, 'CHILD_PROCESS_TEST_LOG');
|
||||
binding.log(1, `CHILD_PROCESS_DESTINATION_${binding.getLoggingDestination()}`);
|
||||
@@ -7,7 +7,7 @@ import { once } from 'node:events';
|
||||
import * as fs from 'node:fs/promises';
|
||||
import * as path from 'node:path';
|
||||
|
||||
import { startRemoteControlApp, ifdescribe } from './lib/spec-helpers';
|
||||
import { startRemoteControlApp, ifdescribe, ifit } from './lib/spec-helpers';
|
||||
|
||||
function isTestingBindingAvailable () {
|
||||
try {
|
||||
@@ -127,6 +127,34 @@ ifdescribe(isTestingBindingAvailable())('logging', () => {
|
||||
expect(contents).to.match(/TEST_LOG/);
|
||||
});
|
||||
|
||||
ifit(process.platform === 'win32')('child process logs to the given file when --log-file is passed', async () => {
|
||||
const logFilePath = path.join(app.getPath('temp'), 'test-log-file-' + uuid.v4());
|
||||
const preloadPath = path.resolve(__dirname, 'fixtures', 'log-test.js');
|
||||
const rc = await startRemoteControlApp(['--enable-logging', `--log-file=${logFilePath}`, `--boot-eval=preloadPath=${JSON.stringify(preloadPath)}`]);
|
||||
rc.remotely(() => {
|
||||
process._linkedBinding('electron_common_testing').log(0, 'MAIN_PROCESS_TEST_LOG');
|
||||
const { app, BrowserWindow } = require('electron');
|
||||
const w = new BrowserWindow({
|
||||
show: false,
|
||||
webPreferences: {
|
||||
preload: preloadPath,
|
||||
additionalArguments: ['--unsafely-expose-electron-internals-for-testing']
|
||||
}
|
||||
});
|
||||
w.loadURL('about:blank');
|
||||
w.webContents.once('did-finish-load', () => {
|
||||
setTimeout(() => { app.quit(); });
|
||||
});
|
||||
});
|
||||
await once(rc.process, 'exit');
|
||||
const stat = await fs.stat(logFilePath);
|
||||
expect(stat.isFile()).to.be.true();
|
||||
const contents = await fs.readFile(logFilePath, 'utf8');
|
||||
expect(contents).to.match(/MAIN_PROCESS_TEST_LOG/);
|
||||
expect(contents).to.match(/CHILD_PROCESS_TEST_LOG/);
|
||||
expect(contents).to.match(/CHILD_PROCESS_DESTINATION_handle/);
|
||||
});
|
||||
|
||||
it('logs to the given file when ELECTRON_LOG_FILE is set', async () => {
|
||||
const logFilePath = path.join(app.getPath('temp'), 'test-log-file-' + uuid.v4());
|
||||
const rc = await startRemoteControlApp([], { env: { ...process.env, ELECTRON_ENABLE_LOGGING: '1', ELECTRON_LOG_FILE: logFilePath } });
|
||||
|
||||
Reference in New Issue
Block a user