electron/shell/browser/mac/electron_application.mm

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

258 lines
8 KiB
Text
Raw Normal View History

// Copyright (c) 2013 GitHub, Inc.
2014-04-25 17:49:37 +08:00
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#import "shell/browser/mac/electron_application.h"
#include <string>
#include <utility>
#include "base/auto_reset.h"
#include "base/observer_list.h"
#include "base/strings/sys_string_conversions.h"
#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 "shell/browser/browser.h"
#include "shell/browser/mac/dict_util.h"
#import "shell/browser/mac/electron_application_delegate.h"
2017-09-14 16:12:34 +09:00
namespace {
inline void dispatch_sync_main(dispatch_block_t block) {
if ([NSThread isMainThread])
block();
else
dispatch_sync(dispatch_get_main_queue(), block);
}
2017-09-14 16:12:34 +09:00
} // namespace
@interface AtomApplication () <NativeEventProcessor> {
base::ObserverList<content::NativeEventProcessorObserver>::Unchecked
observers_;
}
@end
@implementation AtomApplication
+ (AtomApplication*)sharedApplication {
return (AtomApplication*)[super sharedApplication];
}
- (void)willPowerOff:(NSNotification*)notify {
userStoppedShutdown_ = shouldShutdown_ && !shouldShutdown_.Run();
}
2018-01-11 14:50:35 -08:00
- (void)terminate:(id)sender {
// User will call Quit later.
if (userStoppedShutdown_)
return;
// We simply try to close the browser, which in turn will try to close the
// windows. Termination can proceed if all windows are closed or window close
// can be cancelled which will abort termination.
electron::Browser::Get()->Quit();
2018-01-11 14:50:35 -08:00
}
- (void)setShutdownHandler:(base::RepeatingCallback<bool()>)handler {
2018-02-05 16:13:35 +09:00
shouldShutdown_ = std::move(handler);
}
- (BOOL)isHandlingSendEvent {
return handlingSendEvent_;
}
- (void)sendEvent:(NSEvent*)event {
base::AutoReset<BOOL> scoper(&handlingSendEvent_, YES);
content::ScopedNotifyNativeEventProcessorObserver scopedObserverNotifier(
&observers_, event);
[super sendEvent:event];
}
- (void)setHandlingSendEvent:(BOOL)handlingSendEvent {
handlingSendEvent_ = handlingSendEvent;
}
- (void)setCurrentActivity:(NSString*)type
2016-05-23 11:49:46 -04:00
withUserInfo:(NSDictionary*)userInfo
withWebpageURL:(NSURL*)webpageURL {
chore: bump chromium to 117.0.5892.0 (main) (#39118) * chore: bump chromium in DEPS to 117.0.5892.0 * 4670267: Don't send javascript: or empty URLs to browser in CreateNewWindow. https://chromium-review.googlesource.com/c/chromium/src/+/4670267 * 4662090: Add metrics for WebGPU support https://chromium-review.googlesource.com/c/chromium/src/+/4662090 * 4672599: Use set_defaults for mac_app_bundle https://chromium-review.googlesource.com/c/chromium/src/+/4672599 * 4663771: usb: Add connection count tracking methods for UsbDelegate https://chromium-review.googlesource.com/c/chromium/src/+/4663771 * 4664578: Remove unused parameter from ExtensionsGuestViewManagerDelegate ctor https://chromium-review.googlesource.com/c/chromium/src/+/4664578 * 4622253: usb: Create classes for usb system tray icon https://chromium-review.googlesource.com/c/chromium/src/+/4622253 * 4678263: Remove ARC support from scoped_nsobject https://chromium-review.googlesource.com/c/chromium/src/+/4678263 * chore: follow-up ARC changes and missing guard corrections * chore: don't mark 0-param ctor explicit Follow up to https://chromium-review.googlesource.com/c/chromium/src/+/4664578 * chore: fixup patch indices * 4670865: Merge ObjectProxy::CallMethodAndBlock{,WithErrorDetails}. https://chromium-review.googlesource.com/c/chromium/src/+/4670865 * chore: follow-up ARC changes and missing guard corrections * fixup: retain ElectronApplicationDelegate * fix: correct rustc binary --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-07-19 00:26:27 +02:00
currentActivity_ = [[NSUserActivity alloc] initWithActivityType:type];
[currentActivity_ setUserInfo:userInfo];
[currentActivity_ setWebpageURL:webpageURL];
[currentActivity_ setDelegate:self];
[currentActivity_ becomeCurrent];
[currentActivity_ setNeedsSave:YES];
}
- (NSUserActivity*)getCurrentActivity {
chore: bump chromium to 117.0.5892.0 (main) (#39118) * chore: bump chromium in DEPS to 117.0.5892.0 * 4670267: Don't send javascript: or empty URLs to browser in CreateNewWindow. https://chromium-review.googlesource.com/c/chromium/src/+/4670267 * 4662090: Add metrics for WebGPU support https://chromium-review.googlesource.com/c/chromium/src/+/4662090 * 4672599: Use set_defaults for mac_app_bundle https://chromium-review.googlesource.com/c/chromium/src/+/4672599 * 4663771: usb: Add connection count tracking methods for UsbDelegate https://chromium-review.googlesource.com/c/chromium/src/+/4663771 * 4664578: Remove unused parameter from ExtensionsGuestViewManagerDelegate ctor https://chromium-review.googlesource.com/c/chromium/src/+/4664578 * 4622253: usb: Create classes for usb system tray icon https://chromium-review.googlesource.com/c/chromium/src/+/4622253 * 4678263: Remove ARC support from scoped_nsobject https://chromium-review.googlesource.com/c/chromium/src/+/4678263 * chore: follow-up ARC changes and missing guard corrections * chore: don't mark 0-param ctor explicit Follow up to https://chromium-review.googlesource.com/c/chromium/src/+/4664578 * chore: fixup patch indices * 4670865: Merge ObjectProxy::CallMethodAndBlock{,WithErrorDetails}. https://chromium-review.googlesource.com/c/chromium/src/+/4670865 * chore: follow-up ARC changes and missing guard corrections * fixup: retain ElectronApplicationDelegate * fix: correct rustc binary --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-07-19 00:26:27 +02:00
return currentActivity_;
}
- (void)invalidateCurrentActivity {
2017-09-14 16:12:34 +09:00
if (currentActivity_) {
[currentActivity_ invalidate];
chore: bump chromium to 117.0.5892.0 (main) (#39118) * chore: bump chromium in DEPS to 117.0.5892.0 * 4670267: Don't send javascript: or empty URLs to browser in CreateNewWindow. https://chromium-review.googlesource.com/c/chromium/src/+/4670267 * 4662090: Add metrics for WebGPU support https://chromium-review.googlesource.com/c/chromium/src/+/4662090 * 4672599: Use set_defaults for mac_app_bundle https://chromium-review.googlesource.com/c/chromium/src/+/4672599 * 4663771: usb: Add connection count tracking methods for UsbDelegate https://chromium-review.googlesource.com/c/chromium/src/+/4663771 * 4664578: Remove unused parameter from ExtensionsGuestViewManagerDelegate ctor https://chromium-review.googlesource.com/c/chromium/src/+/4664578 * 4622253: usb: Create classes for usb system tray icon https://chromium-review.googlesource.com/c/chromium/src/+/4622253 * 4678263: Remove ARC support from scoped_nsobject https://chromium-review.googlesource.com/c/chromium/src/+/4678263 * chore: follow-up ARC changes and missing guard corrections * chore: don't mark 0-param ctor explicit Follow up to https://chromium-review.googlesource.com/c/chromium/src/+/4664578 * chore: fixup patch indices * 4670865: Merge ObjectProxy::CallMethodAndBlock{,WithErrorDetails}. https://chromium-review.googlesource.com/c/chromium/src/+/4670865 * chore: follow-up ARC changes and missing guard corrections * fixup: retain ElectronApplicationDelegate * fix: correct rustc binary --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-07-19 00:26:27 +02:00
currentActivity_ = nil;
}
}
- (void)resignCurrentActivity {
if (currentActivity_)
[currentActivity_ resignCurrent];
}
2017-09-14 16:12:34 +09:00
- (void)updateCurrentActivity:(NSString*)type
withUserInfo:(NSDictionary*)userInfo {
2017-09-14 16:12:34 +09:00
if (currentActivity_) {
[currentActivity_ addUserInfoEntriesFromDictionary:userInfo];
}
[handoffLock_ lock];
updateReceived_ = YES;
[handoffLock_ signal];
[handoffLock_ unlock];
}
- (void)userActivityWillSave:(NSUserActivity*)userActivity {
__block BOOL shouldWait = NO;
dispatch_sync_main(^{
2018-04-20 14:47:04 -04:00
std::string activity_type(
base::SysNSStringToUTF8(userActivity.activityType));
base::Value::Dict user_info =
electron::NSDictionaryToValue(userActivity.userInfo);
electron::Browser* browser = electron::Browser::Get();
2018-04-20 14:47:04 -04:00
shouldWait =
browser->UpdateUserActivityState(activity_type, std::move(user_info))
? YES
: NO;
});
if (shouldWait) {
[handoffLock_ lock];
updateReceived_ = NO;
while (!updateReceived_) {
2018-04-20 14:47:04 -04:00
BOOL isSignaled =
[handoffLock_ waitUntilDate:[NSDate dateWithTimeIntervalSinceNow:1]];
if (!isSignaled)
break;
}
[handoffLock_ unlock];
}
[userActivity setNeedsSave:YES];
}
- (void)userActivityWasContinued:(NSUserActivity*)userActivity {
dispatch_async(dispatch_get_main_queue(), ^{
2018-04-20 14:47:04 -04:00
std::string activity_type(
base::SysNSStringToUTF8(userActivity.activityType));
base::Value::Dict user_info =
electron::NSDictionaryToValue(userActivity.userInfo);
electron::Browser* browser = electron::Browser::Get();
browser->UserActivityWasContinued(activity_type, std::move(user_info));
});
[userActivity setNeedsSave:YES];
}
- (void)registerURLHandler {
[[NSAppleEventManager sharedAppleEventManager]
setEventHandler:self
andSelector:@selector(handleURLEvent:withReplyEvent:)
forEventClass:kInternetEventClass
andEventID:kAEGetURL];
handoffLock_ = [NSCondition new];
}
- (void)handleURLEvent:(NSAppleEventDescriptor*)event
withReplyEvent:(NSAppleEventDescriptor*)replyEvent {
2018-04-20 14:47:04 -04:00
NSString* url =
[[event paramDescriptorForKeyword:keyDirectObject] stringValue];
electron::Browser::Get()->OpenURL(base::SysNSStringToUTF8(url));
}
// Returns the list of accessibility attributes that this object supports.
- (NSArray*)accessibilityAttributeNames {
NSMutableArray* attributes =
[[super accessibilityAttributeNames] mutableCopy];
[attributes addObject:@"AXManualAccessibility"];
return attributes;
}
// Returns whether or not the specified attribute can be set by the
// accessibility API via |accessibilitySetValue:forAttribute:|.
- (BOOL)accessibilityIsAttributeSettable:(NSString*)attribute {
bool is_manual_ax = [attribute isEqualToString:@"AXManualAccessibility"];
return is_manual_ax || [super accessibilityIsAttributeSettable:attribute];
}
// Returns the accessibility value for the given attribute. If the value isn't
// supported this will return nil.
- (id)accessibilityAttributeValue:(NSString*)attribute {
if ([attribute isEqualToString:@"AXManualAccessibility"]) {
auto* ax_state = content::BrowserAccessibilityState::GetInstance();
chore: bump chromium to 136.0.7095.0 (36-x-y) (#46184) * 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) | https://chromium-review.googlesource.com/c/chromium/src/+/6368856 * 6356528: Clean up LegacyRenderWidgetHostHWND code | https://chromium-review.googlesource.com/c/chromium/src/+/6356528 * chore: export patches * 6339113: [Viewport Segments] Add CDP commands to override Viewport Segments without overriding other device properties. | https://chromium-review.googlesource.com/c/chromium/src/+/6339113 * 6352169: [DevTools][MultiInstance] Support new tab in another window on Android | https://chromium-review.googlesource.com/c/chromium/src/+/6352169 * 6368856: Migrate absl variant.h and utility.h in content (part 2/2) | https://chromium-review.googlesource.com/c/chromium/src/+/6368856 * 6360858:Clickiness: Wire response from URLLoader to DB, add e2e tests| https://chromium-review.googlesource.com/c/chromium/src/+/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 | https://chromium-review.googlesource.com/c/chromium/src/+/6361987 * chore: export patches * chore: bump chromium in DEPS to 136.0.7087.0 * chore: export patches * fix: include node patch for missing AtomicsWaitEvent https://chromium-review.googlesource.com/c/chromium/src/+/6385540 * build: add depot_tools python to path * fix: cppgc init and unregistering v8 isolate https://chromium-review.googlesource.com/c/v8/v8/+/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 https://chromium-review.googlesource.com/c/chromium/src/+/6298395 * fix: migrate content::BrowserAccessibilityState methods https://chromium-review.googlesource.com/c/chromium/src/+/6401437 https://chromium-review.googlesource.com/c/chromium/src/+/6383275 * feat: enableHappyEyeballs option for host resolver https://chromium-review.googlesource.com/c/chromium/src/+/6332599 * fix: add new cookie exclusion reason https://chromium-review.googlesource.com/c/chromium/src/+/6343479 * fix: add new url loader method https://chromium-review.googlesource.com/c/chromium/src/+/6337340 * fix: add new cppgc header file for electron_node headers https://chromium-review.googlesource.com/c/v8/v8/+/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 https://chromium-review.googlesource.com/c/v8/v8/+/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: https://chromium-review.googlesource.com/c/v8/v8/+/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: https://chromium-review.googlesource.com/c/v8/v8/+/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 9c019b6147e88dc14959cdb8e555de0fe52f51a4) * Remove file-wide unsafe buffer suppression from content/ [3 of N] https://chromium-review.googlesource.com/c/chromium/src/+/6341711 --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2025-04-07 13:09:35 -05:00
bool is_accessible_browser =
ax_state->GetAccessibilityMode() == ui::kAXModeComplete;
return [NSNumber numberWithBool:is_accessible_browser];
}
return [super accessibilityAttributeValue:attribute];
}
// Sets the value for an accessibility attribute via the accessibility API.
// AXEnhancedUserInterface is an undocumented attribute that screen reader
// related functionality sets when running, and AXManualAccessibility is an
// attribute Electron specifically allows third-party apps to use to enable
// a11y features in Electron.
2018-04-20 14:47:04 -04:00
- (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();
if ([value boolValue]) {
chore: bump chromium to 136.0.7095.0 (36-x-y) (#46184) * 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) | https://chromium-review.googlesource.com/c/chromium/src/+/6368856 * 6356528: Clean up LegacyRenderWidgetHostHWND code | https://chromium-review.googlesource.com/c/chromium/src/+/6356528 * chore: export patches * 6339113: [Viewport Segments] Add CDP commands to override Viewport Segments without overriding other device properties. | https://chromium-review.googlesource.com/c/chromium/src/+/6339113 * 6352169: [DevTools][MultiInstance] Support new tab in another window on Android | https://chromium-review.googlesource.com/c/chromium/src/+/6352169 * 6368856: Migrate absl variant.h and utility.h in content (part 2/2) | https://chromium-review.googlesource.com/c/chromium/src/+/6368856 * 6360858:Clickiness: Wire response from URLLoader to DB, add e2e tests| https://chromium-review.googlesource.com/c/chromium/src/+/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 | https://chromium-review.googlesource.com/c/chromium/src/+/6361987 * chore: export patches * chore: bump chromium in DEPS to 136.0.7087.0 * chore: export patches * fix: include node patch for missing AtomicsWaitEvent https://chromium-review.googlesource.com/c/chromium/src/+/6385540 * build: add depot_tools python to path * fix: cppgc init and unregistering v8 isolate https://chromium-review.googlesource.com/c/v8/v8/+/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 https://chromium-review.googlesource.com/c/chromium/src/+/6298395 * fix: migrate content::BrowserAccessibilityState methods https://chromium-review.googlesource.com/c/chromium/src/+/6401437 https://chromium-review.googlesource.com/c/chromium/src/+/6383275 * feat: enableHappyEyeballs option for host resolver https://chromium-review.googlesource.com/c/chromium/src/+/6332599 * fix: add new cookie exclusion reason https://chromium-review.googlesource.com/c/chromium/src/+/6343479 * fix: add new url loader method https://chromium-review.googlesource.com/c/chromium/src/+/6337340 * fix: add new cppgc header file for electron_node headers https://chromium-review.googlesource.com/c/v8/v8/+/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 https://chromium-review.googlesource.com/c/v8/v8/+/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: https://chromium-review.googlesource.com/c/v8/v8/+/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: https://chromium-review.googlesource.com/c/v8/v8/+/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 9c019b6147e88dc14959cdb8e555de0fe52f51a4) * Remove file-wide unsafe buffer suppression from content/ [3 of N] https://chromium-review.googlesource.com/c/chromium/src/+/6341711 --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2025-04-07 13:09:35 -05:00
ax_state->EnableProcessAccessibility();
} else {
chore: bump chromium to 136.0.7095.0 (36-x-y) (#46184) * 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) | https://chromium-review.googlesource.com/c/chromium/src/+/6368856 * 6356528: Clean up LegacyRenderWidgetHostHWND code | https://chromium-review.googlesource.com/c/chromium/src/+/6356528 * chore: export patches * 6339113: [Viewport Segments] Add CDP commands to override Viewport Segments without overriding other device properties. | https://chromium-review.googlesource.com/c/chromium/src/+/6339113 * 6352169: [DevTools][MultiInstance] Support new tab in another window on Android | https://chromium-review.googlesource.com/c/chromium/src/+/6352169 * 6368856: Migrate absl variant.h and utility.h in content (part 2/2) | https://chromium-review.googlesource.com/c/chromium/src/+/6368856 * 6360858:Clickiness: Wire response from URLLoader to DB, add e2e tests| https://chromium-review.googlesource.com/c/chromium/src/+/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 | https://chromium-review.googlesource.com/c/chromium/src/+/6361987 * chore: export patches * chore: bump chromium in DEPS to 136.0.7087.0 * chore: export patches * fix: include node patch for missing AtomicsWaitEvent https://chromium-review.googlesource.com/c/chromium/src/+/6385540 * build: add depot_tools python to path * fix: cppgc init and unregistering v8 isolate https://chromium-review.googlesource.com/c/v8/v8/+/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 https://chromium-review.googlesource.com/c/chromium/src/+/6298395 * fix: migrate content::BrowserAccessibilityState methods https://chromium-review.googlesource.com/c/chromium/src/+/6401437 https://chromium-review.googlesource.com/c/chromium/src/+/6383275 * feat: enableHappyEyeballs option for host resolver https://chromium-review.googlesource.com/c/chromium/src/+/6332599 * fix: add new cookie exclusion reason https://chromium-review.googlesource.com/c/chromium/src/+/6343479 * fix: add new url loader method https://chromium-review.googlesource.com/c/chromium/src/+/6337340 * fix: add new cppgc header file for electron_node headers https://chromium-review.googlesource.com/c/v8/v8/+/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 https://chromium-review.googlesource.com/c/v8/v8/+/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: https://chromium-review.googlesource.com/c/v8/v8/+/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: https://chromium-review.googlesource.com/c/v8/v8/+/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 9c019b6147e88dc14959cdb8e555de0fe52f51a4) * Remove file-wide unsafe buffer suppression from content/ [3 of N] https://chromium-review.googlesource.com/c/chromium/src/+/6341711 --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2025-04-07 13:09:35 -05:00
ax_state->DisableProcessAccessibility();
}
electron::Browser::Get()->OnAccessibilitySupportChanged();
// Don't call the superclass function for AXManualAccessibility,
// as it will log an AXError and make it appear as though the attribute
// failed to take effect.
if (is_manual_ax)
return;
}
return [super accessibilitySetValue:value forAttribute:attribute];
}
- (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);
}
return [super accessibilityRole];
}
2016-10-10 13:30:58 -07:00
- (void)orderFrontStandardAboutPanel:(id)sender {
electron::Browser::Get()->ShowAboutPanel();
}
- (void)addNativeEventProcessorObserver:
(content::NativeEventProcessorObserver*)observer {
observers_.AddObserver(observer);
}
- (void)removeNativeEventProcessorObserver:
(content::NativeEventProcessorObserver*)observer {
observers_.RemoveObserver(observer);
}
@end