electron/shell/browser/browser_mac.mm

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

574 строки
19 KiB
Plaintext
Исходник Обычный вид История

// Copyright (c) 2013 GitHub, Inc.
2014-04-25 13:49:37 +04:00
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "shell/browser/browser.h"
#include <memory>
#include <string>
#include <utility>
chore: bump chromium to 115.0.5786.0 (main) (#38301) * chore: bump chromium in DEPS to 115.0.5772.0 * chore: update disable_color_correct_rendering.patch no manual changes; patch succeeded with fuzz 2. * chore: update chromium/build_libc_as_static_library.patch no manual changes; patch succeeded with fuzz 2 (offset 1 line). * chore: update chromium/feat_configure_launch_options_for_service_process.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4518747 patch manually reapplied due to upstream code shear * chore: update chromium/chore_patch_out_profile_methods_in_profile_selections_cc.patch https://chromium-review.googlesource.com/c/chromium/src/+/4502965 patch manually reapplied due to upstream code shear * chore: update bundle_locations #include location Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4525355 * chore: Remove `extension_name` from DesktopStreamsRegistry Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4514081 * chore: bump chromium in DEPS to 115.0.5778.0 * chore: add chromium/chore_patch_out_profile_methods_in_chrome_browser_pdf.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4482679 Another instance of patching out upstream references to Profile code * refactor: add WebViewGuestDelegate::GetGuestDelegateWeakPtr() Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4515455 This approach copied from GuestViewBase::GetGuestDelegateWeakPtr() approach in that same commit. * fixup! chore: update bundle_locations #include location Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4525355 Sync namespace use to upstream base::mac -> base::apple changes * fixup! chore: update bundle_locations #include location Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4525355 Sync namespace use to upstream base::mac -> base::apple changes * chore: update chromium/mas_disable_remote_accessibility.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4530546 patch manually reapplied due to upstream code shear * chore: update chromium/printing.patch no manual changes; patch succeeded with fuzz * chore: update chromium/build_add_electron_tracing_category.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4517872 no manual changes; patch succeeded with fuzz * chore: update chromium/feat_ensure_mas_builds_of_the_same_application_can_use_safestorage.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4529098 patch manually reapplied due to upstream code shear * chromium/build_only_use_the_mas_build_config_in_the_required_components.patch https://chromium-review.googlesource.com/c/chromium/src/+/4529098 patch manually reapplied due to upstream code shear * chore: update chromium/mas-cgdisplayusesforcetogray.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4529475 no manual changes; patch succeeded with fuzz * chore: update chromium/build_only_use_the_mas_build_config_in_the_required_components.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4429011 no manual changes; patch succeeded with fuzz * chore: remove chromium/cherry-pick-48a136e77e6d.patch already present upstream * chore: remove chromium/cherry-pick-e6e23ba00379.patch already present upstream * [Code Health] Remove value based RegisterPref for Dict and List Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4533537 * Remove `cxx17_backports.h` and adjust unittest file Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4534916 Notes: mostly just removing #include and s/base::clamp/std::clamp/ * refactor: add FakeBrowserProcess helper class Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4424072 Used in ElectronBrowserMainParts' fake_browser_process_ field. Previously this was an BrowserProcessImpl instance, but upstream 4424072 makes that an abstract base class. `FakeBrowserProcess` is a thin subclass with the minimum code needed to make it concrete. `ElectronBrowserMainParts::fake_browser_process_` is now a `shared_ptr` instead of a `unique_ptr` so we can avoid exposing `FakeBrowserProcess` in the header. * fixup! refactor: add FakeBrowserProcess helper class remove unnecessary unique_ptr * fix: Browser::SetDockIcon() when !Browser.is_ready() Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4410741 An alternative fix for https://github.com/electron/electron/pull/36279 . The previous fix was to call `SetSupportedScales()` ourselves (1b1609a), but upstream has removed this API. CC @codebytere * fixup! chore: remove chromium/cherry-pick-e6e23ba00379.patch * chore: update chromium/export_gin_v8platform_pageallocator_for_usage_outside_of_the_gin.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4517404 patch manually reapplied due to upstream code shear * chore: update patches * chore: add dep: resource_coordinator:mojo_bindings Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4521464 * fixup! chore: add dep: resource_coordinator:mojo_bindings chore: make lint happy * chore: patch out Profile methods in titlebar_config Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4508143 (primary) Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4534461 (followup) * chore: bump chromium in DEPS to 115.0.5780.0 * chore: update chromium/disable_hidden.patch no manual changes; patch succeeded with fuzz * chore: update chromium/sysroot.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4535715 no manual changes; patch succeeded with fuzz * chore: update chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4403623 patch manually reapplied due to upstream code shear * chore: update chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4547380 patch manually reapplied due to upstream code shear * chore: update patches * fixup! fix: Browser::SetDockIcon() when !Browser.is_ready() chore: iwyu image.h * chore: bump chromium in DEPS to 115.0.5782.0 * chore: bump chromium in DEPS to 115.0.5784.0 * 4514181: CR2023: Update filled cr-input styles. https://chromium-review.googlesource.com/c/chromium/src/+/4514181 * 4521894: Remove SiteInstanceDeleting usage outside of tests. https://chromium-review.googlesource.com/c/chromium/src/+/4521894 * 4525355: Move backup_util and bundle_locations to base/apple https://chromium-review.googlesource.com/c/chromium/src/+/4525355 * 4484743: webauthn: add underlying support for calling iCloud Keychain on macOS. https://chromium-review.googlesource.com/c/chromium/src/+/4484743 * chore: fixup patch indices * 4546398: Convert /chrome/browser to use ARC https://chromium-review.googlesource.com/c/chromium/src/+/4546398 * chore: bump chromium in DEPS to 115.0.5786.0 * chore: update patches * 4540682: Initialize PDF SDK with policy in chrome_pdf::RenderPDFPageToDC() https://chromium-review.googlesource.com/c/chromium/src/+/4540682 * Don't import ObjC++ fn headers into electron_api_app * 4535715: Refactor sysroot-creator.sh https://chromium-review.googlesource.com/c/chromium/src/+/4535715 * fixup! refactor: add FakeBrowserProcess helper class * 4531903: [string][test] Create/Copy strings to old space before externalization https://chromium-review.googlesource.com/c/v8/v8/+/4531903 * 59645: Add APIs to support RSA keys with large e. https://boringssl-review.googlesource.com/c/boringssl/+/59645 --------- Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-05-23 22:58:58 +03:00
#include "base/apple/bundle_locations.h"
#include "base/i18n/rtl.h"
#include "base/mac/foundation_util.h"
2016-07-06 21:43:44 +03:00
#include "base/mac/mac_util.h"
chore: bump chromium to 110.0.5415.0 (main) (#36186) * chore: bump chromium in DEPS to 109.0.5386.0 * chore: bump chromium in DEPS to 109.0.5388.0 * chore: bump chromium in DEPS to 109.0.5390.0 * chore: bump chromium in DEPS to 109.0.5392.0 * chore: bump chromium in DEPS to 109.0.5394.0 * chore: bump chromium in DEPS to 109.0.5396.0 * chore: bump chromium in DEPS to 109.0.5398.0 * chore: bump chromium in DEPS to 109.0.5400.0 * chore: update galactus * chore: bump chromium in DEPS to 109.0.5402.0 * chore: bump chromium in DEPS to 109.0.5403.0 * chore: bump chromium in DEPS to 109.0.5406.0 * chore: update patches * 4004247: Delete unused DocumentWebContentsDelegate Ref: https://chromium-review.googlesource.com/c/chromium/src/+/4004247 * chore: bump chromium in DEPS to 109.0.5408.1 * chore: update patches * 3949284: Support pkey debug mode without pkey 0 access Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3949284 * chore: bump chromium in DEPS to 109.0.5410.0 * chore: update patches * 4000944: [Extensions] Create an API directory in //chrome/renderer/extensions Ref: https://chromium-review.googlesource.com/c/chromium/src/+/4000944 * 3988524: Remove DocumentOverlayWindowViews | https://chromium-review.googlesource.com/c/chromium/src/+/3988524 Co-authored-by: George Xu <33054982+georgexu99@users.noreply.github.com> * chore: bump chromium in DEPS to 109.0.5412.0 * chore: update patches * 3984022: Add AddChildWindowToBrowser to DisplayClient mojo interface Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3984022 * 3957079: Delete the CryptoToken component extension and internal API Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3957079 * 4004421: Migreate ScopedAllowIO to ScopedAllowBlocking Ref: https://chromium-review.googlesource.com/c/chromium/src/+/4004421 Co-authored-by: George Xu <georgexu99@users.noreply.github.com> * chore: bump chromium in DEPS to 109.0.5414.0 * chore: update patches * 4016180: Split PPAPI Mojo interfaces out of RenderFrameHostImpl. Ref: https://chromium-review.googlesource.com/c/chromium/src/+/4016180 * 3970838: [MPArch] Convert HostZoomMap and ZoomController off of RenderViewHost ids Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3970838 * 3997795: Don't add Chromium as a login item Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3997795 * 3993482: Remove RefCountedString::TakeString Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3993482 * 3990749: Allow forward-declared sources in base::ScopedObservation<> Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3990749 * fixup! 3957079: Delete the CryptoToken component extension and internal API * chore: bump chromium in DEPS to 110.0.5415.0 * 3883790: Move devtools_frame_token to the RenderFrameHost, to preserve RFH identity across MPArch activations. https://chromium-review.googlesource.com/c/chromium/src/+/3883790 * 4022205: Move license tooling into //tools/licenses https://chromium-review.googlesource.com/c/chromium/src/+/4022205 * chore: fixup patch indices * fixup! 3957079: Delete the CryptoToken component extension and internal API * 4008687: Finish ScopedAllowIO migration https://chromium-review.googlesource.com/c/chromium/src/+/4008687 * 3991548: Move WindowButtonOrderObserver and WindowFrameAction to LinuxUi https://chromium-review.googlesource.com/c/chromium/src/+/3991548 * fixup! 3984022: Add AddChildWindowToBrowser to DisplayClient mojo interface * 4016595: Migrate non-default ScopedObservation<> instantiations to ScopedObservationTraits<> in chrome/browser/ https://chromium-review.googlesource.com/c/chromium/src/+/4016595 * 4000481: Rename :chromedriver to :chromedriver_server Ref: https://chromium-review.googlesource.com/c/chromium/src/+/4000481 * 4008687: Finish ScopedAllowIO migration https://chromium-review.googlesource.com/c/chromium/src/+/4008687 * 3988524: Remove DocumentOverlayWindowViews https://chromium-review.googlesource.com/c/chromium/src/+/3988524 * fixup! 3997795: Don't add Chromium as a login item * chore: fixup patches * 3996872: Plumb input event task runner to EventFactoryEvdev https://chromium-review.googlesource.com/c/chromium/src/+/3996872 * 4014994: Enable SiteIsolationForGuests by default. https://chromium-review.googlesource.com/c/chromium/src/+/4014994 * chore: adopt new thread restrictions api for //electron (#36357) chore: add thread blocking api * fixup! 4014994: Enable SiteIsolationForGuests by default. * pull parent HWND for dialogs on ui thread * chore: set parent_window in MessageBoxSettings * chore: remove redundant patch * chore: revert accidental deletion * chore: update patches Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Samuel Attard <sattard@salesforce.com> Co-authored-by: Keeley Hammond <khammond@slack-corp.com> Co-authored-by: VerteDinde <vertedinde@electronjs.org> Co-authored-by: George Xu <33054982+georgexu99@users.noreply.github.com> Co-authored-by: George Xu <georgexu99@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> Co-authored-by: Robo <hop2deep@gmail.com> Co-authored-by: Jeremy Rose <jeremya@chromium.org> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-11-17 22:59:23 +03:00
#include "base/mac/mac_util.mm"
#include "base/mac/scoped_cftyperef.h"
2016-07-01 11:39:01 +03:00
#include "base/strings/string_number_conversions.h"
2016-07-02 04:36:11 +03:00
#include "base/strings/sys_string_conversions.h"
#include "chrome/browser/browser_process.h"
2016-05-23 18:49:46 +03:00
#include "net/base/mac/url_conversions.h"
#include "shell/browser/badging/badge_manager.h"
#include "shell/browser/mac/dict_util.h"
#include "shell/browser/mac/electron_application.h"
#include "shell/browser/mac/electron_application_delegate.h"
#include "shell/browser/native_window.h"
#include "shell/browser/window_list.h"
#include "shell/common/api/electron_api_native_image.h"
#include "shell/common/application_info.h"
#include "shell/common/gin_converters/image_converter.h"
#include "shell/common/gin_helper/arguments.h"
#include "shell/common/gin_helper/dictionary.h"
#include "shell/common/gin_helper/error_thrower.h"
#include "shell/common/gin_helper/promise.h"
#include "shell/common/platform_util.h"
#include "ui/gfx/image/image.h"
2016-05-23 18:49:46 +03:00
#include "url/gurl.h"
namespace electron {
namespace {
bool IsAppRTL() {
const std::string& locale = g_browser_process->GetApplicationLocale();
base::i18n::TextDirection text_direction =
base::i18n::GetTextDirectionForLocaleInStartUp(locale.c_str());
return text_direction == base::i18n::RIGHT_TO_LEFT;
}
NSString* GetAppPathForProtocol(const GURL& url) {
NSURL* ns_url = [NSURL
URLWithString:base::SysUTF8ToNSString(url.possibly_invalid_spec())];
base::ScopedCFTypeRef<CFErrorRef> out_err;
base::ScopedCFTypeRef<CFURLRef> openingApp(LSCopyDefaultApplicationURLForURL(
(CFURLRef)ns_url, kLSRolesAll, out_err.InitializeInto()));
if (out_err) {
// likely kLSApplicationNotFoundErr
return nullptr;
}
NSString* app_path = [base::mac::CFToNSCast(openingApp.get()) path];
return app_path;
}
gfx::Image GetApplicationIconForProtocol(NSString* _Nonnull app_path) {
NSImage* image = [[NSWorkspace sharedWorkspace] iconForFile:app_path];
gfx::Image icon(image);
return icon;
}
std::u16string GetAppDisplayNameForProtocol(NSString* app_path) {
NSString* app_display_name =
[[NSFileManager defaultManager] displayNameAtPath:app_path];
return base::SysNSStringToUTF16(app_display_name);
}
chore: bump chromium to 110.0.5415.0 (main) (#36186) * chore: bump chromium in DEPS to 109.0.5386.0 * chore: bump chromium in DEPS to 109.0.5388.0 * chore: bump chromium in DEPS to 109.0.5390.0 * chore: bump chromium in DEPS to 109.0.5392.0 * chore: bump chromium in DEPS to 109.0.5394.0 * chore: bump chromium in DEPS to 109.0.5396.0 * chore: bump chromium in DEPS to 109.0.5398.0 * chore: bump chromium in DEPS to 109.0.5400.0 * chore: update galactus * chore: bump chromium in DEPS to 109.0.5402.0 * chore: bump chromium in DEPS to 109.0.5403.0 * chore: bump chromium in DEPS to 109.0.5406.0 * chore: update patches * 4004247: Delete unused DocumentWebContentsDelegate Ref: https://chromium-review.googlesource.com/c/chromium/src/+/4004247 * chore: bump chromium in DEPS to 109.0.5408.1 * chore: update patches * 3949284: Support pkey debug mode without pkey 0 access Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3949284 * chore: bump chromium in DEPS to 109.0.5410.0 * chore: update patches * 4000944: [Extensions] Create an API directory in //chrome/renderer/extensions Ref: https://chromium-review.googlesource.com/c/chromium/src/+/4000944 * 3988524: Remove DocumentOverlayWindowViews | https://chromium-review.googlesource.com/c/chromium/src/+/3988524 Co-authored-by: George Xu <33054982+georgexu99@users.noreply.github.com> * chore: bump chromium in DEPS to 109.0.5412.0 * chore: update patches * 3984022: Add AddChildWindowToBrowser to DisplayClient mojo interface Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3984022 * 3957079: Delete the CryptoToken component extension and internal API Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3957079 * 4004421: Migreate ScopedAllowIO to ScopedAllowBlocking Ref: https://chromium-review.googlesource.com/c/chromium/src/+/4004421 Co-authored-by: George Xu <georgexu99@users.noreply.github.com> * chore: bump chromium in DEPS to 109.0.5414.0 * chore: update patches * 4016180: Split PPAPI Mojo interfaces out of RenderFrameHostImpl. Ref: https://chromium-review.googlesource.com/c/chromium/src/+/4016180 * 3970838: [MPArch] Convert HostZoomMap and ZoomController off of RenderViewHost ids Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3970838 * 3997795: Don't add Chromium as a login item Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3997795 * 3993482: Remove RefCountedString::TakeString Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3993482 * 3990749: Allow forward-declared sources in base::ScopedObservation<> Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3990749 * fixup! 3957079: Delete the CryptoToken component extension and internal API * chore: bump chromium in DEPS to 110.0.5415.0 * 3883790: Move devtools_frame_token to the RenderFrameHost, to preserve RFH identity across MPArch activations. https://chromium-review.googlesource.com/c/chromium/src/+/3883790 * 4022205: Move license tooling into //tools/licenses https://chromium-review.googlesource.com/c/chromium/src/+/4022205 * chore: fixup patch indices * fixup! 3957079: Delete the CryptoToken component extension and internal API * 4008687: Finish ScopedAllowIO migration https://chromium-review.googlesource.com/c/chromium/src/+/4008687 * 3991548: Move WindowButtonOrderObserver and WindowFrameAction to LinuxUi https://chromium-review.googlesource.com/c/chromium/src/+/3991548 * fixup! 3984022: Add AddChildWindowToBrowser to DisplayClient mojo interface * 4016595: Migrate non-default ScopedObservation<> instantiations to ScopedObservationTraits<> in chrome/browser/ https://chromium-review.googlesource.com/c/chromium/src/+/4016595 * 4000481: Rename :chromedriver to :chromedriver_server Ref: https://chromium-review.googlesource.com/c/chromium/src/+/4000481 * 4008687: Finish ScopedAllowIO migration https://chromium-review.googlesource.com/c/chromium/src/+/4008687 * 3988524: Remove DocumentOverlayWindowViews https://chromium-review.googlesource.com/c/chromium/src/+/3988524 * fixup! 3997795: Don't add Chromium as a login item * chore: fixup patches * 3996872: Plumb input event task runner to EventFactoryEvdev https://chromium-review.googlesource.com/c/chromium/src/+/3996872 * 4014994: Enable SiteIsolationForGuests by default. https://chromium-review.googlesource.com/c/chromium/src/+/4014994 * chore: adopt new thread restrictions api for //electron (#36357) chore: add thread blocking api * fixup! 4014994: Enable SiteIsolationForGuests by default. * pull parent HWND for dialogs on ui thread * chore: set parent_window in MessageBoxSettings * chore: remove redundant patch * chore: revert accidental deletion * chore: update patches Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Samuel Attard <sattard@salesforce.com> Co-authored-by: Keeley Hammond <khammond@slack-corp.com> Co-authored-by: VerteDinde <vertedinde@electronjs.org> Co-authored-by: George Xu <33054982+georgexu99@users.noreply.github.com> Co-authored-by: George Xu <georgexu99@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> Co-authored-by: Robo <hop2deep@gmail.com> Co-authored-by: Jeremy Rose <jeremya@chromium.org> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-11-17 22:59:23 +03:00
#if !IS_MAS_BUILD()
bool CheckLoginItemStatus(bool* is_hidden) {
base::mac::LoginItemsFileList login_items;
if (!login_items.Initialize())
return false;
base::ScopedCFTypeRef<LSSharedFileListItemRef> item(
login_items.GetLoginItemForMainApp());
if (!item.get())
return false;
if (is_hidden)
*is_hidden = base::mac::IsHiddenLoginItem(item);
return true;
}
#endif
} // namespace
v8::Local<v8::Promise> Browser::GetApplicationInfoForProtocol(
v8::Isolate* isolate,
const GURL& url) {
gin_helper::Promise<gin_helper::Dictionary> promise(isolate);
v8::Local<v8::Promise> handle = promise.GetHandle();
gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
NSString* ns_app_path = GetAppPathForProtocol(url);
if (!ns_app_path) {
promise.RejectWithErrorMessage(
"Unable to retrieve installation path to app");
return handle;
}
std::u16string app_path = base::SysNSStringToUTF16(ns_app_path);
std::u16string app_display_name = GetAppDisplayNameForProtocol(ns_app_path);
gfx::Image app_icon = GetApplicationIconForProtocol(ns_app_path);
dict.Set("name", app_display_name);
dict.Set("path", app_path);
dict.Set("icon", app_icon);
promise.Resolve(dict);
return handle;
}
void Browser::SetShutdownHandler(base::RepeatingCallback<bool()> handler) {
[[AtomApplication sharedApplication] setShutdownHandler:std::move(handler)];
2018-02-05 10:13:35 +03:00
}
2020-07-29 02:43:43 +03:00
void Browser::Focus(gin::Arguments* args) {
gin_helper::Dictionary opts;
bool steal_focus = false;
if (args->GetNext(&opts)) {
gin_helper::ErrorThrower thrower(args->isolate());
if (!opts.Get("steal", &steal_focus)) {
thrower.ThrowError(
"Expected options object to contain a 'steal' boolean property");
return;
}
}
[[AtomApplication sharedApplication] activateIgnoringOtherApps:steal_focus];
2013-05-30 15:24:47 +04:00
}
void Browser::Hide() {
[[AtomApplication sharedApplication] hide:nil];
}
bool Browser::IsHidden() {
return [[AtomApplication sharedApplication] isHidden];
}
2016-01-30 23:40:32 +03:00
void Browser::Show() {
[[AtomApplication sharedApplication] unhide:nil];
2016-01-30 23:40:32 +03:00
}
2014-11-17 08:05:06 +03:00
void Browser::AddRecentDocument(const base::FilePath& path) {
NSString* path_string = base::mac::FilePathToNSString(path);
if (!path_string)
return;
NSURL* u = [NSURL fileURLWithPath:path_string];
if (!u)
return;
2014-11-17 08:05:06 +03:00
[[NSDocumentController sharedDocumentController] noteNewRecentDocumentURL:u];
}
2014-11-17 11:13:47 +03:00
void Browser::ClearRecentDocuments() {
[[NSDocumentController sharedDocumentController] clearRecentDocuments:nil];
2014-11-17 11:13:47 +03:00
}
2016-08-16 08:54:30 +03:00
bool Browser::RemoveAsDefaultProtocolClient(const std::string& protocol,
2020-07-29 02:43:43 +03:00
gin::Arguments* args) {
chore: bump chromium to 115.0.5786.0 (main) (#38301) * chore: bump chromium in DEPS to 115.0.5772.0 * chore: update disable_color_correct_rendering.patch no manual changes; patch succeeded with fuzz 2. * chore: update chromium/build_libc_as_static_library.patch no manual changes; patch succeeded with fuzz 2 (offset 1 line). * chore: update chromium/feat_configure_launch_options_for_service_process.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4518747 patch manually reapplied due to upstream code shear * chore: update chromium/chore_patch_out_profile_methods_in_profile_selections_cc.patch https://chromium-review.googlesource.com/c/chromium/src/+/4502965 patch manually reapplied due to upstream code shear * chore: update bundle_locations #include location Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4525355 * chore: Remove `extension_name` from DesktopStreamsRegistry Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4514081 * chore: bump chromium in DEPS to 115.0.5778.0 * chore: add chromium/chore_patch_out_profile_methods_in_chrome_browser_pdf.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4482679 Another instance of patching out upstream references to Profile code * refactor: add WebViewGuestDelegate::GetGuestDelegateWeakPtr() Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4515455 This approach copied from GuestViewBase::GetGuestDelegateWeakPtr() approach in that same commit. * fixup! chore: update bundle_locations #include location Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4525355 Sync namespace use to upstream base::mac -> base::apple changes * fixup! chore: update bundle_locations #include location Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4525355 Sync namespace use to upstream base::mac -> base::apple changes * chore: update chromium/mas_disable_remote_accessibility.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4530546 patch manually reapplied due to upstream code shear * chore: update chromium/printing.patch no manual changes; patch succeeded with fuzz * chore: update chromium/build_add_electron_tracing_category.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4517872 no manual changes; patch succeeded with fuzz * chore: update chromium/feat_ensure_mas_builds_of_the_same_application_can_use_safestorage.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4529098 patch manually reapplied due to upstream code shear * chromium/build_only_use_the_mas_build_config_in_the_required_components.patch https://chromium-review.googlesource.com/c/chromium/src/+/4529098 patch manually reapplied due to upstream code shear * chore: update chromium/mas-cgdisplayusesforcetogray.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4529475 no manual changes; patch succeeded with fuzz * chore: update chromium/build_only_use_the_mas_build_config_in_the_required_components.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4429011 no manual changes; patch succeeded with fuzz * chore: remove chromium/cherry-pick-48a136e77e6d.patch already present upstream * chore: remove chromium/cherry-pick-e6e23ba00379.patch already present upstream * [Code Health] Remove value based RegisterPref for Dict and List Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4533537 * Remove `cxx17_backports.h` and adjust unittest file Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4534916 Notes: mostly just removing #include and s/base::clamp/std::clamp/ * refactor: add FakeBrowserProcess helper class Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4424072 Used in ElectronBrowserMainParts' fake_browser_process_ field. Previously this was an BrowserProcessImpl instance, but upstream 4424072 makes that an abstract base class. `FakeBrowserProcess` is a thin subclass with the minimum code needed to make it concrete. `ElectronBrowserMainParts::fake_browser_process_` is now a `shared_ptr` instead of a `unique_ptr` so we can avoid exposing `FakeBrowserProcess` in the header. * fixup! refactor: add FakeBrowserProcess helper class remove unnecessary unique_ptr * fix: Browser::SetDockIcon() when !Browser.is_ready() Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4410741 An alternative fix for https://github.com/electron/electron/pull/36279 . The previous fix was to call `SetSupportedScales()` ourselves (1b1609a), but upstream has removed this API. CC @codebytere * fixup! chore: remove chromium/cherry-pick-e6e23ba00379.patch * chore: update chromium/export_gin_v8platform_pageallocator_for_usage_outside_of_the_gin.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4517404 patch manually reapplied due to upstream code shear * chore: update patches * chore: add dep: resource_coordinator:mojo_bindings Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4521464 * fixup! chore: add dep: resource_coordinator:mojo_bindings chore: make lint happy * chore: patch out Profile methods in titlebar_config Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4508143 (primary) Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4534461 (followup) * chore: bump chromium in DEPS to 115.0.5780.0 * chore: update chromium/disable_hidden.patch no manual changes; patch succeeded with fuzz * chore: update chromium/sysroot.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4535715 no manual changes; patch succeeded with fuzz * chore: update chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4403623 patch manually reapplied due to upstream code shear * chore: update chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4547380 patch manually reapplied due to upstream code shear * chore: update patches * fixup! fix: Browser::SetDockIcon() when !Browser.is_ready() chore: iwyu image.h * chore: bump chromium in DEPS to 115.0.5782.0 * chore: bump chromium in DEPS to 115.0.5784.0 * 4514181: CR2023: Update filled cr-input styles. https://chromium-review.googlesource.com/c/chromium/src/+/4514181 * 4521894: Remove SiteInstanceDeleting usage outside of tests. https://chromium-review.googlesource.com/c/chromium/src/+/4521894 * 4525355: Move backup_util and bundle_locations to base/apple https://chromium-review.googlesource.com/c/chromium/src/+/4525355 * 4484743: webauthn: add underlying support for calling iCloud Keychain on macOS. https://chromium-review.googlesource.com/c/chromium/src/+/4484743 * chore: fixup patch indices * 4546398: Convert /chrome/browser to use ARC https://chromium-review.googlesource.com/c/chromium/src/+/4546398 * chore: bump chromium in DEPS to 115.0.5786.0 * chore: update patches * 4540682: Initialize PDF SDK with policy in chrome_pdf::RenderPDFPageToDC() https://chromium-review.googlesource.com/c/chromium/src/+/4540682 * Don't import ObjC++ fn headers into electron_api_app * 4535715: Refactor sysroot-creator.sh https://chromium-review.googlesource.com/c/chromium/src/+/4535715 * fixup! refactor: add FakeBrowserProcess helper class * 4531903: [string][test] Create/Copy strings to old space before externalization https://chromium-review.googlesource.com/c/v8/v8/+/4531903 * 59645: Add APIs to support RSA keys with large e. https://boringssl-review.googlesource.com/c/boringssl/+/59645 --------- Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-05-23 22:58:58 +03:00
NSString* identifier = [base::apple::MainBundle() bundleIdentifier];
if (!identifier)
return false;
2016-08-16 10:40:44 +03:00
if (!Browser::IsDefaultProtocolClient(protocol, args))
return false;
NSString* protocol_ns = [NSString stringWithUTF8String:protocol.c_str()];
CFStringRef protocol_cf = base::mac::NSToCFCast(protocol_ns);
CFArrayRef bundleList = LSCopyAllHandlersForURLScheme(protocol_cf);
if (!bundleList) {
return false;
}
2016-06-18 16:26:26 +03:00
// On macOS, we can't query the default, but the handlers list seems to put
// Apple's defaults first, so we'll use the first option that isn't our bundle
CFStringRef other = nil;
2017-03-30 23:56:21 +03:00
for (CFIndex i = 0; i < CFArrayGetCount(bundleList); ++i) {
2018-04-20 21:47:04 +03:00
other =
base::mac::CFCast<CFStringRef>(CFArrayGetValueAtIndex(bundleList, i));
if (![identifier isEqualToString:(__bridge NSString*)other]) {
break;
}
}
2018-06-20 06:16:37 +03:00
// No other app was found set it to none instead of setting it back to itself.
if ([identifier isEqualToString:(__bridge NSString*)other]) {
other = base::mac::NSToCFCast(@"None");
}
OSStatus return_code = LSSetDefaultHandlerForURLScheme(protocol_cf, other);
return return_code == noErr;
}
2016-08-16 08:54:30 +03:00
bool Browser::SetAsDefaultProtocolClient(const std::string& protocol,
2020-07-29 02:43:43 +03:00
gin::Arguments* args) {
if (protocol.empty())
return false;
chore: bump chromium to 115.0.5786.0 (main) (#38301) * chore: bump chromium in DEPS to 115.0.5772.0 * chore: update disable_color_correct_rendering.patch no manual changes; patch succeeded with fuzz 2. * chore: update chromium/build_libc_as_static_library.patch no manual changes; patch succeeded with fuzz 2 (offset 1 line). * chore: update chromium/feat_configure_launch_options_for_service_process.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4518747 patch manually reapplied due to upstream code shear * chore: update chromium/chore_patch_out_profile_methods_in_profile_selections_cc.patch https://chromium-review.googlesource.com/c/chromium/src/+/4502965 patch manually reapplied due to upstream code shear * chore: update bundle_locations #include location Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4525355 * chore: Remove `extension_name` from DesktopStreamsRegistry Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4514081 * chore: bump chromium in DEPS to 115.0.5778.0 * chore: add chromium/chore_patch_out_profile_methods_in_chrome_browser_pdf.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4482679 Another instance of patching out upstream references to Profile code * refactor: add WebViewGuestDelegate::GetGuestDelegateWeakPtr() Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4515455 This approach copied from GuestViewBase::GetGuestDelegateWeakPtr() approach in that same commit. * fixup! chore: update bundle_locations #include location Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4525355 Sync namespace use to upstream base::mac -> base::apple changes * fixup! chore: update bundle_locations #include location Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4525355 Sync namespace use to upstream base::mac -> base::apple changes * chore: update chromium/mas_disable_remote_accessibility.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4530546 patch manually reapplied due to upstream code shear * chore: update chromium/printing.patch no manual changes; patch succeeded with fuzz * chore: update chromium/build_add_electron_tracing_category.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4517872 no manual changes; patch succeeded with fuzz * chore: update chromium/feat_ensure_mas_builds_of_the_same_application_can_use_safestorage.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4529098 patch manually reapplied due to upstream code shear * chromium/build_only_use_the_mas_build_config_in_the_required_components.patch https://chromium-review.googlesource.com/c/chromium/src/+/4529098 patch manually reapplied due to upstream code shear * chore: update chromium/mas-cgdisplayusesforcetogray.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4529475 no manual changes; patch succeeded with fuzz * chore: update chromium/build_only_use_the_mas_build_config_in_the_required_components.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4429011 no manual changes; patch succeeded with fuzz * chore: remove chromium/cherry-pick-48a136e77e6d.patch already present upstream * chore: remove chromium/cherry-pick-e6e23ba00379.patch already present upstream * [Code Health] Remove value based RegisterPref for Dict and List Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4533537 * Remove `cxx17_backports.h` and adjust unittest file Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4534916 Notes: mostly just removing #include and s/base::clamp/std::clamp/ * refactor: add FakeBrowserProcess helper class Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4424072 Used in ElectronBrowserMainParts' fake_browser_process_ field. Previously this was an BrowserProcessImpl instance, but upstream 4424072 makes that an abstract base class. `FakeBrowserProcess` is a thin subclass with the minimum code needed to make it concrete. `ElectronBrowserMainParts::fake_browser_process_` is now a `shared_ptr` instead of a `unique_ptr` so we can avoid exposing `FakeBrowserProcess` in the header. * fixup! refactor: add FakeBrowserProcess helper class remove unnecessary unique_ptr * fix: Browser::SetDockIcon() when !Browser.is_ready() Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4410741 An alternative fix for https://github.com/electron/electron/pull/36279 . The previous fix was to call `SetSupportedScales()` ourselves (1b1609a), but upstream has removed this API. CC @codebytere * fixup! chore: remove chromium/cherry-pick-e6e23ba00379.patch * chore: update chromium/export_gin_v8platform_pageallocator_for_usage_outside_of_the_gin.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4517404 patch manually reapplied due to upstream code shear * chore: update patches * chore: add dep: resource_coordinator:mojo_bindings Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4521464 * fixup! chore: add dep: resource_coordinator:mojo_bindings chore: make lint happy * chore: patch out Profile methods in titlebar_config Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4508143 (primary) Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4534461 (followup) * chore: bump chromium in DEPS to 115.0.5780.0 * chore: update chromium/disable_hidden.patch no manual changes; patch succeeded with fuzz * chore: update chromium/sysroot.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4535715 no manual changes; patch succeeded with fuzz * chore: update chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4403623 patch manually reapplied due to upstream code shear * chore: update chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4547380 patch manually reapplied due to upstream code shear * chore: update patches * fixup! fix: Browser::SetDockIcon() when !Browser.is_ready() chore: iwyu image.h * chore: bump chromium in DEPS to 115.0.5782.0 * chore: bump chromium in DEPS to 115.0.5784.0 * 4514181: CR2023: Update filled cr-input styles. https://chromium-review.googlesource.com/c/chromium/src/+/4514181 * 4521894: Remove SiteInstanceDeleting usage outside of tests. https://chromium-review.googlesource.com/c/chromium/src/+/4521894 * 4525355: Move backup_util and bundle_locations to base/apple https://chromium-review.googlesource.com/c/chromium/src/+/4525355 * 4484743: webauthn: add underlying support for calling iCloud Keychain on macOS. https://chromium-review.googlesource.com/c/chromium/src/+/4484743 * chore: fixup patch indices * 4546398: Convert /chrome/browser to use ARC https://chromium-review.googlesource.com/c/chromium/src/+/4546398 * chore: bump chromium in DEPS to 115.0.5786.0 * chore: update patches * 4540682: Initialize PDF SDK with policy in chrome_pdf::RenderPDFPageToDC() https://chromium-review.googlesource.com/c/chromium/src/+/4540682 * Don't import ObjC++ fn headers into electron_api_app * 4535715: Refactor sysroot-creator.sh https://chromium-review.googlesource.com/c/chromium/src/+/4535715 * fixup! refactor: add FakeBrowserProcess helper class * 4531903: [string][test] Create/Copy strings to old space before externalization https://chromium-review.googlesource.com/c/v8/v8/+/4531903 * 59645: Add APIs to support RSA keys with large e. https://boringssl-review.googlesource.com/c/boringssl/+/59645 --------- Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-05-23 22:58:58 +03:00
NSString* identifier = [base::apple::MainBundle() bundleIdentifier];
if (!identifier)
return false;
NSString* protocol_ns = [NSString stringWithUTF8String:protocol.c_str()];
2018-04-20 21:47:04 +03:00
OSStatus return_code = LSSetDefaultHandlerForURLScheme(
base::mac::NSToCFCast(protocol_ns), base::mac::NSToCFCast(identifier));
return return_code == noErr;
}
2016-08-16 08:54:30 +03:00
bool Browser::IsDefaultProtocolClient(const std::string& protocol,
2020-07-29 02:43:43 +03:00
gin::Arguments* args) {
2016-04-25 08:17:01 +03:00
if (protocol.empty())
return false;
chore: bump chromium to 115.0.5786.0 (main) (#38301) * chore: bump chromium in DEPS to 115.0.5772.0 * chore: update disable_color_correct_rendering.patch no manual changes; patch succeeded with fuzz 2. * chore: update chromium/build_libc_as_static_library.patch no manual changes; patch succeeded with fuzz 2 (offset 1 line). * chore: update chromium/feat_configure_launch_options_for_service_process.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4518747 patch manually reapplied due to upstream code shear * chore: update chromium/chore_patch_out_profile_methods_in_profile_selections_cc.patch https://chromium-review.googlesource.com/c/chromium/src/+/4502965 patch manually reapplied due to upstream code shear * chore: update bundle_locations #include location Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4525355 * chore: Remove `extension_name` from DesktopStreamsRegistry Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4514081 * chore: bump chromium in DEPS to 115.0.5778.0 * chore: add chromium/chore_patch_out_profile_methods_in_chrome_browser_pdf.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4482679 Another instance of patching out upstream references to Profile code * refactor: add WebViewGuestDelegate::GetGuestDelegateWeakPtr() Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4515455 This approach copied from GuestViewBase::GetGuestDelegateWeakPtr() approach in that same commit. * fixup! chore: update bundle_locations #include location Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4525355 Sync namespace use to upstream base::mac -> base::apple changes * fixup! chore: update bundle_locations #include location Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4525355 Sync namespace use to upstream base::mac -> base::apple changes * chore: update chromium/mas_disable_remote_accessibility.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4530546 patch manually reapplied due to upstream code shear * chore: update chromium/printing.patch no manual changes; patch succeeded with fuzz * chore: update chromium/build_add_electron_tracing_category.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4517872 no manual changes; patch succeeded with fuzz * chore: update chromium/feat_ensure_mas_builds_of_the_same_application_can_use_safestorage.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4529098 patch manually reapplied due to upstream code shear * chromium/build_only_use_the_mas_build_config_in_the_required_components.patch https://chromium-review.googlesource.com/c/chromium/src/+/4529098 patch manually reapplied due to upstream code shear * chore: update chromium/mas-cgdisplayusesforcetogray.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4529475 no manual changes; patch succeeded with fuzz * chore: update chromium/build_only_use_the_mas_build_config_in_the_required_components.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4429011 no manual changes; patch succeeded with fuzz * chore: remove chromium/cherry-pick-48a136e77e6d.patch already present upstream * chore: remove chromium/cherry-pick-e6e23ba00379.patch already present upstream * [Code Health] Remove value based RegisterPref for Dict and List Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4533537 * Remove `cxx17_backports.h` and adjust unittest file Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4534916 Notes: mostly just removing #include and s/base::clamp/std::clamp/ * refactor: add FakeBrowserProcess helper class Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4424072 Used in ElectronBrowserMainParts' fake_browser_process_ field. Previously this was an BrowserProcessImpl instance, but upstream 4424072 makes that an abstract base class. `FakeBrowserProcess` is a thin subclass with the minimum code needed to make it concrete. `ElectronBrowserMainParts::fake_browser_process_` is now a `shared_ptr` instead of a `unique_ptr` so we can avoid exposing `FakeBrowserProcess` in the header. * fixup! refactor: add FakeBrowserProcess helper class remove unnecessary unique_ptr * fix: Browser::SetDockIcon() when !Browser.is_ready() Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4410741 An alternative fix for https://github.com/electron/electron/pull/36279 . The previous fix was to call `SetSupportedScales()` ourselves (1b1609a), but upstream has removed this API. CC @codebytere * fixup! chore: remove chromium/cherry-pick-e6e23ba00379.patch * chore: update chromium/export_gin_v8platform_pageallocator_for_usage_outside_of_the_gin.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4517404 patch manually reapplied due to upstream code shear * chore: update patches * chore: add dep: resource_coordinator:mojo_bindings Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4521464 * fixup! chore: add dep: resource_coordinator:mojo_bindings chore: make lint happy * chore: patch out Profile methods in titlebar_config Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4508143 (primary) Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4534461 (followup) * chore: bump chromium in DEPS to 115.0.5780.0 * chore: update chromium/disable_hidden.patch no manual changes; patch succeeded with fuzz * chore: update chromium/sysroot.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4535715 no manual changes; patch succeeded with fuzz * chore: update chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4403623 patch manually reapplied due to upstream code shear * chore: update chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4547380 patch manually reapplied due to upstream code shear * chore: update patches * fixup! fix: Browser::SetDockIcon() when !Browser.is_ready() chore: iwyu image.h * chore: bump chromium in DEPS to 115.0.5782.0 * chore: bump chromium in DEPS to 115.0.5784.0 * 4514181: CR2023: Update filled cr-input styles. https://chromium-review.googlesource.com/c/chromium/src/+/4514181 * 4521894: Remove SiteInstanceDeleting usage outside of tests. https://chromium-review.googlesource.com/c/chromium/src/+/4521894 * 4525355: Move backup_util and bundle_locations to base/apple https://chromium-review.googlesource.com/c/chromium/src/+/4525355 * 4484743: webauthn: add underlying support for calling iCloud Keychain on macOS. https://chromium-review.googlesource.com/c/chromium/src/+/4484743 * chore: fixup patch indices * 4546398: Convert /chrome/browser to use ARC https://chromium-review.googlesource.com/c/chromium/src/+/4546398 * chore: bump chromium in DEPS to 115.0.5786.0 * chore: update patches * 4540682: Initialize PDF SDK with policy in chrome_pdf::RenderPDFPageToDC() https://chromium-review.googlesource.com/c/chromium/src/+/4540682 * Don't import ObjC++ fn headers into electron_api_app * 4535715: Refactor sysroot-creator.sh https://chromium-review.googlesource.com/c/chromium/src/+/4535715 * fixup! refactor: add FakeBrowserProcess helper class * 4531903: [string][test] Create/Copy strings to old space before externalization https://chromium-review.googlesource.com/c/v8/v8/+/4531903 * 59645: Add APIs to support RSA keys with large e. https://boringssl-review.googlesource.com/c/boringssl/+/59645 --------- Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-05-23 22:58:58 +03:00
NSString* identifier = [base::apple::MainBundle() bundleIdentifier];
2016-04-25 08:17:01 +03:00
if (!identifier)
return false;
NSString* protocol_ns = [NSString stringWithUTF8String:protocol.c_str()];
2016-04-30 21:17:29 +03:00
base::ScopedCFTypeRef<CFStringRef> bundleId(
LSCopyDefaultHandlerForURLScheme(base::mac::NSToCFCast(protocol_ns)));
2016-04-25 08:17:01 +03:00
if (!bundleId)
return false;
2016-04-30 21:17:29 +03:00
// Ensure the comparison is case-insensitive
2016-04-25 08:17:01 +03:00
// as LS does not persist the case of the bundle id.
NSComparisonResult result =
[base::mac::CFToNSCast(bundleId) caseInsensitiveCompare:identifier];
2016-04-25 08:17:01 +03:00
return result == NSOrderedSame;
}
std::u16string Browser::GetApplicationNameForProtocol(const GURL& url) {
NSString* app_path = GetAppPathForProtocol(url);
if (!app_path) {
return std::u16string();
}
std::u16string app_display_name = GetAppDisplayNameForProtocol(app_path);
return app_display_name;
}
chore: bump chromium to 93.0.4530.0 (master) (#29256) * chore: bump chromium in DEPS to 92.0.4512.6 * 2887336: [CaptureHandle][#2] Propagate CaptureHandleConfig in browser process https://chromium-review.googlesource.com/c/chromium/src/+/2887336 * refactor: base::Optional -> absl::optional * chore: fixup patch indices * chore: bump chromium in DEPS to 92.0.4514.0 * 2899417: Make build work when enable_pdf is set to false. https://chromium-review.googlesource.com/c/chromium/src/+/2899417 * 2904731: use BrowserContext instead of Profile in PreconnectManager https://chromium-review.googlesource.com/c/chromium/src/+/2904731 * 2295749: fix: check IsSecureEventInputEnabled in constructor before setting SetPasswordInputEnabled to true https://chromium-review.googlesource.com/c/chromium/src/+/2295749 * 2893803: Add a GetWebView to RenderFrame. https://chromium-review.googlesource.com/c/chromium/src/+/2893803 * 2892345: Implement WebContents::ForEachRenderFrameHost https://chromium-review.googlesource.com/c/chromium/src/+/2892345 * chore: fixup patch indices * 2892048: Real instance methods for BrowserContext: remaining 5 methods. https://chromium-review.googlesource.com/c/chromium/src/+/2892048 * 2902821: [mojo] Don't require full header includes for referenced interfaces https://chromium-review.googlesource.com/c/chromium/src/+/2902821 * 2496500: Remove last deprecated extension Event ctor. https://chromium-review.googlesource.com/c/chromium/src/+/2496500 * chore: fixup malformed pepper support patch * chore: bump chromium in DEPS to 92.0.4515.0 * 2908461: Add CreateEmptyPrintPagesParamsPtr() inside print_view_manager_base.cc. https://chromium-review.googlesource.com/c/chromium/src/+/2908461 * 2880838: viz: add optional HDRMetadata to TransferableResource https://chromium-review.googlesource.com/c/chromium/src/+/2880838 * chore: fixup patch indices * chore: bump chromium in DEPS to 92.0.4515.5 * chore: update patches * chore: bump chromium in DEPS to 92.0.4515.7 * chore: bump chromium in DEPS to 92.0.4515.9 * chore: bump chromium in DEPS to 93.0.4522.0 * chore: bump chromium in DEPS to 93.0.4523.0 * chore: bump chromium in DEPS to 93.0.4524.0 * chore: update patches * chore: enable_pak_file_integrity_checks was reverted * chore: update patches * refactor: base/optional was replaced with absl::optional Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2910202 * refactor: replace all usages of base::nullopt with absl::nullopt Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2910202 * chore: add missing base::Contains include Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2910202 * refactor: replace all usages of base::make_optional with absl::make_optional Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2910202 * refactor: replace WorldScriptContext() with GetScriptContextFromWorldId Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2893213 * chore: clean up left over opening namespace Refs: https://github.com/electron/electron/commit/95bfe6d08f65471394fb3005dbfa177cdf71210a * chore: add missing base::Contains include Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2910202 * refactor: replace GetCurrentDisplayIterator with the hard checker GetCurrentDisplay This code looks suspicious but if the iterator was invalid before it will also be invalid now. Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2893191 * refactor: headers are now passed directly in extensions client Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2918906 * refactor: base::DictionaryValue::empty() has been removed Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2912424 * chore: add missing includes for network URLLoaderFactory Refs: unknown, probably a side effect of header changes * refactor: make convenience wrapper around AppendArg There is no converter FromV8 for base::StringPiece (apparently its not possible). So we now take in an std::string and use the construct for StringPiece to do implicit conversion. Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2905544 * chore: add patch * chore: bump chromium in DEPS to 93.0.4525.0 * chore: update patches * refactor: CanResize has been de-virtualized Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2485774 * chore: update resource integrity patch * chore: add character encoding idl patch * chore: bump chromium in DEPS to 93.0.4526.0 * chore: update patches * chore: bump chromium in DEPS to 93.0.4527.0 * chore: bump chromium in DEPS to 93.0.4528.0 * chore: update patches * chore: update idl encoding patch * chore: bump chromium in DEPS to 93.0.4529.0 * chore: update patches * chore: bump chromium in DEPS to 93.0.4530.0 * chore: update patches * fix: only SetCanResize after the widget has been initialized * chore: add patch for vr on windows gn gen * spec: fix focus related tests on linux due to delay in focus swap * chore: remove new usages of base::Optional from main Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Co-authored-by: Samuel Attard <sattard@slack-corp.com> Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-06-03 11:05:04 +03:00
bool Browser::SetBadgeCount(absl::optional<int> count) {
DockSetBadgeText(!count.has_value() || count.value() != 0
? badging::BadgeManager::GetBadgeString(count)
: "");
if (count.has_value()) {
badge_count_ = count.value();
} else {
badge_count_ = 0;
}
return true;
2016-07-01 11:39:01 +03:00
}
2016-05-23 18:49:46 +03:00
void Browser::SetUserActivity(const std::string& type,
base::Value::Dict user_info,
2020-07-29 02:43:43 +03:00
gin::Arguments* args) {
2016-05-23 18:49:46 +03:00
std::string url_string;
args->GetNext(&url_string);
[[AtomApplication sharedApplication]
setCurrentActivity:base::SysUTF8ToNSString(type)
withUserInfo:DictionaryValueToNSDictionary(std::move(user_info))
2016-05-23 18:49:46 +03:00
withWebpageURL:net::NSURLWithGURL(GURL(url_string))];
}
std::string Browser::GetCurrentActivityType() {
NSUserActivity* userActivity =
[[AtomApplication sharedApplication] getCurrentActivity];
return base::SysNSStringToUTF8(userActivity.activityType);
}
void Browser::InvalidateCurrentActivity() {
[[AtomApplication sharedApplication] invalidateCurrentActivity];
}
void Browser::ResignCurrentActivity() {
[[AtomApplication sharedApplication] resignCurrentActivity];
}
void Browser::UpdateCurrentActivity(const std::string& type,
base::Value::Dict user_info) {
[[AtomApplication sharedApplication]
updateCurrentActivity:base::SysUTF8ToNSString(type)
withUserInfo:DictionaryValueToNSDictionary(
std::move(user_info))];
}
bool Browser::WillContinueUserActivity(const std::string& type) {
bool prevent_default = false;
2017-09-14 10:12:34 +03:00
for (BrowserObserver& observer : observers_)
observer.OnWillContinueUserActivity(&prevent_default, type);
return prevent_default;
}
2017-09-14 10:12:34 +03:00
void Browser::DidFailToContinueUserActivity(const std::string& type,
const std::string& error) {
for (BrowserObserver& observer : observers_)
observer.OnDidFailToContinueUserActivity(type, error);
}
2016-05-23 18:49:46 +03:00
bool Browser::ContinueUserActivity(const std::string& type,
base::Value::Dict user_info,
base::Value::Dict details) {
bool prevent_default = false;
2017-01-24 06:34:39 +03:00
for (BrowserObserver& observer : observers_)
observer.OnContinueUserActivity(&prevent_default, type, user_info.Clone(),
details.Clone());
return prevent_default;
}
2017-09-14 10:12:34 +03:00
void Browser::UserActivityWasContinued(const std::string& type,
base::Value::Dict user_info) {
for (BrowserObserver& observer : observers_)
observer.OnUserActivityWasContinued(type, user_info.Clone());
}
bool Browser::UpdateUserActivityState(const std::string& type,
base::Value::Dict user_info) {
bool prevent_default = false;
for (BrowserObserver& observer : observers_)
observer.OnUpdateUserActivityState(&prevent_default, type,
user_info.Clone());
return prevent_default;
}
// Modified from chrome/browser/ui/cocoa/l10n_util.mm.
void Browser::ApplyForcedRTL() {
NSUserDefaults* defaults = NSUserDefaults.standardUserDefaults;
auto dir = base::i18n::GetForcedTextDirection();
// An Electron app should respect RTL behavior of application locale over
// system locale.
auto should_be_rtl = dir == base::i18n::RIGHT_TO_LEFT || IsAppRTL();
auto should_be_ltr = dir == base::i18n::LEFT_TO_RIGHT || !IsAppRTL();
// -registerDefaults: won't do the trick here because these defaults exist
// (in the global domain) to reflect the system locale. They need to be set
// in Chrome's domain to supersede the system value.
if (should_be_rtl) {
[defaults setBool:YES forKey:@"AppleTextDirection"];
[defaults setBool:YES forKey:@"NSForceRightToLeftWritingDirection"];
} else if (should_be_ltr) {
[defaults setBool:YES forKey:@"AppleTextDirection"];
[defaults setBool:NO forKey:@"NSForceRightToLeftWritingDirection"];
} else {
[defaults removeObjectForKey:@"AppleTextDirection"];
[defaults removeObjectForKey:@"NSForceRightToLeftWritingDirection"];
}
}
Browser::LoginItemSettings Browser::GetLoginItemSettings(
2017-03-29 22:29:52 +03:00
const LoginItemSettings& options) {
2016-07-08 02:29:09 +03:00
LoginItemSettings settings;
#if IS_MAS_BUILD()
settings.open_at_login = platform_util::GetLoginItemEnabled();
#else
chore: bump chromium to 110.0.5415.0 (main) (#36186) * chore: bump chromium in DEPS to 109.0.5386.0 * chore: bump chromium in DEPS to 109.0.5388.0 * chore: bump chromium in DEPS to 109.0.5390.0 * chore: bump chromium in DEPS to 109.0.5392.0 * chore: bump chromium in DEPS to 109.0.5394.0 * chore: bump chromium in DEPS to 109.0.5396.0 * chore: bump chromium in DEPS to 109.0.5398.0 * chore: bump chromium in DEPS to 109.0.5400.0 * chore: update galactus * chore: bump chromium in DEPS to 109.0.5402.0 * chore: bump chromium in DEPS to 109.0.5403.0 * chore: bump chromium in DEPS to 109.0.5406.0 * chore: update patches * 4004247: Delete unused DocumentWebContentsDelegate Ref: https://chromium-review.googlesource.com/c/chromium/src/+/4004247 * chore: bump chromium in DEPS to 109.0.5408.1 * chore: update patches * 3949284: Support pkey debug mode without pkey 0 access Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3949284 * chore: bump chromium in DEPS to 109.0.5410.0 * chore: update patches * 4000944: [Extensions] Create an API directory in //chrome/renderer/extensions Ref: https://chromium-review.googlesource.com/c/chromium/src/+/4000944 * 3988524: Remove DocumentOverlayWindowViews | https://chromium-review.googlesource.com/c/chromium/src/+/3988524 Co-authored-by: George Xu <33054982+georgexu99@users.noreply.github.com> * chore: bump chromium in DEPS to 109.0.5412.0 * chore: update patches * 3984022: Add AddChildWindowToBrowser to DisplayClient mojo interface Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3984022 * 3957079: Delete the CryptoToken component extension and internal API Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3957079 * 4004421: Migreate ScopedAllowIO to ScopedAllowBlocking Ref: https://chromium-review.googlesource.com/c/chromium/src/+/4004421 Co-authored-by: George Xu <georgexu99@users.noreply.github.com> * chore: bump chromium in DEPS to 109.0.5414.0 * chore: update patches * 4016180: Split PPAPI Mojo interfaces out of RenderFrameHostImpl. Ref: https://chromium-review.googlesource.com/c/chromium/src/+/4016180 * 3970838: [MPArch] Convert HostZoomMap and ZoomController off of RenderViewHost ids Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3970838 * 3997795: Don't add Chromium as a login item Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3997795 * 3993482: Remove RefCountedString::TakeString Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3993482 * 3990749: Allow forward-declared sources in base::ScopedObservation<> Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3990749 * fixup! 3957079: Delete the CryptoToken component extension and internal API * chore: bump chromium in DEPS to 110.0.5415.0 * 3883790: Move devtools_frame_token to the RenderFrameHost, to preserve RFH identity across MPArch activations. https://chromium-review.googlesource.com/c/chromium/src/+/3883790 * 4022205: Move license tooling into //tools/licenses https://chromium-review.googlesource.com/c/chromium/src/+/4022205 * chore: fixup patch indices * fixup! 3957079: Delete the CryptoToken component extension and internal API * 4008687: Finish ScopedAllowIO migration https://chromium-review.googlesource.com/c/chromium/src/+/4008687 * 3991548: Move WindowButtonOrderObserver and WindowFrameAction to LinuxUi https://chromium-review.googlesource.com/c/chromium/src/+/3991548 * fixup! 3984022: Add AddChildWindowToBrowser to DisplayClient mojo interface * 4016595: Migrate non-default ScopedObservation<> instantiations to ScopedObservationTraits<> in chrome/browser/ https://chromium-review.googlesource.com/c/chromium/src/+/4016595 * 4000481: Rename :chromedriver to :chromedriver_server Ref: https://chromium-review.googlesource.com/c/chromium/src/+/4000481 * 4008687: Finish ScopedAllowIO migration https://chromium-review.googlesource.com/c/chromium/src/+/4008687 * 3988524: Remove DocumentOverlayWindowViews https://chromium-review.googlesource.com/c/chromium/src/+/3988524 * fixup! 3997795: Don't add Chromium as a login item * chore: fixup patches * 3996872: Plumb input event task runner to EventFactoryEvdev https://chromium-review.googlesource.com/c/chromium/src/+/3996872 * 4014994: Enable SiteIsolationForGuests by default. https://chromium-review.googlesource.com/c/chromium/src/+/4014994 * chore: adopt new thread restrictions api for //electron (#36357) chore: add thread blocking api * fixup! 4014994: Enable SiteIsolationForGuests by default. * pull parent HWND for dialogs on ui thread * chore: set parent_window in MessageBoxSettings * chore: remove redundant patch * chore: revert accidental deletion * chore: update patches Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Samuel Attard <sattard@salesforce.com> Co-authored-by: Keeley Hammond <khammond@slack-corp.com> Co-authored-by: VerteDinde <vertedinde@electronjs.org> Co-authored-by: George Xu <33054982+georgexu99@users.noreply.github.com> Co-authored-by: George Xu <georgexu99@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> Co-authored-by: Robo <hop2deep@gmail.com> Co-authored-by: Jeremy Rose <jeremya@chromium.org> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-11-17 22:59:23 +03:00
settings.open_at_login = CheckLoginItemStatus(&settings.open_as_hidden);
2016-07-08 02:29:09 +03:00
settings.restore_state = base::mac::WasLaunchedAsLoginItemRestoreState();
settings.opened_at_login = base::mac::WasLaunchedAsLoginOrResumeItem();
settings.opened_as_hidden = base::mac::WasLaunchedAsHiddenLoginItem();
#endif
2016-07-08 02:29:09 +03:00
return settings;
}
void Browser::SetLoginItemSettings(LoginItemSettings settings) {
#if IS_MAS_BUILD()
if (!platform_util::SetLoginItemEnabled(settings.open_at_login)) {
LOG(ERROR) << "Unable to set login item enabled on sandboxed app.";
}
#else
if (settings.open_at_login) {
chore: bump chromium to 115.0.5786.0 (main) (#38301) * chore: bump chromium in DEPS to 115.0.5772.0 * chore: update disable_color_correct_rendering.patch no manual changes; patch succeeded with fuzz 2. * chore: update chromium/build_libc_as_static_library.patch no manual changes; patch succeeded with fuzz 2 (offset 1 line). * chore: update chromium/feat_configure_launch_options_for_service_process.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4518747 patch manually reapplied due to upstream code shear * chore: update chromium/chore_patch_out_profile_methods_in_profile_selections_cc.patch https://chromium-review.googlesource.com/c/chromium/src/+/4502965 patch manually reapplied due to upstream code shear * chore: update bundle_locations #include location Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4525355 * chore: Remove `extension_name` from DesktopStreamsRegistry Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4514081 * chore: bump chromium in DEPS to 115.0.5778.0 * chore: add chromium/chore_patch_out_profile_methods_in_chrome_browser_pdf.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4482679 Another instance of patching out upstream references to Profile code * refactor: add WebViewGuestDelegate::GetGuestDelegateWeakPtr() Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4515455 This approach copied from GuestViewBase::GetGuestDelegateWeakPtr() approach in that same commit. * fixup! chore: update bundle_locations #include location Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4525355 Sync namespace use to upstream base::mac -> base::apple changes * fixup! chore: update bundle_locations #include location Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4525355 Sync namespace use to upstream base::mac -> base::apple changes * chore: update chromium/mas_disable_remote_accessibility.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4530546 patch manually reapplied due to upstream code shear * chore: update chromium/printing.patch no manual changes; patch succeeded with fuzz * chore: update chromium/build_add_electron_tracing_category.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4517872 no manual changes; patch succeeded with fuzz * chore: update chromium/feat_ensure_mas_builds_of_the_same_application_can_use_safestorage.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4529098 patch manually reapplied due to upstream code shear * chromium/build_only_use_the_mas_build_config_in_the_required_components.patch https://chromium-review.googlesource.com/c/chromium/src/+/4529098 patch manually reapplied due to upstream code shear * chore: update chromium/mas-cgdisplayusesforcetogray.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4529475 no manual changes; patch succeeded with fuzz * chore: update chromium/build_only_use_the_mas_build_config_in_the_required_components.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4429011 no manual changes; patch succeeded with fuzz * chore: remove chromium/cherry-pick-48a136e77e6d.patch already present upstream * chore: remove chromium/cherry-pick-e6e23ba00379.patch already present upstream * [Code Health] Remove value based RegisterPref for Dict and List Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4533537 * Remove `cxx17_backports.h` and adjust unittest file Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4534916 Notes: mostly just removing #include and s/base::clamp/std::clamp/ * refactor: add FakeBrowserProcess helper class Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4424072 Used in ElectronBrowserMainParts' fake_browser_process_ field. Previously this was an BrowserProcessImpl instance, but upstream 4424072 makes that an abstract base class. `FakeBrowserProcess` is a thin subclass with the minimum code needed to make it concrete. `ElectronBrowserMainParts::fake_browser_process_` is now a `shared_ptr` instead of a `unique_ptr` so we can avoid exposing `FakeBrowserProcess` in the header. * fixup! refactor: add FakeBrowserProcess helper class remove unnecessary unique_ptr * fix: Browser::SetDockIcon() when !Browser.is_ready() Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4410741 An alternative fix for https://github.com/electron/electron/pull/36279 . The previous fix was to call `SetSupportedScales()` ourselves (1b1609a), but upstream has removed this API. CC @codebytere * fixup! chore: remove chromium/cherry-pick-e6e23ba00379.patch * chore: update chromium/export_gin_v8platform_pageallocator_for_usage_outside_of_the_gin.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4517404 patch manually reapplied due to upstream code shear * chore: update patches * chore: add dep: resource_coordinator:mojo_bindings Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4521464 * fixup! chore: add dep: resource_coordinator:mojo_bindings chore: make lint happy * chore: patch out Profile methods in titlebar_config Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4508143 (primary) Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4534461 (followup) * chore: bump chromium in DEPS to 115.0.5780.0 * chore: update chromium/disable_hidden.patch no manual changes; patch succeeded with fuzz * chore: update chromium/sysroot.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4535715 no manual changes; patch succeeded with fuzz * chore: update chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4403623 patch manually reapplied due to upstream code shear * chore: update chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4547380 patch manually reapplied due to upstream code shear * chore: update patches * fixup! fix: Browser::SetDockIcon() when !Browser.is_ready() chore: iwyu image.h * chore: bump chromium in DEPS to 115.0.5782.0 * chore: bump chromium in DEPS to 115.0.5784.0 * 4514181: CR2023: Update filled cr-input styles. https://chromium-review.googlesource.com/c/chromium/src/+/4514181 * 4521894: Remove SiteInstanceDeleting usage outside of tests. https://chromium-review.googlesource.com/c/chromium/src/+/4521894 * 4525355: Move backup_util and bundle_locations to base/apple https://chromium-review.googlesource.com/c/chromium/src/+/4525355 * 4484743: webauthn: add underlying support for calling iCloud Keychain on macOS. https://chromium-review.googlesource.com/c/chromium/src/+/4484743 * chore: fixup patch indices * 4546398: Convert /chrome/browser to use ARC https://chromium-review.googlesource.com/c/chromium/src/+/4546398 * chore: bump chromium in DEPS to 115.0.5786.0 * chore: update patches * 4540682: Initialize PDF SDK with policy in chrome_pdf::RenderPDFPageToDC() https://chromium-review.googlesource.com/c/chromium/src/+/4540682 * Don't import ObjC++ fn headers into electron_api_app * 4535715: Refactor sysroot-creator.sh https://chromium-review.googlesource.com/c/chromium/src/+/4535715 * fixup! refactor: add FakeBrowserProcess helper class * 4531903: [string][test] Create/Copy strings to old space before externalization https://chromium-review.googlesource.com/c/v8/v8/+/4531903 * 59645: Add APIs to support RSA keys with large e. https://boringssl-review.googlesource.com/c/boringssl/+/59645 --------- Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-05-23 22:58:58 +03:00
base::mac::AddToLoginItems(base::apple::MainBundlePath(),
chore: bump chromium to 110.0.5415.0 (main) (#36186) * chore: bump chromium in DEPS to 109.0.5386.0 * chore: bump chromium in DEPS to 109.0.5388.0 * chore: bump chromium in DEPS to 109.0.5390.0 * chore: bump chromium in DEPS to 109.0.5392.0 * chore: bump chromium in DEPS to 109.0.5394.0 * chore: bump chromium in DEPS to 109.0.5396.0 * chore: bump chromium in DEPS to 109.0.5398.0 * chore: bump chromium in DEPS to 109.0.5400.0 * chore: update galactus * chore: bump chromium in DEPS to 109.0.5402.0 * chore: bump chromium in DEPS to 109.0.5403.0 * chore: bump chromium in DEPS to 109.0.5406.0 * chore: update patches * 4004247: Delete unused DocumentWebContentsDelegate Ref: https://chromium-review.googlesource.com/c/chromium/src/+/4004247 * chore: bump chromium in DEPS to 109.0.5408.1 * chore: update patches * 3949284: Support pkey debug mode without pkey 0 access Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3949284 * chore: bump chromium in DEPS to 109.0.5410.0 * chore: update patches * 4000944: [Extensions] Create an API directory in //chrome/renderer/extensions Ref: https://chromium-review.googlesource.com/c/chromium/src/+/4000944 * 3988524: Remove DocumentOverlayWindowViews | https://chromium-review.googlesource.com/c/chromium/src/+/3988524 Co-authored-by: George Xu <33054982+georgexu99@users.noreply.github.com> * chore: bump chromium in DEPS to 109.0.5412.0 * chore: update patches * 3984022: Add AddChildWindowToBrowser to DisplayClient mojo interface Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3984022 * 3957079: Delete the CryptoToken component extension and internal API Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3957079 * 4004421: Migreate ScopedAllowIO to ScopedAllowBlocking Ref: https://chromium-review.googlesource.com/c/chromium/src/+/4004421 Co-authored-by: George Xu <georgexu99@users.noreply.github.com> * chore: bump chromium in DEPS to 109.0.5414.0 * chore: update patches * 4016180: Split PPAPI Mojo interfaces out of RenderFrameHostImpl. Ref: https://chromium-review.googlesource.com/c/chromium/src/+/4016180 * 3970838: [MPArch] Convert HostZoomMap and ZoomController off of RenderViewHost ids Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3970838 * 3997795: Don't add Chromium as a login item Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3997795 * 3993482: Remove RefCountedString::TakeString Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3993482 * 3990749: Allow forward-declared sources in base::ScopedObservation<> Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3990749 * fixup! 3957079: Delete the CryptoToken component extension and internal API * chore: bump chromium in DEPS to 110.0.5415.0 * 3883790: Move devtools_frame_token to the RenderFrameHost, to preserve RFH identity across MPArch activations. https://chromium-review.googlesource.com/c/chromium/src/+/3883790 * 4022205: Move license tooling into //tools/licenses https://chromium-review.googlesource.com/c/chromium/src/+/4022205 * chore: fixup patch indices * fixup! 3957079: Delete the CryptoToken component extension and internal API * 4008687: Finish ScopedAllowIO migration https://chromium-review.googlesource.com/c/chromium/src/+/4008687 * 3991548: Move WindowButtonOrderObserver and WindowFrameAction to LinuxUi https://chromium-review.googlesource.com/c/chromium/src/+/3991548 * fixup! 3984022: Add AddChildWindowToBrowser to DisplayClient mojo interface * 4016595: Migrate non-default ScopedObservation<> instantiations to ScopedObservationTraits<> in chrome/browser/ https://chromium-review.googlesource.com/c/chromium/src/+/4016595 * 4000481: Rename :chromedriver to :chromedriver_server Ref: https://chromium-review.googlesource.com/c/chromium/src/+/4000481 * 4008687: Finish ScopedAllowIO migration https://chromium-review.googlesource.com/c/chromium/src/+/4008687 * 3988524: Remove DocumentOverlayWindowViews https://chromium-review.googlesource.com/c/chromium/src/+/3988524 * fixup! 3997795: Don't add Chromium as a login item * chore: fixup patches * 3996872: Plumb input event task runner to EventFactoryEvdev https://chromium-review.googlesource.com/c/chromium/src/+/3996872 * 4014994: Enable SiteIsolationForGuests by default. https://chromium-review.googlesource.com/c/chromium/src/+/4014994 * chore: adopt new thread restrictions api for //electron (#36357) chore: add thread blocking api * fixup! 4014994: Enable SiteIsolationForGuests by default. * pull parent HWND for dialogs on ui thread * chore: set parent_window in MessageBoxSettings * chore: remove redundant patch * chore: revert accidental deletion * chore: update patches Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Samuel Attard <sattard@salesforce.com> Co-authored-by: Keeley Hammond <khammond@slack-corp.com> Co-authored-by: VerteDinde <vertedinde@electronjs.org> Co-authored-by: George Xu <33054982+georgexu99@users.noreply.github.com> Co-authored-by: George Xu <georgexu99@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> Co-authored-by: Robo <hop2deep@gmail.com> Co-authored-by: Jeremy Rose <jeremya@chromium.org> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-11-17 22:59:23 +03:00
settings.open_as_hidden);
} else {
chore: bump chromium to 115.0.5786.0 (main) (#38301) * chore: bump chromium in DEPS to 115.0.5772.0 * chore: update disable_color_correct_rendering.patch no manual changes; patch succeeded with fuzz 2. * chore: update chromium/build_libc_as_static_library.patch no manual changes; patch succeeded with fuzz 2 (offset 1 line). * chore: update chromium/feat_configure_launch_options_for_service_process.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4518747 patch manually reapplied due to upstream code shear * chore: update chromium/chore_patch_out_profile_methods_in_profile_selections_cc.patch https://chromium-review.googlesource.com/c/chromium/src/+/4502965 patch manually reapplied due to upstream code shear * chore: update bundle_locations #include location Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4525355 * chore: Remove `extension_name` from DesktopStreamsRegistry Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4514081 * chore: bump chromium in DEPS to 115.0.5778.0 * chore: add chromium/chore_patch_out_profile_methods_in_chrome_browser_pdf.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4482679 Another instance of patching out upstream references to Profile code * refactor: add WebViewGuestDelegate::GetGuestDelegateWeakPtr() Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4515455 This approach copied from GuestViewBase::GetGuestDelegateWeakPtr() approach in that same commit. * fixup! chore: update bundle_locations #include location Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4525355 Sync namespace use to upstream base::mac -> base::apple changes * fixup! chore: update bundle_locations #include location Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4525355 Sync namespace use to upstream base::mac -> base::apple changes * chore: update chromium/mas_disable_remote_accessibility.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4530546 patch manually reapplied due to upstream code shear * chore: update chromium/printing.patch no manual changes; patch succeeded with fuzz * chore: update chromium/build_add_electron_tracing_category.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4517872 no manual changes; patch succeeded with fuzz * chore: update chromium/feat_ensure_mas_builds_of_the_same_application_can_use_safestorage.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4529098 patch manually reapplied due to upstream code shear * chromium/build_only_use_the_mas_build_config_in_the_required_components.patch https://chromium-review.googlesource.com/c/chromium/src/+/4529098 patch manually reapplied due to upstream code shear * chore: update chromium/mas-cgdisplayusesforcetogray.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4529475 no manual changes; patch succeeded with fuzz * chore: update chromium/build_only_use_the_mas_build_config_in_the_required_components.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4429011 no manual changes; patch succeeded with fuzz * chore: remove chromium/cherry-pick-48a136e77e6d.patch already present upstream * chore: remove chromium/cherry-pick-e6e23ba00379.patch already present upstream * [Code Health] Remove value based RegisterPref for Dict and List Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4533537 * Remove `cxx17_backports.h` and adjust unittest file Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4534916 Notes: mostly just removing #include and s/base::clamp/std::clamp/ * refactor: add FakeBrowserProcess helper class Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4424072 Used in ElectronBrowserMainParts' fake_browser_process_ field. Previously this was an BrowserProcessImpl instance, but upstream 4424072 makes that an abstract base class. `FakeBrowserProcess` is a thin subclass with the minimum code needed to make it concrete. `ElectronBrowserMainParts::fake_browser_process_` is now a `shared_ptr` instead of a `unique_ptr` so we can avoid exposing `FakeBrowserProcess` in the header. * fixup! refactor: add FakeBrowserProcess helper class remove unnecessary unique_ptr * fix: Browser::SetDockIcon() when !Browser.is_ready() Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4410741 An alternative fix for https://github.com/electron/electron/pull/36279 . The previous fix was to call `SetSupportedScales()` ourselves (1b1609a), but upstream has removed this API. CC @codebytere * fixup! chore: remove chromium/cherry-pick-e6e23ba00379.patch * chore: update chromium/export_gin_v8platform_pageallocator_for_usage_outside_of_the_gin.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4517404 patch manually reapplied due to upstream code shear * chore: update patches * chore: add dep: resource_coordinator:mojo_bindings Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4521464 * fixup! chore: add dep: resource_coordinator:mojo_bindings chore: make lint happy * chore: patch out Profile methods in titlebar_config Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4508143 (primary) Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4534461 (followup) * chore: bump chromium in DEPS to 115.0.5780.0 * chore: update chromium/disable_hidden.patch no manual changes; patch succeeded with fuzz * chore: update chromium/sysroot.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4535715 no manual changes; patch succeeded with fuzz * chore: update chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4403623 patch manually reapplied due to upstream code shear * chore: update chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4547380 patch manually reapplied due to upstream code shear * chore: update patches * fixup! fix: Browser::SetDockIcon() when !Browser.is_ready() chore: iwyu image.h * chore: bump chromium in DEPS to 115.0.5782.0 * chore: bump chromium in DEPS to 115.0.5784.0 * 4514181: CR2023: Update filled cr-input styles. https://chromium-review.googlesource.com/c/chromium/src/+/4514181 * 4521894: Remove SiteInstanceDeleting usage outside of tests. https://chromium-review.googlesource.com/c/chromium/src/+/4521894 * 4525355: Move backup_util and bundle_locations to base/apple https://chromium-review.googlesource.com/c/chromium/src/+/4525355 * 4484743: webauthn: add underlying support for calling iCloud Keychain on macOS. https://chromium-review.googlesource.com/c/chromium/src/+/4484743 * chore: fixup patch indices * 4546398: Convert /chrome/browser to use ARC https://chromium-review.googlesource.com/c/chromium/src/+/4546398 * chore: bump chromium in DEPS to 115.0.5786.0 * chore: update patches * 4540682: Initialize PDF SDK with policy in chrome_pdf::RenderPDFPageToDC() https://chromium-review.googlesource.com/c/chromium/src/+/4540682 * Don't import ObjC++ fn headers into electron_api_app * 4535715: Refactor sysroot-creator.sh https://chromium-review.googlesource.com/c/chromium/src/+/4535715 * fixup! refactor: add FakeBrowserProcess helper class * 4531903: [string][test] Create/Copy strings to old space before externalization https://chromium-review.googlesource.com/c/v8/v8/+/4531903 * 59645: Add APIs to support RSA keys with large e. https://boringssl-review.googlesource.com/c/boringssl/+/59645 --------- Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-05-23 22:58:58 +03:00
base::mac::RemoveFromLoginItems(base::apple::MainBundlePath());
}
#endif
}
2013-12-05 06:26:01 +04:00
std::string Browser::GetExecutableFileVersion() const {
2018-10-24 13:49:10 +03:00
return GetApplicationVersion();
}
std::string Browser::GetExecutableFileProductName() const {
2018-10-24 13:49:10 +03:00
return GetApplicationName();
}
2013-08-06 12:19:56 +04:00
int Browser::DockBounce(BounceType type) {
return [[AtomApplication sharedApplication]
requestUserAttention:static_cast<NSRequestUserAttentionType>(type)];
2013-08-06 12:19:56 +04:00
}
void Browser::DockCancelBounce(int request_id) {
[[AtomApplication sharedApplication] cancelUserAttentionRequest:request_id];
2013-08-06 12:19:56 +04:00
}
void Browser::DockSetBadgeText(const std::string& label) {
NSDockTile* tile = [[AtomApplication sharedApplication] dockTile];
2013-08-06 12:19:56 +04:00
[tile setBadgeLabel:base::SysUTF8ToNSString(label)];
}
void Browser::DockDownloadFinished(const std::string& filePath) {
[[NSDistributedNotificationCenter defaultCenter]
2018-04-20 21:47:04 +03:00
postNotificationName:@"com.apple.DownloadFileFinished"
object:base::SysUTF8ToNSString(filePath)];
}
2013-08-06 12:39:31 +04:00
std::string Browser::DockGetBadgeText() {
NSDockTile* tile = [[AtomApplication sharedApplication] dockTile];
2013-08-06 12:39:31 +04:00
return base::SysNSStringToUTF8([tile badgeLabel]);
}
void Browser::DockHide() {
// Transforming application state from UIElement to Foreground is an
2022-02-21 12:27:45 +03:00
// asynchronous operation, and unfortunately there is currently no way to know
// when it is finished.
// So if we call DockHide => DockShow => DockHide => DockShow in a very short
2022-02-21 12:27:45 +03:00
// time, we would trigger a bug of macOS that, there would be multiple dock
// icons of the app left in system.
// To work around this, we make sure DockHide does nothing if it is called
// immediately after DockShow. After some experiments, 1 second seems to be
// a proper interval.
if (!last_dock_show_.is_null() &&
chore: bump chromium to 98.0.4706.0 (main) (#31555) * chore: bump chromium in DEPS to 97.0.4678.0 * chore: bump chromium in DEPS to 97.0.4679.0 * chore: bump chromium in DEPS to 97.0.4680.0 * chore: bump chromium in DEPS to 97.0.4681.0 * chore: bump chromium in DEPS to 97.0.4682.0 * chore: update patches * 3234737: Disable -Wunused-but-set-variable Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3234737 * 3216953: Reland "Move task-related files from base/ to base/task/" Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3216953 * 3202710: TimeDelta factory function migration. Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3202710 * 3226841: Rename WCO::RenderProcessGone to PrimaryMainFrameRenderProcessGone Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3226841 * 3212165: blink/gin: changes blink to load snapshot based on runtime information Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3212165 * 3220292: Deprecate returning a GURL from GURL::GetOrigin() Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3220292 * 3231995: build: Enable -Wbitwise-instead-of-logical everywhere except iOS and Windows Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3231995 * 3205121: Remove base::DictionaryValue::GetDouble Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3205121 * 3208413: [flags] Make --js-flags settings have priority over V8 features Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3208413 * chore: bump chromium in DEPS to 97.0.4683.0 * chore: update patches * 3188834: Combine RWHVBase GetCurrentDeviceScaleFactor/GetDeviceScaleFactor Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3188834 * chore: update process_singleton patches * chore: bump chromium in DEPS to 97.0.4684.0 * chore: update patches * chore: bump chromium in DEPS to 97.0.4685.0 * chore: update patches * chore: bump chromium in DEPS to 97.0.4686.0 * chore: update patches * chore: bump chromium in DEPS to 97.0.4687.0 * chore: update patches * chore: bump chromium in DEPS to 97.0.4688.0 * chore: update patches * 3247722: Use correct source_site_instance if navigating via context menu Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3247722 Update signature of HandleContextMenu() * 3247722: Use correct source_site_instance if navigating via context menu Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3247722 Update signature of HandleContextMenu() * 3223422: Remove PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_PLUGINPRIVATE enum option Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3223422 sync pepper_plugin_support.patch with upstream * chore: bump chromium in DEPS to 97.0.4689.0 * 3247791: ax_mac_merge: Merge AX Math attribute implementations Xref: ax_mac_merge: Merge AX Math attribute implementations chore: fix minor patch shear in #includes * 3243425: Add VisibleTimeRequestTrigger helper class Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3243425 chore: fix minor patch shear in #includes * chore: regen chromium patches * fixup! 3247722: Use correct source_site_instance if navigating via context menu * chore: bump chromium in DEPS to 97.0.4690.0 * 3188659: Window Placement: make GetScreenInfo(s) const Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3188659 simple sync GetScreenInfo with upstream refactor * chore: update patches * chore: bump chromium in DEPS to 97.0.4690.4 * chore: bump chromium in DEPS to 97.0.4692.0 * 3198073: ozone: //content: clean up from USE_X11 Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3198073 Fixing patch shear. Nothing to see here. * 3252338: Remove label images checkbox from chrome://accessibility page Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3252338 Part of our a11y patch is no longer needed due to upstream label removal * 3258183: Remove DISALLOW_IMPLICIT_CONSTRUCTORS() definition Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3258183 Replace our use of the macro with explicitly-deleted class methods. See https://chromium-review.googlesource.com/c/chromium/src/+/3256952 for upstream examples of this same replacement. * chore: update patches * 3247295: Unwind SecurityStyleExplanations Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3247295 update GetSecurityStyle() signature and impl to match upstream changes * 3259578: media: grabs lock to ensure video output when occluded Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3259578 Add stub for new upstream virtual method OnCapturerCountChanged() * fixup! 3247295: Unwind SecurityStyleExplanations * 3238504: Fix up drag image is not shown from bookmark bar Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3238504 SetDragImage() no longer takes a widget argument * 3217452: [devtools] Add getSyncInformation host binding Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3217452 Add stub for new upstream method GetSyncInformation(). Stub sends info back to caller saying that syncing is disabled. * chore: bump chromium in DEPS to 98.0.4693.0 * chore: bump chromium in DEPS to 98.0.4694.0 * chore: bump chromium in DEPS to 98.0.4695.0 * chore: bump chromium in DEPS to 98.0.4696.0 * chore: bump chromium in DEPS to 98.0.4697.0 * chore: bump chromium in DEPS to 98.0.4699.0 * chore: bump chromium in DEPS to 98.0.4701.0 * chore: bump chromium in DEPS to 98.0.4703.0 * chore: bump chromium in DEPS to 98.0.4705.0 * chore: bump chromium in DEPS to 98.0.4706.0 * chore: update patches * 3279210: Rename "base/macros.h" => "base/ignore_result.h" https://chromium-review.googlesource.com/c/chromium/src/+/3279210 * 3259964: Remove all DISALLOW_COPY_AND_ASSIGNs https://chromium-review.googlesource.com/c/chromium/src/+/3259964 * 3269029: blink/gin: sets histogram callbacks during isolate creation https://chromium-review.googlesource.com/c/chromium/src/+/3269029 * fixup after rebase * [content] Make ContentMainParams and MainFunctionParams move-only https://chromium-review.googlesource.com/c/chromium/src/+/3244976 * 3255305: Stop sending the securityStateChanged event and unwind https://chromium-review.googlesource.com/c/chromium/src/+/3255305 * [Blink] Add promise support to WebLocalFrame::RequestExecuteScript() https://chromium-review.googlesource.com/c/chromium/src/+/3230010 * 3256162: Simplify RWHV Show and ShowWithVisibility handling https://chromium-review.googlesource.com/c/chromium/src/+/3256162 * 3263824: ozone: //ui/base: clean up from USE_X11 1/* https://chromium-review.googlesource.com/c/chromium/src/+/3263824 * Request or cancel RecordContentToPresentationTimeRequest during capture https://chromium-review.googlesource.com/c/chromium/src/+/3256802 * appcache: remove BrowsingData/quota references https://chromium-review.googlesource.com/c/chromium/src/+/3255725 * [Autofill] Don't show Autofill dropdown if overlaps with permissions https://chromium-review.googlesource.com/c/chromium/src/+/3236729 * Rename to_different_document to should_show_loading_ui in LoadingStateChanged() callbacks https://chromium-review.googlesource.com/c/chromium/src/+/3268574 * cleanup patch * fixup [content] Make ContentMainParams and MainFunctionParams move-only * 3279210: Rename "base/macros.h" => "base/ignore_result.h" https://chromium-review.googlesource.com/c/chromium/src/+/3279210 * ozone: //chrome/browser clean up from USE_X11 https://chromium-review.googlesource.com/c/chromium/src/+/3186490 Refs: https://github.com/electron/electron/issues/31382 * chore: update support_mixed_sandbox_with_zygote.patch * Enable -Wunused-but-set-variable. Refs https://chromium-review.googlesource.com/c/chromium/src/+/3234737 * fixup! ozone: //ui/base: clean up from USE_X11 1/* * fixup! ozone: //chrome/browser clean up from USE_X11 * chore: fix deprecation warning in libuv * chore: fixup for lint * 3251161: Reland "Make the Clang update.py script require Python 3" https://chromium-review.googlesource.com/c/chromium/src/+/3251161 * fixup: Enable -Wunused-but-set-variable. * [base][win] Rename DIR_APP_DATA to DIR_ROAMING_APP_DATA https://chromium-review.googlesource.com/c/chromium/src/+/3262369 * Replace sandbox::policy::SandboxType with mojom Sandbox enum https://chromium-review.googlesource.com/c/chromium/src/+/3213677 * fixup: [content] Make ContentMainParams and MainFunctionParams move-only * build: ensure angle has a full git checkout available to it * fixup: [base][win] Rename DIR_APP_DATA to DIR_ROAMING_APP_DATA * fixup lint * [unseasoned-pdf] Dispatch 'afterprint' event in PDF plugin frame https://chromium-review.googlesource.com/c/chromium/src/+/3223434 * fixup: [Autofill] Don't show Autofill dropdown if overlaps with permissions * 3217591: Move browser UI CSS color parsing to own file part 2/2 https://chromium-review.googlesource.com/c/chromium/src/+/3217591 * Make kNoSandboxAndElevatedPrivileges only available to utilities https://chromium-review.googlesource.com/c/chromium/src/+/3276784 * 3211575: [modules] Change ScriptOrModule to custom Struct https://chromium-review.googlesource.com/c/v8/v8/+/3211575 * Address review feedback * chore: update patches * 3211575: [modules] Change ScriptOrModule to custom Struct https://chromium-review.googlesource.com/c/v8/v8/+/3211575 * fix: unused variable compat * chore: remove redundant patch * fixup for 3262517: Re-enable WindowCaptureMacV2 https://chromium-review.googlesource.com/c/chromium/src/+/3262517 * chore: cleanup todo The functions added in https://chromium-review.googlesource.com/c/chromium/src/+/3256802 are not used by offscreen rendering. * fixup: update mas_no_private_api.patch * 3216879: [PA] Make features::kPartitionAllocLazyCommit to be PartitionOptions::LazyCommit Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3216879 Fixes up commit b2f1aca95604ec61649808c846657454097e6935 * chore: cleanup support_mixed_sandbox_with_zygote.patch * test: use window focus event instead of delay to wait for webContents focus Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: VerteDinde <khammond@slack-corp.com> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> Co-authored-by: deepak1556 <hop2deep@gmail.com> Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-11-24 11:45:59 +03:00
base::Time::Now() - last_dock_show_ < base::Seconds(1)) {
return;
}
for (auto* const& window : WindowList::GetWindows())
[window->GetNativeWindow().GetNativeNSWindow() setCanHide:NO];
2018-04-20 21:47:04 +03:00
ProcessSerialNumber psn = {0, kCurrentProcess};
TransformProcessType(&psn, kProcessTransformToUIElementApplication);
}
2016-08-02 01:22:37 +03:00
bool Browser::DockIsVisible() {
// Because DockShow has a slight delay this may not be true immediately
// after that call.
2018-04-20 21:47:04 +03:00
return ([[NSRunningApplication currentApplication] activationPolicy] ==
NSApplicationActivationPolicyRegular);
2016-08-02 01:22:37 +03:00
}
v8::Local<v8::Promise> Browser::DockShow(v8::Isolate* isolate) {
last_dock_show_ = base::Time::Now();
gin_helper::Promise<void> promise(isolate);
v8::Local<v8::Promise> handle = promise.GetHandle();
BOOL active = [[NSRunningApplication currentApplication] isActive];
2018-04-20 21:47:04 +03:00
ProcessSerialNumber psn = {0, kCurrentProcess};
if (active) {
2015-12-21 05:52:49 +03:00
// Workaround buggy behavior of TransformProcessType.
// http://stackoverflow.com/questions/7596643/
NSArray* runningApps = [NSRunningApplication
runningApplicationsWithBundleIdentifier:@"com.apple.dock"];
for (NSRunningApplication* app in runningApps) {
[app activateWithOptions:NSApplicationActivateIgnoringOtherApps];
break;
}
__block gin_helper::Promise<void> p = std::move(promise);
2015-12-21 05:52:49 +03:00
dispatch_time_t one_ms = dispatch_time(DISPATCH_TIME_NOW, USEC_PER_SEC);
dispatch_after(one_ms, dispatch_get_main_queue(), ^{
TransformProcessType(&psn, kProcessTransformToForegroundApplication);
dispatch_time_t one_ms_2 = dispatch_time(DISPATCH_TIME_NOW, USEC_PER_SEC);
dispatch_after(one_ms_2, dispatch_get_main_queue(), ^{
2015-12-21 05:52:49 +03:00
[[NSRunningApplication currentApplication]
activateWithOptions:NSApplicationActivateIgnoringOtherApps];
p.Resolve();
2015-12-21 05:52:49 +03:00
});
});
} else {
TransformProcessType(&psn, kProcessTransformToForegroundApplication);
promise.Resolve();
}
return handle;
}
void Browser::DockSetMenu(ElectronMenuModel* model) {
2018-04-20 21:47:04 +03:00
ElectronApplicationDelegate* delegate =
(ElectronApplicationDelegate*)[NSApp delegate];
2014-11-16 18:04:31 +03:00
[delegate setApplicationDockMenu:model];
}
void Browser::DockSetIcon(v8::Isolate* isolate, v8::Local<v8::Value> icon) {
gfx::Image image;
if (!icon->IsNull()) {
api::NativeImage* native_image = nullptr;
if (!api::NativeImage::TryConvertNativeImage(isolate, icon, &native_image))
return;
image = native_image->image();
}
chore: bump chromium to 115.0.5786.0 (main) (#38301) * chore: bump chromium in DEPS to 115.0.5772.0 * chore: update disable_color_correct_rendering.patch no manual changes; patch succeeded with fuzz 2. * chore: update chromium/build_libc_as_static_library.patch no manual changes; patch succeeded with fuzz 2 (offset 1 line). * chore: update chromium/feat_configure_launch_options_for_service_process.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4518747 patch manually reapplied due to upstream code shear * chore: update chromium/chore_patch_out_profile_methods_in_profile_selections_cc.patch https://chromium-review.googlesource.com/c/chromium/src/+/4502965 patch manually reapplied due to upstream code shear * chore: update bundle_locations #include location Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4525355 * chore: Remove `extension_name` from DesktopStreamsRegistry Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4514081 * chore: bump chromium in DEPS to 115.0.5778.0 * chore: add chromium/chore_patch_out_profile_methods_in_chrome_browser_pdf.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4482679 Another instance of patching out upstream references to Profile code * refactor: add WebViewGuestDelegate::GetGuestDelegateWeakPtr() Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4515455 This approach copied from GuestViewBase::GetGuestDelegateWeakPtr() approach in that same commit. * fixup! chore: update bundle_locations #include location Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4525355 Sync namespace use to upstream base::mac -> base::apple changes * fixup! chore: update bundle_locations #include location Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4525355 Sync namespace use to upstream base::mac -> base::apple changes * chore: update chromium/mas_disable_remote_accessibility.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4530546 patch manually reapplied due to upstream code shear * chore: update chromium/printing.patch no manual changes; patch succeeded with fuzz * chore: update chromium/build_add_electron_tracing_category.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4517872 no manual changes; patch succeeded with fuzz * chore: update chromium/feat_ensure_mas_builds_of_the_same_application_can_use_safestorage.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4529098 patch manually reapplied due to upstream code shear * chromium/build_only_use_the_mas_build_config_in_the_required_components.patch https://chromium-review.googlesource.com/c/chromium/src/+/4529098 patch manually reapplied due to upstream code shear * chore: update chromium/mas-cgdisplayusesforcetogray.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4529475 no manual changes; patch succeeded with fuzz * chore: update chromium/build_only_use_the_mas_build_config_in_the_required_components.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4429011 no manual changes; patch succeeded with fuzz * chore: remove chromium/cherry-pick-48a136e77e6d.patch already present upstream * chore: remove chromium/cherry-pick-e6e23ba00379.patch already present upstream * [Code Health] Remove value based RegisterPref for Dict and List Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4533537 * Remove `cxx17_backports.h` and adjust unittest file Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4534916 Notes: mostly just removing #include and s/base::clamp/std::clamp/ * refactor: add FakeBrowserProcess helper class Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4424072 Used in ElectronBrowserMainParts' fake_browser_process_ field. Previously this was an BrowserProcessImpl instance, but upstream 4424072 makes that an abstract base class. `FakeBrowserProcess` is a thin subclass with the minimum code needed to make it concrete. `ElectronBrowserMainParts::fake_browser_process_` is now a `shared_ptr` instead of a `unique_ptr` so we can avoid exposing `FakeBrowserProcess` in the header. * fixup! refactor: add FakeBrowserProcess helper class remove unnecessary unique_ptr * fix: Browser::SetDockIcon() when !Browser.is_ready() Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4410741 An alternative fix for https://github.com/electron/electron/pull/36279 . The previous fix was to call `SetSupportedScales()` ourselves (1b1609a), but upstream has removed this API. CC @codebytere * fixup! chore: remove chromium/cherry-pick-e6e23ba00379.patch * chore: update chromium/export_gin_v8platform_pageallocator_for_usage_outside_of_the_gin.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4517404 patch manually reapplied due to upstream code shear * chore: update patches * chore: add dep: resource_coordinator:mojo_bindings Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4521464 * fixup! chore: add dep: resource_coordinator:mojo_bindings chore: make lint happy * chore: patch out Profile methods in titlebar_config Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4508143 (primary) Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4534461 (followup) * chore: bump chromium in DEPS to 115.0.5780.0 * chore: update chromium/disable_hidden.patch no manual changes; patch succeeded with fuzz * chore: update chromium/sysroot.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4535715 no manual changes; patch succeeded with fuzz * chore: update chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4403623 patch manually reapplied due to upstream code shear * chore: update chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4547380 patch manually reapplied due to upstream code shear * chore: update patches * fixup! fix: Browser::SetDockIcon() when !Browser.is_ready() chore: iwyu image.h * chore: bump chromium in DEPS to 115.0.5782.0 * chore: bump chromium in DEPS to 115.0.5784.0 * 4514181: CR2023: Update filled cr-input styles. https://chromium-review.googlesource.com/c/chromium/src/+/4514181 * 4521894: Remove SiteInstanceDeleting usage outside of tests. https://chromium-review.googlesource.com/c/chromium/src/+/4521894 * 4525355: Move backup_util and bundle_locations to base/apple https://chromium-review.googlesource.com/c/chromium/src/+/4525355 * 4484743: webauthn: add underlying support for calling iCloud Keychain on macOS. https://chromium-review.googlesource.com/c/chromium/src/+/4484743 * chore: fixup patch indices * 4546398: Convert /chrome/browser to use ARC https://chromium-review.googlesource.com/c/chromium/src/+/4546398 * chore: bump chromium in DEPS to 115.0.5786.0 * chore: update patches * 4540682: Initialize PDF SDK with policy in chrome_pdf::RenderPDFPageToDC() https://chromium-review.googlesource.com/c/chromium/src/+/4540682 * Don't import ObjC++ fn headers into electron_api_app * 4535715: Refactor sysroot-creator.sh https://chromium-review.googlesource.com/c/chromium/src/+/4535715 * fixup! refactor: add FakeBrowserProcess helper class * 4531903: [string][test] Create/Copy strings to old space before externalization https://chromium-review.googlesource.com/c/v8/v8/+/4531903 * 59645: Add APIs to support RSA keys with large e. https://boringssl-review.googlesource.com/c/boringssl/+/59645 --------- Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-05-23 22:58:58 +03:00
DockSetIconImage(image);
}
void Browser::DockSetIconImage(gfx::Image const& image) {
if (!is_ready_) {
dock_icon_ = image;
return;
}
[[AtomApplication sharedApplication]
setApplicationIconImage:image.AsNSImage()];
}
2016-10-10 23:30:58 +03:00
void Browser::ShowAboutPanel() {
NSDictionary* options = DictionaryValueToNSDictionary(about_panel_options_);
// Credits must be a NSAttributedString instead of NSString
NSString* credits = (NSString*)options[@"Credits"];
if (credits != nil) {
base::scoped_nsobject<NSMutableDictionary> mutable_options(
[options mutableCopy]);
base::scoped_nsobject<NSAttributedString> creditString(
[[NSAttributedString alloc]
initWithString:credits
attributes:@{
NSForegroundColorAttributeName : [NSColor textColor]
}]);
[mutable_options setValue:creditString forKey:@"Credits"];
options = [NSDictionary dictionaryWithDictionary:mutable_options];
}
[[AtomApplication sharedApplication]
2016-10-10 23:30:58 +03:00
orderFrontStandardAboutPanelWithOptions:options];
}
void Browser::SetAboutPanelOptions(base::Value::Dict options) {
about_panel_options_.clear();
2016-10-12 20:52:59 +03:00
for (const auto pair : options) {
std::string key = pair.first;
if (!key.empty() && pair.second.is_string()) {
2016-10-12 20:52:59 +03:00
key[0] = base::ToUpperASCII(key[0]);
about_panel_options_.Set(key, pair.second.Clone());
2016-10-12 20:52:59 +03:00
}
}
2016-10-10 23:30:58 +03:00
}
2019-03-14 23:39:52 +03:00
void Browser::ShowEmojiPanel() {
[[AtomApplication sharedApplication] orderFrontCharacterPalette:nil];
2019-03-14 23:39:52 +03:00
}
bool Browser::IsEmojiPanelSupported() {
return true;
}
bool Browser::IsSecureKeyboardEntryEnabled() {
return password_input_enabler_.get() != nullptr;
}
void Browser::SetSecureKeyboardEntryEnabled(bool enabled) {
if (enabled) {
password_input_enabler_ =
std::make_unique<ui::ScopedPasswordInputEnabler>();
} else {
password_input_enabler_.reset();
}
}
} // namespace electron