chore: remove deps_add_v8_object_setinternalfieldfornodecore.patch
This was a Node 20-specific workaround that's no longer needed in Node 22.
Xref: https://github.com/nodejs/node/pull/49874.
* Remove microtasks_scope.h and microtasks_scope.cc
* Use v8::MicrotasksScope when ignoring browser checkpoint
These call always skip the browser checkpoint, so they are equivalent to using v8::MicrotasksScope directly (modulo the optional wrapper behavior).
* Remove MicrotasksScope from node_bindings.cc
This code seems contradictory: it explicitly specifies "do not run microtasks" yet runs a microtask checkpoint in the browser process.
Looking at its history, it [was introduced][1] with the intention to not run microtasks, but a [subtle C++ language behavior][2] caused it to do the opposite later in the same roll. Since the original intention was to not run microtasks, and since that is also the simplest explanation, we can assume `ignore_browser_checkpoint` should be true and migrate this to `v8::MicrotasksScope` as it is equivalent (modulo the optional wrapper behavior).
[1]: a4ea80dd47 (diff-efe58cf03c97028f37f801db044d396a5f428686da6595d2c692f1c052bbd09c)
[2]: https://github.com/electron/electron/pull/43185
* Migrate gin_helper/promise.h and gin_helper/promise.cc to v8::MicrotasksScope
Restores the [original][1] behavior of running the microtask checkpoint at destruction, but preserves the behavior of running microtasks in the browser process. This had last changed in the migration to gin_helper::MicroTasks.
[1]: https://github.com/electron/electron/pull/16401
* chore: bump chromium in DEPS to 138.0.7165.0
* 6492127: Add new less invasive context menu mode for mobile interesttarget
6492127
* chore: fixup patch indices
---------
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
* feat: add gin_helper::Dictionary::ValueOrDefault()
A convenience function for using a default value if the
specified key isn't present in the dictionary.
* refactor: use ValueOrDefault() in native_window.cc
* refactor: use ValueOrDefault() in native_window_mac.mm
* refactor: use ValueOrDefault() in native_window_views.cc
* refactor: use ValueOrDefault() in electron_api_native_image.cc
* test: test menu rendering accelerators
* Update spec/api-menu-spec.ts
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
---------
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
* refactor: make NativeWindow::titlebar_overlay_height_ private
* refactor: make NativeWindow::set_has_frame() protected
* refactor: remove NativeWindow::background_material()
It's only used once, in NativeWindow, so use |background_material_| directly.
* refactor: remove NativeWindow::vibrancy()
It's only used once, in a NativeWindow method, so use |vibrancy_| directly.
* refactor: unfriend api::BrowserView
It was added in Oct 2022 by 23d4a25 for access to protected NativeWindow
methods add_inspectable_view() and remove_inspectable_view().
That dependency was removed in Nov 2022 by 184ac2b, so BrowserView
doesn't need access to NativeWindow's private fields & methods anymore.
* refactor: make NativeWindow::ContentBoundsToWindowBounds() protected
refactor: make NativeWindow::WindowBoundsToContentBounds() protected
* chore: use dbus thread for portal version detection
* Update shell/browser/ui/file_dialog_linux_portal.cc
Co-authored-by: Robo <hop2deep@gmail.com>
---------
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* fix: prevent log files being written to current directory on Windows
* Update shell/common/logging.cc
Co-authored-by: Robo <hop2deep@gmail.com>
* chore: add test
* chore: update includes
Refs 6418805
* chore: address review feedback
---------
Co-authored-by: Robo <hop2deep@gmail.com>
* refactor: use ObserverList::Notify() in shell/browser/window_list.cc
* refactor: use ObserverList::Notify() in shell/browser/web_contents_zoom_controller.cc
* refactor: use ObserverList::Notify() in shell/browser/usb/usb_chooser_context.cc
* refactor: use ObserverList::Notify() in shell/browser/usb/electron_usb_delegate.cc
* refactor: use ObserverList::Notify() in shell/browser/ui/views/menu_delegate.cc
* refactor: use ObserverList::Notify() in shell/browser/ui/tray_icon.cc
* refactor: use ObserverList::Notify() in shell/browser/ui/electron_menu_model.cc
* refactor: use ObserverList::Notify() in shell/browser/serial/serial_chooser_context.cc
* refactor: use ObserverList::Notify() in shell/browser/native_window.cc
* refactor: use ObserverList::Notify() in shell/browser/serial/electron_serial_delegate.cc
* refactor: use ObserverList::Notify() in shell/browser/browser.cc
* refactor: use ObserverList::Notify() in shell/browser/api/electron_api_web_contents.cc
* refactor: use ObserverList::Notify() in shell/browser/hid/electron_hid_delegate.cc
* refactor: use ObserverList::Notify() in shell/browser/hid/hid_chooser_context.cc
* refactor: don't call RegisterDeleteDelegateCallback()
move NativeWindowViews' on-widget-delegate-destroyed callback logic to
the NativeWindowViews destructor.
Since NativeWindowViews subclasses from WidgetDelegate and |this| *is*
the delegate being destroyed, we can handle this more cleanly in
~NativeWindowViews() instead of in a separate callback.
* chore: remove NativeWindowViews from the grandfathered-classes-that-can-call-deprecated-views-behavior patch
* refactor: don't call RegisterDeleteDelegateCallback()
RegisterDeleteDelegateCallback() is private upstream API, so we
shouldn't be using it.
Move the on-widget-delegate-destroyed callback logic over to our methods
NativeWindowViews::OnWidgetDestroying() and
NativeWindowViews::OnWidgetDestroyed().
* refactor: add EmitDeprecationWarning helper
Also switches EmitWarning to using Node's ProcessEmitWarningGeneric
* chore: use node namespace for function call
* refactor: use WidgetDelegate::SetTitle()
* Make NativeWindow::SetTitle() and NativeWindow::GetTitle() non-virtual.
Use WidgetDelegate for their implementation.
* Add NativeWindow::OnTitleChanged(), a new protected virtual method to update
subclasses (e.g. NativeWindowMac needs to redraw the button proxy).
* In NativeWindowMac, replace SetTitle() and GetTitle() with OnTitleChanged().
* In NativeWindowViews, replace SetTitle() and GetTitle() with OnTitleChanged().
* test: enable BrowserWindow.title tests on Linux
* test: add a test to confirm win.title changes when document.title is set in the renderer
* 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.
* fix: nested it() calls in visibleOnAllWorkspaces specs
* test: enable accessibilitySupportEnabled tests
test: check both getters after calling each setter
fix: do not assume the default initial value of accessibilitySupportEnabled
* chore: remove redundant test case
* chore: disable accessibilitySupportEnabled tests on Linux
* test: add platform test on visibleOnAllWorkspaces tests
visibleOnAllWorkspaces is not supported on Windows
* 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.
* fix: nested it() calls in visibleOnAllWorkspaces specs
* chore: make the process.platform test simpler
* fix: tests that were not run in api-app-spec due to nested it()
* fix: tests that were not run in api-browser-window-spec due to nested it()
* chore: annotate disabled test
* fix: enable `autoHideMenuBar` tests on Linux and Windows (#46818)
* fix: enable autoHideMenuBar tests
* docs: mark autoHideMenuBar as supported on Linux, Windows
* test: add platform test on visibleOnAllWorkspaces tests
visibleOnAllWorkspaces is not supported on Windows
* 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.
* fix: nested it() calls in visibleOnAllWorkspaces specs
* chore: make the process.platform test simpler