* test: do not skip visibleOnAllWorkspaces tests on Windows
That feature is supported on Linux, so move the test from the
"window states (excluding Linux)" section into the
"window states" section.
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* chore: disable visibleOnAllWorkspaces test on Linux
* fix: NativeWindowViews::IsVisibleOnAllWorkspaces
* test: enable visibleOnAllWorkspaces tests on Linux
---------
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
fix: bluetooth crash on bluetooth off
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
WebView uses WebContentsViewChildFrame, which doesn't have a Focus impl
and triggers a fatal NOTREACHED.
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Jinli Wu <wujinli@bytedance.com>
* refactor: add electron::Buffer namespace; move the Buffer as_byte_span() into it
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* feat: add electron::Buffer::Copy()
a span-friendly version of node::Buffer::Copy()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: use electron::Buffer::Copy() in electron_api_base_window.cc
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: use electron::Buffer::Copy() in electron_api_data_pipe_holder.cc
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: use electron::Buffer::Copy() in electron_api_safe_storage.cc
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: use electron::Buffer::Copy() in electron_api_clipboard.cc
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: use electron::Buffer::Copy() in osr_converter.cc
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: use electron::Buffer::Copy() in electron_api_native_image.cc
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: use electron::Buffer::Copy() in net_converter.cc
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: use electron::Buffer::Copy() in electron_api_web_contents.cc
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: make NewEmptyBuffer() return a Local<Value>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
---------
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* fix: explicitly call GetNativeNSView() on macOS
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* chore: move macOS impl to a .mm file
This is needed in order to access gfx::NativeView::GetNativeNSView()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
---------
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
fix: fix file dialog filters not working correctly
If someone sets an `All filter` with `*` at the start of the filters all upcoming filters will be shifted and thus labels won't fit to the extensions they actually filter.
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Kolja Lampe <razzeee@gmail.com>
refactor: remove electron::WebContentsPermissionHelper::PermissionTypes::KEYBOARD_LOCK
This was added in 344aba0. In the time when this PR initially went up and
when 344aba0 landed, upstream added blink::PermissionTypes::KEYBOARD_LOCK.
Our duplicate copy can be removed.
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
feat: expose shouldUseDarkColorsForSystemIntegratedUI
Closes https://github.com/electron/electron/issues/46429.
Refs https://github.com/electron/electron/pull/19735.
This PR adds a new API `shouldUseDarkColorsForSystemIntegratedUI` to the
`nativeTheme` module. This API returns a boolean indicating whether the
system is using dark colors for system integrated UI elements. This is
useful for applications that want to adapt their UI to match the system
theme, especially for those that use system integrated UI elements like
the shell theme or taskbar appearance.
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
fix: NativeWindow.window_id() returns same value for all windows
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
refactor: remove unnecessary const_cast
unnecessary since July 2019 in 50b9c70
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: return a std::array<int 2> from BaseWindow::GetMaximumSize()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: return a std::array<int 2> from BaseWindow::GetMinimumSize()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: return a std::array<int 2> from BaseWindow::GetPosition()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: return a std::array<int 2> from BaseWindow::GetSize()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: return a std::array<int 2> from BaseWindow::GetContentSize()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: extract helper method ToArray(const gfx::Size)
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: #include correctness
Co-authored-by: Charles Kerr <charles@charleskerr.com>
---------
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: make api::View::GetBounds() const
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: make api::View::OnViewBoundsChanged() private
refactor: make api::View::OnViewIsDeleting() private
refactor: make api::View::OnChildViewRemoved() private
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: make ChildPair private
Co-authored-by: Charles Kerr <charles@charleskerr.com>
---------
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: use AddChildView(std::unique_ptr<View>) in OpaqueFrameView::CreateButton()
Xref: https://issues.chromium.org/issues/40485510
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: use AddChildView(std::unique_ptr<View>) in MenuBar::RebuildChildren()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: use AddChildView(std::unique_ptr<View>) for ClientFrameViewLinux labels
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: use AddChildView(std::unique_ptr<View>) for ClientFrameViewLinux buttons
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: use AddChildView(std::unique_ptr<View>) in AutofillPopupView
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: use AddChildViewRaw() to flag the edge cases that we still need to fix
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* chore: use west coast const for consistency
Co-authored-by: Charles Kerr <charles@charleskerr.com>
---------
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* chore: bump chromium in DEPS to 136.0.7081.1
* chore: bump chromium in DEPS to 136.0.7083.1
* chore: bump chromium in DEPS to 136.0.7085.1
* chore: bump chromium in DEPS to 136.0.7087.1
* chore: bump chromium in DEPS to 136.0.7089.0
* chore: bump chromium in DEPS to 136.0.7091.0
* chore: bump chromium in DEPS to 136.0.7092.0
* chore: bump chromium in DEPS to 136.0.7093.1
* chore: bump chromium in DEPS to 136.0.7095.1
* chore: bump chromium in DEPS to 136.0.7097.1
* chore: bump chromium in DEPS to 136.0.7099.1
* chore: bump chromium in DEPS to 136.0.7101.0
* chore: bump chromium in DEPS to 136.0.7103.0
* chore: bump chromium in DEPS to 136.0.7103.15
* chore: bump chromium in DEPS to 136.0.7103.17
* chore: bump chromium to 136.0.7095.0 (main) (#46118)
* chore: bump chromium in DEPS to 136.0.7076.0
* chore: bump chromium in DEPS to 136.0.7077.0
* 6368856: Migrate absl variant.h and utility.h in content (part 2/2) | 6368856
* 6356528: Clean up LegacyRenderWidgetHostHWND code | 6356528
* chore: export patches
* 6339113: [Viewport Segments] Add CDP commands to override Viewport Segments without overriding other device properties. | 6339113
* 6352169: [DevTools][MultiInstance] Support new tab in another window on Android | 6352169
* 6368856: Migrate absl variant.h and utility.h in content (part 2/2) | 6368856
* 6360858:Clickiness: Wire response from URLLoader to DB, add e2e tests| 6360858
* chore: bump chromium in DEPS to 136.0.7079.0
* chore: export patches
* chore: bump chromium in DEPS to 136.0.7081.0
* chore: export patches
* chore: bump chromium in DEPS to 136.0.7083.0
* 6361987: Remove double-declaration with gfx::NativeView and gfx::NativeWindow | 6361987
* chore: export patches
* chore: bump chromium in DEPS to 136.0.7087.0
* chore: export patches
* fix: include node patch for missing AtomicsWaitEvent
6385540
* build: add depot_tools python to path
* fix: cppgc init and unregistering v8 isolate
6333562
CppGc is now initialized earlier so Node can skip reinitializing it.
Additionally, gin::IsolateHandle was attempting to destruct an already destructed
v8::Isolate upon electron::JavaScriptEnvironment destruction. By removing the call
to NodePlatform::UnregisterIsolate, this fixes the crash on app shutdown.
* fix: unregister isolate after destruction
See code comment.
* chore: bump chromium in DEPS to 136.0.7095.0
* chore: sync patches
* fix: add script_parsing::ContentScriptType parameter
6298395
* fix: migrate content::BrowserAccessibilityState methods
64014376383275
* feat: enableHappyEyeballs option for host resolver
6332599
* fix: add new cookie exclusion reason
6343479
* fix: add new url loader method
6337340
* fix: add new cppgc header file for electron_node headers
6348644
* fix: disable CREL on Linux ARM64
https://chromium-review.googlesource.com/q/I3a62f02f564f07be63173b0773b4ecaffbe939b9
* fixup! fix: add new cppgc header file for electron_node headers 6348644
* chore: update corner smoothing patch
* fixup! chore: update corner smoothing patch
* chore: disable NAN weak tests
These two tests are incompatible with a V8 change that disallows running JS code from a weak finalizer callback.
Ref: 4733273
* test: fix task starvation in node test
A V8 change makes these contexts get collected in a task that is posted
and run asynchronously. The tests were synchronously GC'ing in an
infinite loop, preventing the task loop from running the task that would
GC these contexts.
This change should be upstreamed in some way.
Ref: 4733273
---------
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: alice <alice@makenotion.com>
Co-authored-by: Samuel Maddock <smaddock@slack-corp.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: clavin <clavin@electronjs.org>
(cherry picked from commit 9c019b6147)
* Remove file-wide unsafe buffer suppression from content/ [3 of N]
6341711
---------
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
perf: avoid redundant virtual method call in NativeWindowViews::SetEnabledInternal()
Why waste time make lot call when few call do trick?
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: instantiate navigation_entries on the stack instead of the heap
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: reserve the full size of navigation_entries
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: use emplace_back to simplify the code a little
Co-authored-by: Charles Kerr <charles@charleskerr.com>
---------
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
refactor: remove electron::api::App::FileIconCallback
last use removed in 2018 by 3f15f516
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* perf: use an absl::flat_hash_set for UsbChooserContext::ephemeral_devices_
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* perf: use an absl::flat_hash_set for GlobalMenuBarRegistrarX11::live_windows_
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* perf: use an absl::flat_hash_set for NativeWindowViews::forwarding_windows_
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* perf: use an absl::flat_hash_set for OffScreenRenderWidgetHostView::guest_host_views_
perf: use an absl::flat_hash_set for OffScreenRenderWidgetHostView::proxy_views_
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* perf: use an absl::flat_hash_set for NativeWindow::injected_frames_
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* perf: use an absl::flat_hash_set for NativeWindow::background_throttling_sources_
Co-authored-by: Charles Kerr <charles@charleskerr.com>
---------
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* fix: gin_helper::Promise in GPUInfoManager must be destroyed before destroying Node/V8
Co-authored-by: Yang Liu <ouyangliu.leo@gmail.com>
* fix: use CleanedUpAtExit to control the lifetime of GPUInfoManager
Co-authored-by: Yang Liu <ouyangliu.leo@gmail.com>
---------
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Yang Liu <ouyangliu.leo@gmail.com>
feat: support system-context-menu on Linux
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
* perf: cache the return value of IsX11()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* fix: mark as nodiscard for those who call, but mark as maybe_unused for Windows
Co-authored-by: Charles Kerr <charles@charleskerr.com>
---------
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* perf: avoid redundant call to popup_bounds_in_view()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: use a std::optional<> for paint_canvas local
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* fix: fix leaked gfx::Canvas in AutofillPopupView::OnPaint()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: remove redundant get() call when testing smart pointer for nonempty
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: remove unnecessary draw_canvas variable
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: rename bitmap to offscreen_bitmap for symmetry
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: avoid another redundant call to popup_bounds_in_view()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
---------
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
fix: Explicitly set rounded corners in borderless mode on Windows 11
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: zoy <zoy-l@outlook.com>
* perf: avoid making an unnecessary copy of the vector
MimeTypesHandler::GetMIMETypeAllowlist() returns a const&, so we can
iterate that directly instead of making a temporary copy of it.
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* perf: move the call to ExtensionRegistry::Get() outside of the loop
Also, keep the previous behavior of not calling it at all if there
aren't any whitelisted extensions.
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* perf: avoid redundant map lookup
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: const correctness
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: cleanup
Co-authored-by: Charles Kerr <charles@charleskerr.com>
---------
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>