mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
chore: bump chromium to 141.0.7390.7 (main) (#48212)
* chore: bump chromium in DEPS to 141.0.7381.3 * chore: update patches * chore: bump chromium in DEPS to 141.0.7382.0 * chore: update patches * chore: bump chromium in DEPS to 141.0.7384.0 * chore: bump chromium in DEPS to 141.0.7386.0 * [Extensions] Move devtools_page and chrome_url_overrides handlers Refs https://chromium-review.googlesource.com/c/chromium/src/+/6862700 * Reland "[api] Advance deprecation of GetIsolate" Refs https://chromium-review.googlesource.com/c/v8/v8/+/6875273 * Move "system integrated UI" concept out of NativeTheme. Refs https://chromium-review.googlesource.com/c/chromium/src/+/6867375 * chore: update patches * Reland "[PermissionOptions] Return PermissionResult in callback for requests" Refs https://chromium-review.googlesource.com/c/chromium/src/+/6851838 * Reland "[exit-time-destructors] Enable by default" Refs https://chromium-review.googlesource.com/c/chromium/src/+/6859042 * chore: update patches * [FSA] Revoke Read access after removing file via FileSystemAccess API Refs https://chromium-review.googlesource.com/c/chromium/src/+/6677249 * chore: IWYU * [DevToolsUIBindings] Accept an object for `dispatchHttpRequest` params Refs https://chromium-review.googlesource.com/c/chromium/src/+/6877528 * chore: IWYU * Pass navigation UI parameters on EnterFullscreen in EAM Refs https://chromium-review.googlesource.com/c/chromium/src/+/6874923 * chore: rm band-aid_over_an_issue_with_using_deprecated_nsopenpanel_api.patch * Remove unused PreHandleMouseEvent Refs https://chromium-review.googlesource.com/c/chromium/src/+/6880411 * 6878583: siso: update to version 1.4.1 https://chromium-review.googlesource.com/c/chromium/src/+/6878583 * Fold native_theme_browser into native_theme. https://chromium-review.googlesource.com/c/chromium/src/+/6882627 * fixup: Reland "[exit-time-destructors] Enable by default https://chromium-review.googlesource.com/c/chromium/src/+/6859042 * chore: update filenames.libcxx.gni * chore: IWYU * fixup: chore: IWYU * fixup: Reland "[exit-time-destructors] Enable by default * fixup: Reland "[exit-time-destructors] Enable by default * Remove common_theme.*; place its method in NativeTheme instead. https://chromium-review.googlesource.com/c/chromium/src/+/6886029 * fixup: Reland "[exit-time-destructors] Enable by default * Better track when WebPreferences need updates for color-related changes. Refs https://chromium-review.googlesource.com/c/chromium/src/+/6886797 * chore: bump chromium in DEPS to 141.0.7390.7 * 6904664: Reland "Make BrowserContext::GetPath() const" https://chromium-review.googlesource.com/c/chromium/src/+/6904664 * Restore read access after certain file modification operations https://chromium-review.googlesource.com/c/chromium/src/+/6861041 * fixup: Move "system integrated UI" concept out of NativeTheme. * fixup: Reland "[exit-time-destructors] Enable by default * chore: update patches * 6906096: Remove GetSysSkColor(). https://chromium-review.googlesource.com/c/chromium/src/+/6906096 * Inline implementation of SysColorChangeListener into the lone user. https://chromium-review.googlesource.com/c/chromium/src/+/6905083 Also 6906096: Remove GetSysSkColor(). | https://chromium-review.googlesource.com/c/chromium/src/+/6906096 * fixup: 6906096: Remove GetSysSkColor() --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: deepak1556 <hop2deep@gmail.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
This commit is contained in:
committed by
GitHub
parent
1f322ebce3
commit
793565e4be
@@ -10,6 +10,7 @@
|
||||
#include "base/files/file_enumerator.h"
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/no_destructor.h"
|
||||
#include "base/process/process_handle.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "shell/browser/notifications/notification_delegate.h"
|
||||
@@ -22,17 +23,20 @@ namespace electron {
|
||||
|
||||
namespace {
|
||||
|
||||
LibNotifyLoader libnotify_loader_;
|
||||
LibNotifyLoader& GetLibNotifyLoader() {
|
||||
static base::NoDestructor<LibNotifyLoader> loader;
|
||||
return *loader;
|
||||
}
|
||||
|
||||
const base::flat_set<std::string>& GetServerCapabilities() {
|
||||
static base::flat_set<std::string> caps;
|
||||
if (caps.empty()) {
|
||||
auto* capabilities = libnotify_loader_.notify_get_server_caps();
|
||||
static base::NoDestructor<base::flat_set<std::string>> caps;
|
||||
if (caps->empty()) {
|
||||
auto* capabilities = GetLibNotifyLoader().notify_get_server_caps();
|
||||
for (auto* l = capabilities; l != nullptr; l = l->next)
|
||||
caps.insert(static_cast<const char*>(l->data));
|
||||
caps->insert(static_cast<const char*>(l->data));
|
||||
g_list_free_full(capabilities, g_free);
|
||||
}
|
||||
return caps;
|
||||
return *caps;
|
||||
}
|
||||
|
||||
bool HasCapability(const std::string& capability) {
|
||||
@@ -57,15 +61,15 @@ void log_and_clear_error(GError* error, const char* context) {
|
||||
|
||||
// static
|
||||
bool LibnotifyNotification::Initialize() {
|
||||
if (!libnotify_loader_.Load("libnotify.so.4") && // most common one
|
||||
!libnotify_loader_.Load("libnotify.so.5") &&
|
||||
!libnotify_loader_.Load("libnotify.so.1") &&
|
||||
!libnotify_loader_.Load("libnotify.so")) {
|
||||
if (!GetLibNotifyLoader().Load("libnotify.so.4") && // most common one
|
||||
!GetLibNotifyLoader().Load("libnotify.so.5") &&
|
||||
!GetLibNotifyLoader().Load("libnotify.so.1") &&
|
||||
!GetLibNotifyLoader().Load("libnotify.so")) {
|
||||
LOG(WARNING) << "Unable to find libnotify; notifications disabled";
|
||||
return false;
|
||||
}
|
||||
if (!libnotify_loader_.notify_is_initted() &&
|
||||
!libnotify_loader_.notify_init(GetApplicationName().c_str())) {
|
||||
if (!GetLibNotifyLoader().notify_is_initted() &&
|
||||
!GetLibNotifyLoader().notify_init(GetApplicationName().c_str())) {
|
||||
LOG(WARNING) << "Unable to initialize libnotify; notifications disabled";
|
||||
return false;
|
||||
}
|
||||
@@ -84,7 +88,7 @@ LibnotifyNotification::~LibnotifyNotification() {
|
||||
}
|
||||
|
||||
void LibnotifyNotification::Show(const NotificationOptions& options) {
|
||||
notification_ = libnotify_loader_.notify_notification_new(
|
||||
notification_ = GetLibNotifyLoader().notify_notification_new(
|
||||
base::UTF16ToUTF8(options.title).c_str(),
|
||||
base::UTF16ToUTF8(options.msg).c_str(), nullptr);
|
||||
|
||||
@@ -96,7 +100,7 @@ void LibnotifyNotification::Show(const NotificationOptions& options) {
|
||||
// NB: On Unity and on any other DE using Notify-OSD, adding a notification
|
||||
// action will cause the notification to display as a modal dialog box.
|
||||
if (NotifierSupportsActions()) {
|
||||
libnotify_loader_.notify_notification_add_action(
|
||||
GetLibNotifyLoader().notify_notification_add_action(
|
||||
notification_, "default", "View", OnNotificationView, this, nullptr);
|
||||
}
|
||||
|
||||
@@ -108,19 +112,19 @@ void LibnotifyNotification::Show(const NotificationOptions& options) {
|
||||
}
|
||||
|
||||
// Set the urgency level of the notification.
|
||||
libnotify_loader_.notify_notification_set_urgency(notification_, urgency);
|
||||
GetLibNotifyLoader().notify_notification_set_urgency(notification_, urgency);
|
||||
|
||||
if (!options.icon.drawsNothing()) {
|
||||
GdkPixbuf* pixbuf = gtk_util::GdkPixbufFromSkBitmap(options.icon);
|
||||
libnotify_loader_.notify_notification_set_image_from_pixbuf(notification_,
|
||||
pixbuf);
|
||||
GetLibNotifyLoader().notify_notification_set_image_from_pixbuf(
|
||||
notification_, pixbuf);
|
||||
g_object_unref(pixbuf);
|
||||
}
|
||||
|
||||
// Set the timeout duration for the notification
|
||||
bool neverTimeout = options.timeout_type == u"never";
|
||||
int timeout = (neverTimeout) ? NOTIFY_EXPIRES_NEVER : NOTIFY_EXPIRES_DEFAULT;
|
||||
libnotify_loader_.notify_notification_set_timeout(notification_, timeout);
|
||||
GetLibNotifyLoader().notify_notification_set_timeout(notification_, timeout);
|
||||
|
||||
if (!options.tag.empty()) {
|
||||
GQuark id = g_quark_from_string(options.tag.c_str());
|
||||
@@ -130,10 +134,10 @@ void LibnotifyNotification::Show(const NotificationOptions& options) {
|
||||
// Always try to append notifications.
|
||||
// Unique tags can be used to prevent this.
|
||||
if (HasCapability("append")) {
|
||||
libnotify_loader_.notify_notification_set_hint(
|
||||
GetLibNotifyLoader().notify_notification_set_hint(
|
||||
notification_, "append", g_variant_new_string("true"));
|
||||
} else if (HasCapability("x-canonical-append")) {
|
||||
libnotify_loader_.notify_notification_set_hint(
|
||||
GetLibNotifyLoader().notify_notification_set_hint(
|
||||
notification_, "x-canonical-append", g_variant_new_string("true"));
|
||||
}
|
||||
|
||||
@@ -141,17 +145,17 @@ void LibnotifyNotification::Show(const NotificationOptions& options) {
|
||||
// The desktop-entry is the part before the .desktop
|
||||
std::string desktop_id = platform_util::GetXdgAppId();
|
||||
if (!desktop_id.empty()) {
|
||||
libnotify_loader_.notify_notification_set_hint(
|
||||
GetLibNotifyLoader().notify_notification_set_hint(
|
||||
notification_, "desktop-entry",
|
||||
g_variant_new_string(desktop_id.c_str()));
|
||||
}
|
||||
|
||||
libnotify_loader_.notify_notification_set_hint(
|
||||
GetLibNotifyLoader().notify_notification_set_hint(
|
||||
notification_, "sender-pid",
|
||||
g_variant_new_int64(base::GetCurrentProcId()));
|
||||
|
||||
GError* error = nullptr;
|
||||
libnotify_loader_.notify_notification_show(notification_, &error);
|
||||
GetLibNotifyLoader().notify_notification_show(notification_, &error);
|
||||
if (error) {
|
||||
log_and_clear_error(error, "notify_notification_show");
|
||||
NotificationFailed();
|
||||
@@ -169,7 +173,7 @@ void LibnotifyNotification::Dismiss() {
|
||||
|
||||
GError* error = nullptr;
|
||||
on_dismissing_ = true;
|
||||
libnotify_loader_.notify_notification_close(notification_, &error);
|
||||
GetLibNotifyLoader().notify_notification_close(notification_, &error);
|
||||
if (error) {
|
||||
log_and_clear_error(error, "notify_notification_close");
|
||||
}
|
||||
|
||||
@@ -147,12 +147,12 @@ const char* GetTemplateType(bool two_lines, bool has_icon) {
|
||||
} // namespace
|
||||
|
||||
// static
|
||||
ComPtr<winui::Notifications::IToastNotificationManagerStatics>
|
||||
WindowsToastNotification::toast_manager_;
|
||||
ComPtr<winui::Notifications::IToastNotificationManagerStatics>*
|
||||
WindowsToastNotification::toast_manager_ = nullptr;
|
||||
|
||||
// static
|
||||
ComPtr<winui::Notifications::IToastNotifier>
|
||||
WindowsToastNotification::toast_notifier_;
|
||||
ComPtr<winui::Notifications::IToastNotifier>*
|
||||
WindowsToastNotification::toast_notifier_ = nullptr;
|
||||
|
||||
// static
|
||||
bool WindowsToastNotification::Initialize() {
|
||||
@@ -163,21 +163,35 @@ bool WindowsToastNotification::Initialize() {
|
||||
RuntimeClass_Windows_UI_Notifications_ToastNotificationManager);
|
||||
if (!toast_manager_str.success())
|
||||
return false;
|
||||
if (FAILED(Windows::Foundation::GetActivationFactory(toast_manager_str,
|
||||
&toast_manager_)))
|
||||
|
||||
if (!toast_manager_) {
|
||||
toast_manager_ = new ComPtr<
|
||||
ABI::Windows::UI::Notifications::IToastNotificationManagerStatics>();
|
||||
}
|
||||
|
||||
if (FAILED(Windows::Foundation::GetActivationFactory(
|
||||
toast_manager_str, toast_manager_->GetAddressOf())))
|
||||
return false;
|
||||
|
||||
if (!toast_notifier_) {
|
||||
toast_notifier_ =
|
||||
new ComPtr<ABI::Windows::UI::Notifications::IToastNotifier>();
|
||||
}
|
||||
|
||||
if (IsRunningInDesktopBridge()) {
|
||||
// Ironically, the Desktop Bridge / UWP environment
|
||||
// requires us to not give Windows an appUserModelId.
|
||||
return SUCCEEDED(toast_manager_->CreateToastNotifier(&toast_notifier_));
|
||||
return SUCCEEDED(
|
||||
(*toast_manager_)
|
||||
->CreateToastNotifier(toast_notifier_->GetAddressOf()));
|
||||
} else {
|
||||
ScopedHString app_id;
|
||||
if (!GetAppUserModelID(&app_id))
|
||||
return false;
|
||||
|
||||
return SUCCEEDED(
|
||||
toast_manager_->CreateToastNotifierWithId(app_id, &toast_notifier_));
|
||||
return SUCCEEDED((*toast_manager_)
|
||||
->CreateToastNotifierWithId(
|
||||
app_id, toast_notifier_->GetAddressOf()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,7 +221,7 @@ void WindowsToastNotification::Remove() {
|
||||
|
||||
ComPtr<winui::Notifications::IToastNotificationManagerStatics2>
|
||||
toast_manager2;
|
||||
if (FAILED(toast_manager_.As(&toast_manager2)))
|
||||
if (FAILED(toast_manager_->As(&toast_manager2)))
|
||||
return;
|
||||
|
||||
ComPtr<winui::Notifications::IToastNotificationHistory> notification_history;
|
||||
@@ -226,7 +240,7 @@ void WindowsToastNotification::Remove() {
|
||||
void WindowsToastNotification::Dismiss() {
|
||||
DebugLog("Hiding notification");
|
||||
|
||||
toast_notifier_->Hide(toast_notification_.Get());
|
||||
(*toast_notifier_)->Hide(toast_notification_.Get());
|
||||
}
|
||||
|
||||
HRESULT WindowsToastNotification::ShowInternal(
|
||||
@@ -281,8 +295,9 @@ HRESULT WindowsToastNotification::ShowInternal(
|
||||
REPORT_AND_RETURN_IF_FAILED(SetupCallbacks(toast_notification_.Get()),
|
||||
"WinAPI: SetupCallbacks failed");
|
||||
|
||||
REPORT_AND_RETURN_IF_FAILED(toast_notifier_->Show(toast_notification_.Get()),
|
||||
"WinAPI: Show failed");
|
||||
REPORT_AND_RETURN_IF_FAILED(
|
||||
(*toast_notifier_)->Show(toast_notification_.Get()),
|
||||
"WinAPI: Show failed");
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -72,9 +72,9 @@ class WindowsToastNotification : public Notification {
|
||||
ABI::Windows::UI::Notifications::IToastNotification* toast);
|
||||
|
||||
static ComPtr<
|
||||
ABI::Windows::UI::Notifications::IToastNotificationManagerStatics>
|
||||
ABI::Windows::UI::Notifications::IToastNotificationManagerStatics>*
|
||||
toast_manager_;
|
||||
static ComPtr<ABI::Windows::UI::Notifications::IToastNotifier>
|
||||
static ComPtr<ABI::Windows::UI::Notifications::IToastNotifier>*
|
||||
toast_notifier_;
|
||||
|
||||
EventRegistrationToken activated_token_;
|
||||
|
||||
Reference in New Issue
Block a user