electron/patches/chromium/command-ismediakey.patch
electron-roller[bot] bd10b19b0c
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 09:45:59 +01:00

364 lines
18 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jeremy Apthorp <jeremya@chromium.org>
Date: Wed, 10 Oct 2018 15:07:34 -0700
Subject: command-ismediakey.patch
Override MediaKeysListener::IsMediaKeycode and associated functions to also listen for
Volume Up, Volume Down, and Mute.
Also apply electron/electron@0f67b1866a9f00b852370e721affa4efda623f3a
and electron/electron@d2368d2d3b3de9eec4cc32b6aaf035cc89921bf1 as
patches.
diff --git a/chrome/browser/extensions/global_shortcut_listener_ozone.cc b/chrome/browser/extensions/global_shortcut_listener_ozone.cc
index ed2ac20679a9357c9493224ec5e08837c7860d6e..7f9a97e11395e5521e100694cd37bcd95bcd8e35 100644
--- a/chrome/browser/extensions/global_shortcut_listener_ozone.cc
+++ b/chrome/browser/extensions/global_shortcut_listener_ozone.cc
@@ -58,7 +58,8 @@ bool GlobalShortcutListenerOzone::RegisterAcceleratorImpl(
const bool registered =
platform_global_shortcut_listener_->RegisterAccelerator(
accelerator.key_code(), accelerator.IsAltDown(),
- accelerator.IsCtrlDown(), accelerator.IsShiftDown());
+ accelerator.IsCtrlDown(), accelerator.IsShiftDown(),
+ accelerator.IsCmdDown());
if (registered)
registered_hot_keys_.insert(accelerator);
return registered;
@@ -72,14 +73,15 @@ void GlobalShortcutListenerOzone::UnregisterAcceleratorImpl(
platform_global_shortcut_listener_->UnregisterAccelerator(
accelerator.key_code(), accelerator.IsAltDown(), accelerator.IsCtrlDown(),
- accelerator.IsShiftDown());
+ accelerator.IsShiftDown(), accelerator.IsCmdDown());
registered_hot_keys_.erase(accelerator);
}
void GlobalShortcutListenerOzone::OnKeyPressed(ui::KeyboardCode key_code,
bool is_alt_down,
bool is_ctrl_down,
- bool is_shift_down) {
+ bool is_shift_down,
+ bool is_cmd_down) {
int modifiers = 0;
if (is_alt_down)
modifiers |= ui::EF_ALT_DOWN;
@@ -87,6 +89,8 @@ void GlobalShortcutListenerOzone::OnKeyPressed(ui::KeyboardCode key_code,
modifiers |= ui::EF_CONTROL_DOWN;
if (is_shift_down)
modifiers |= ui::EF_SHIFT_DOWN;
+ if (is_cmd_down)
+ modifiers |= ui::EF_COMMAND_DOWN;
NotifyKeyPressed(ui::Accelerator(key_code, modifiers));
}
diff --git a/chrome/browser/extensions/global_shortcut_listener_ozone.h b/chrome/browser/extensions/global_shortcut_listener_ozone.h
index eb3f3431a3774c3a05afd4c7350f3801e9c8c684..b8970ef9ddb69d6a9fc6d106293e760535b6f4b3 100644
--- a/chrome/browser/extensions/global_shortcut_listener_ozone.h
+++ b/chrome/browser/extensions/global_shortcut_listener_ozone.h
@@ -45,7 +45,8 @@ class GlobalShortcutListenerOzone
void OnKeyPressed(ui::KeyboardCode key_code,
bool is_alt_down,
bool is_ctrl_down,
- bool is_shift_down) override;
+ bool is_shift_down,
+ bool is_cmd_down) override;
void OnPlatformListenerDestroyed() override;
bool is_listening_ = false;
diff --git a/chrome/browser/extensions/global_shortcut_listener_win.cc b/chrome/browser/extensions/global_shortcut_listener_win.cc
index 0f344ee352a48497e77a72bb298146c61e7fcf2a..3bad4263ea552fc63445bf5613f8add746a3a374 100644
--- a/chrome/browser/extensions/global_shortcut_listener_win.cc
+++ b/chrome/browser/extensions/global_shortcut_listener_win.cc
@@ -62,6 +62,8 @@ void GlobalShortcutListenerWin::OnWndProc(HWND hwnd,
modifiers |= (LOWORD(lparam) & MOD_SHIFT) ? ui::EF_SHIFT_DOWN : 0;
modifiers |= (LOWORD(lparam) & MOD_ALT) ? ui::EF_ALT_DOWN : 0;
modifiers |= (LOWORD(lparam) & MOD_CONTROL) ? ui::EF_CONTROL_DOWN : 0;
+ modifiers |= (LOWORD(lparam) & MOD_WIN) ? ui::EF_COMMAND_DOWN : 0;
+
ui::Accelerator accelerator(
ui::KeyboardCodeForWindowsKeyCode(key_code), modifiers);
@@ -92,6 +94,7 @@ bool GlobalShortcutListenerWin::RegisterAcceleratorImpl(
modifiers |= accelerator.IsShiftDown() ? MOD_SHIFT : 0;
modifiers |= accelerator.IsCtrlDown() ? MOD_CONTROL : 0;
modifiers |= accelerator.IsAltDown() ? MOD_ALT : 0;
+ modifiers |= accelerator.IsCmdDown() ? MOD_WIN : 0;
// Create an observer that registers a hot key for |accelerator|.
std::unique_ptr<gfx::SingletonHwndHotKeyObserver> observer =
diff --git a/content/browser/media/media_keys_listener_manager_impl.cc b/content/browser/media/media_keys_listener_manager_impl.cc
index 4145418210c2b1033390ec8a2e657cb1fcd048f8..5938f75742b793868638e693a9a8c8dc686dfc46 100644
--- a/content/browser/media/media_keys_listener_manager_impl.cc
+++ b/content/browser/media/media_keys_listener_manager_impl.cc
@@ -290,6 +290,11 @@ void MediaKeysListenerManagerImpl::UpdateSystemMediaControlsEnabledControls() {
case ui::VKEY_MEDIA_STOP:
system_media_controls_->SetIsStopEnabled(should_enable);
break;
+ case ui::VKEY_VOLUME_DOWN:
+ case ui::VKEY_VOLUME_UP:
+ case ui::VKEY_VOLUME_MUTE:
+ // Do nothing.
+ break;
default:
NOTREACHED();
}
diff --git a/ui/base/accelerators/media_keys_listener.cc b/ui/base/accelerators/media_keys_listener.cc
index 1145e1f3d79482b5bb468c3128431ac674310e5f..e9f595045e0c076e0735f27dfc38bfbc7951d372 100644
--- a/ui/base/accelerators/media_keys_listener.cc
+++ b/ui/base/accelerators/media_keys_listener.cc
@@ -13,7 +13,8 @@ MediaKeysListener::~MediaKeysListener() = default;
// static
bool MediaKeysListener::IsMediaKeycode(KeyboardCode key_code) {
return key_code == VKEY_MEDIA_PLAY_PAUSE || key_code == VKEY_MEDIA_STOP ||
- key_code == VKEY_MEDIA_PREV_TRACK || key_code == VKEY_MEDIA_NEXT_TRACK;
+ key_code == VKEY_MEDIA_PREV_TRACK || key_code == VKEY_MEDIA_NEXT_TRACK ||
+ key_code == VKEY_VOLUME_UP || key_code == VKEY_VOLUME_DOWN || key_code == VKEY_VOLUME_MUTE;
}
} // namespace ui
diff --git a/ui/base/accelerators/media_keys_listener_mac.mm b/ui/base/accelerators/media_keys_listener_mac.mm
index ada705fb42e88d4bfa05b212c84111be9057a50e..a866b975687dd08ad88031a63f161b3164e82455 100644
--- a/ui/base/accelerators/media_keys_listener_mac.mm
+++ b/ui/base/accelerators/media_keys_listener_mac.mm
@@ -32,6 +32,12 @@ KeyboardCode MediaKeyCodeToKeyboardCode(int key_code) {
case NX_KEYTYPE_NEXT:
case NX_KEYTYPE_FAST:
return VKEY_MEDIA_NEXT_TRACK;
+ case NX_KEYTYPE_SOUND_UP:
+ return VKEY_VOLUME_UP;
+ case NX_KEYTYPE_SOUND_DOWN:
+ return VKEY_VOLUME_DOWN;
+ case NX_KEYTYPE_MUTE:
+ return VKEY_VOLUME_MUTE;
}
return VKEY_UNKNOWN;
}
@@ -192,7 +198,10 @@ static CGEventRef EventTapCallback(CGEventTapProxy proxy,
int key_code = (data1 & 0xFFFF0000) >> 16;
if (key_code != NX_KEYTYPE_PLAY && key_code != NX_KEYTYPE_NEXT &&
key_code != NX_KEYTYPE_PREVIOUS && key_code != NX_KEYTYPE_FAST &&
- key_code != NX_KEYTYPE_REWIND) {
+ key_code != NX_KEYTYPE_REWIND &&
+ key_code != NX_KEYTYPE_SOUND_UP &&
+ key_code != NX_KEYTYPE_SOUND_DOWN &&
+ key_code != NX_KEYTYPE_MUTE) {
return event;
}
diff --git a/ui/base/x/x11_global_shortcut_listener.cc b/ui/base/x/x11_global_shortcut_listener.cc
index a772666160a71e8e31242e25a8f3383ad9b914bf..7ed78ff875ccf9c38a480d0d59f4688ada1a3ad3 100644
--- a/ui/base/x/x11_global_shortcut_listener.cc
+++ b/ui/base/x/x11_global_shortcut_listener.cc
@@ -32,11 +32,13 @@ const x11::ModMask kModifiersMasks[] = {
x11::ModMask GetNativeModifiers(bool is_alt_down,
bool is_ctrl_down,
- bool is_shift_down) {
+ bool is_shift_down,
+ bool is_cmd_down) {
constexpr auto kNoMods = x11::ModMask{};
return (is_shift_down ? x11::ModMask::Shift : kNoMods) |
(is_ctrl_down ? x11::ModMask::Control : kNoMods) |
- (is_alt_down ? x11::ModMask::c_1 : kNoMods);
+ (is_alt_down ? x11::ModMask::c_1 : kNoMods) |
+ (is_cmd_down ? x11::ModMask::c_4 : kNoMods);
}
} // namespace
@@ -82,8 +84,9 @@ uint32_t XGlobalShortcutListener::DispatchEvent(const PlatformEvent& event) {
bool XGlobalShortcutListener::RegisterAccelerator(KeyboardCode key_code,
bool is_alt_down,
bool is_ctrl_down,
- bool is_shift_down) {
- auto modifiers = GetNativeModifiers(is_alt_down, is_ctrl_down, is_shift_down);
+ bool is_shift_down,
+ bool is_cmd_down) {
+ auto modifiers = GetNativeModifiers(is_alt_down, is_ctrl_down, is_shift_down, is_cmd_down);
auto keysym = XKeysymForWindowsKeyCode(key_code, false);
auto keycode = connection_->KeysymToKeycode(keysym);
@@ -108,7 +111,7 @@ bool XGlobalShortcutListener::RegisterAccelerator(KeyboardCode key_code,
}
registered_combinations_.insert(
- Accelerator(key_code, is_alt_down, is_ctrl_down, is_shift_down));
+ Accelerator(key_code, is_alt_down, is_ctrl_down, is_shift_down, is_cmd_down));
return true;
}
@@ -116,8 +119,9 @@ bool XGlobalShortcutListener::RegisterAccelerator(KeyboardCode key_code,
void XGlobalShortcutListener::UnregisterAccelerator(KeyboardCode key_code,
bool is_alt_down,
bool is_ctrl_down,
- bool is_shift_down) {
- auto modifiers = GetNativeModifiers(is_alt_down, is_ctrl_down, is_shift_down);
+ bool is_shift_down,
+ bool is_cmd_down) {
+ auto modifiers = GetNativeModifiers(is_alt_down, is_ctrl_down, is_shift_down, is_cmd_down);
auto keysym = XKeysymForWindowsKeyCode(key_code, false);
auto keycode = connection_->KeysymToKeycode(keysym);
@@ -125,7 +129,7 @@ void XGlobalShortcutListener::UnregisterAccelerator(KeyboardCode key_code,
connection_->UngrabKey({keycode, x_root_window_, modifiers | mask});
registered_combinations_.erase(
- Accelerator(key_code, is_alt_down, is_ctrl_down, is_shift_down));
+ Accelerator(key_code, is_alt_down, is_ctrl_down, is_shift_down, is_cmd_down));
}
void XGlobalShortcutListener::OnKeyPressEvent(const KeyEvent& event) {
@@ -135,14 +139,15 @@ void XGlobalShortcutListener::OnKeyPressEvent(const KeyEvent& event) {
const bool is_alt_down = event.flags() & EF_ALT_DOWN;
const bool is_ctrl_down = event.flags() & EF_CONTROL_DOWN;
const bool is_shift_down = event.flags() & EF_SHIFT_DOWN;
+ const bool is_cmd_down = event.flags() & EF_COMMAND_DOWN;
if (!base::Contains(
registered_combinations_,
- Accelerator(key_code, is_alt_down, is_ctrl_down, is_shift_down))) {
+ Accelerator(key_code, is_alt_down, is_ctrl_down, is_shift_down, is_cmd_down))) {
return;
}
- OnKeyPressed(key_code, is_alt_down, is_ctrl_down, is_shift_down);
+ OnKeyPressed(key_code, is_alt_down, is_ctrl_down, is_shift_down, is_cmd_down);
}
} // namespace ui
diff --git a/ui/base/x/x11_global_shortcut_listener.h b/ui/base/x/x11_global_shortcut_listener.h
index 9e472d76423a748cbf6257c6656d8fd69853dd93..404a294b9cf3dd6744ece0b5c1e611bbab207e78 100644
--- a/ui/base/x/x11_global_shortcut_listener.h
+++ b/ui/base/x/x11_global_shortcut_listener.h
@@ -40,18 +40,21 @@ class COMPONENT_EXPORT(UI_BASE_X) XGlobalShortcutListener
virtual void OnKeyPressed(KeyboardCode key_code,
bool is_alt_down,
bool is_ctrl_down,
- bool is_shift_down) = 0;
+ bool is_shift_down,
+ bool is_cmd_down) = 0;
void StartListening();
void StopListening();
bool RegisterAccelerator(KeyboardCode key_code,
bool is_alt_down,
bool is_ctrl_down,
- bool is_shift_down);
+ bool is_shift_down,
+ bool is_cmd_down);
void UnregisterAccelerator(KeyboardCode key_code,
bool is_alt_down,
bool is_ctrl_down,
- bool is_shift_down);
+ bool is_shift_down,
+ bool is_cmd_down);
private:
// Due to how system key grabbing works on X11, we have to be a bit greedy and
@@ -60,7 +63,7 @@ class COMPONENT_EXPORT(UI_BASE_X) XGlobalShortcutListener
// and filter the incoming events against that registry before notifying the
// observer. This tuple describes the meaningful parts of the event; booleans
// 1, 2, and 3 hold states of Alt, Control, and Shift keys, respectively.
- using Accelerator = std::tuple<KeyboardCode, bool, bool, bool>;
+ using Accelerator = std::tuple<KeyboardCode, bool, bool, bool, bool>;
// Invoked when a global shortcut is pressed.
void OnKeyPressEvent(const KeyEvent& event);
diff --git a/ui/ozone/platform/x11/x11_global_shortcut_listener_ozone.cc b/ui/ozone/platform/x11/x11_global_shortcut_listener_ozone.cc
index 760dfc340601b7c1807fa750b008bcc79780c583..54f9817017c9fc0ebcd2f5825fb20b2fb8412b02 100644
--- a/ui/ozone/platform/x11/x11_global_shortcut_listener_ozone.cc
+++ b/ui/ozone/platform/x11/x11_global_shortcut_listener_ozone.cc
@@ -26,27 +26,30 @@ void X11GlobalShortcutListenerOzone::StopListening() {
bool X11GlobalShortcutListenerOzone::RegisterAccelerator(KeyboardCode key_code,
bool is_alt_down,
bool is_ctrl_down,
- bool is_shift_down) {
+ bool is_shift_down,
+ bool is_cmd_down) {
return XGlobalShortcutListener::RegisterAccelerator(
- key_code, is_alt_down, is_ctrl_down, is_shift_down);
+ key_code, is_alt_down, is_ctrl_down, is_shift_down, is_cmd_down);
}
void X11GlobalShortcutListenerOzone::UnregisterAccelerator(
KeyboardCode key_code,
bool is_alt_down,
bool is_ctrl_down,
- bool is_shift_down) {
+ bool is_shift_down,
+ bool is_cmd_down) {
return XGlobalShortcutListener::UnregisterAccelerator(
- key_code, is_alt_down, is_ctrl_down, is_shift_down);
+ key_code, is_alt_down, is_ctrl_down, is_shift_down, is_cmd_down);
}
void X11GlobalShortcutListenerOzone::OnKeyPressed(KeyboardCode key_code,
bool is_alt_down,
bool is_ctrl_down,
- bool is_shift_down) {
+ bool is_shift_down,
+ bool is_cmd_down) {
if (delegate()) {
delegate()->OnKeyPressed(key_code, is_alt_down, is_ctrl_down,
- is_shift_down);
+ is_shift_down, is_cmd_down);
}
}
diff --git a/ui/ozone/platform/x11/x11_global_shortcut_listener_ozone.h b/ui/ozone/platform/x11/x11_global_shortcut_listener_ozone.h
index 0f1980abdcaf30e23f580b937ecb2c422bf2a357..112967622cb8a6263c7a88dd8d09f48f52448a45 100644
--- a/ui/ozone/platform/x11/x11_global_shortcut_listener_ozone.h
+++ b/ui/ozone/platform/x11/x11_global_shortcut_listener_ozone.h
@@ -28,17 +28,20 @@ class X11GlobalShortcutListenerOzone : public PlatformGlobalShortcutListener,
bool RegisterAccelerator(KeyboardCode key_code,
bool is_alt_down,
bool is_ctrl_down,
- bool is_shift_down) override;
+ bool is_shift_down,
+ bool is_cmd_down) override;
void UnregisterAccelerator(KeyboardCode key_code,
bool is_alt_down,
bool is_ctrl_down,
- bool is_shift_down) override;
+ bool is_shift_down,
+ bool is_cmd_down) override;
// ui::XGlobalShortcutListener:
void OnKeyPressed(KeyboardCode key_code,
bool is_alt_down,
bool is_ctrl_down,
- bool is_shift_down) override;
+ bool is_shift_down,
+ bool is_cmd_down) override;
};
} // namespace ui
diff --git a/ui/ozone/public/platform_global_shortcut_listener.h b/ui/ozone/public/platform_global_shortcut_listener.h
index a5b539d4e7461c4ca9faa08fef086fc28a4ebd3a..f3aacc605f07807a5b83b496bd8a87933981d4f3 100644
--- a/ui/ozone/public/platform_global_shortcut_listener.h
+++ b/ui/ozone/public/platform_global_shortcut_listener.h
@@ -19,7 +19,8 @@ class COMPONENT_EXPORT(OZONE_BASE) PlatformGlobalShortcutListenerDelegate {
virtual void OnKeyPressed(KeyboardCode key_code,
bool is_alt_down,
bool is_ctrl_down,
- bool is_shift_down) = 0;
+ bool is_shift_down,
+ bool is_cmd_down) = 0;
// Called back when the platform implementation is destroyed.
virtual void OnPlatformListenerDestroyed() = 0;
@@ -51,11 +52,13 @@ class COMPONENT_EXPORT(OZONE_BASE) PlatformGlobalShortcutListener {
virtual bool RegisterAccelerator(KeyboardCode key_code,
bool is_alt_down,
bool is_ctrl_down,
- bool is_shift_down) = 0;
+ bool is_shift_down,
+ bool is_cmd_down) = 0;
virtual void UnregisterAccelerator(KeyboardCode key_code,
bool is_alt_down,
bool is_ctrl_down,
- bool is_shift_down) = 0;
+ bool is_shift_down,
+ bool is_cmd_down) = 0;
protected:
PlatformGlobalShortcutListenerDelegate* delegate() { return delegate_; }