28ada6ea8b
* chore: bump chromium in DEPS to 99.0.4819.0
* chore: update patches
* chore: bump chromium in DEPS to 99.0.4824.0
* chore: update patches
* chore: bump chromium in DEPS to 99.0.4827.0
* chore: update patches
* 3352511: PiP: Add inkdrop and pointer cursor to PiP window buttons
https://chromium-review.googlesource.com/c/chromium/src/+/3352511
* 3309164: webhid: Show FIDO devices in the chooser if allowed
https://chromium-review.googlesource.com/c/chromium/src/+/3309164
* 3297868: hid: Add experimental HIDDevice.forget()
https://chromium-review.googlesource.com/c/chromium/src/+/3297868
* 3362491: [Extensions] Move i18n API to //extensions
https://chromium-review.googlesource.com/c/chromium/src/+/3362491
* MCC Refactor step0: Allow embedders to register associated_interface binders with RenderFrameHostImpl::associated_registry_.
https://chromium-review.googlesource.com/c/chromium/src/+/3281481
* 3352616: [Gtk] Remove libgtk from the link-line
https://chromium-review.googlesource.com/c/chromium/src/+/3352616
* 3249211: Clear-Site-Data support for partitioned cookies
https://chromium-review.googlesource.com/c/chromium/src/+/3249211
* [Extensions][COIL] Use [allow|block]list in //extensions/common
https://chromium-review.googlesource.com/c/chromium/src/+/3372668
* Begin ScopedUserPrefUpdate migration to modern base::Value
https://chromium-review.googlesource.com/c/chromium/src/+/3376154
* [Code Health] Refactor PrefService GetDict + GetList to use base::Value
https://chromium-review.googlesource.com/c/chromium/src/+/3343526
* 3354997: [CodeHealth] Remove deprecated SetDictionary method
https://chromium-review.googlesource.com/c/chromium/src/+/3354997
* 3287323: Add LacrosPrefStore for lacros settings
https://chromium-review.googlesource.com/c/chromium/src/+/3287323
* 3365916: [PA] Clean up remaining lazy commit code
https://chromium-review.googlesource.com/c/chromium/src/+/3365916
* [MPArch] Target the external protocol error at the responsible frame.
https://chromium-review.googlesource.com/c/chromium/src/+/3011560
* Pass origin to RegisterNonNetworkSubresourceURLLoaderFactories
https://chromium-review.googlesource.com/c/chromium/src/+/3350608
* Linux: Send OSCrypt raw encryption key to the Network Service
https://chromium-review.googlesource.com/c/chromium/src/+/3320484
* [PlzServiceWorker] Remove remaining references to PlzServiceWorker.
https://chromium-review.googlesource.com/c/chromium/src/+/3359441
* chore: fixup for lint
* 3327621: Fix tablet mode detection for Win 11.
https://chromium-review.googlesource.com/c/chromium/src/+/3327621
* 3342428: ax_mac: move AXTextMarker conversion utils under ui umbrella
https://chromium-review.googlesource.com/c/chromium/src/+/3342428
* 3353974: Mac: Use base::Feature for overlay features
https://chromium-review.googlesource.com/c/chromium/src/+/3353974
* chore: bump chromium in DEPS to 99.0.4828.0
* chore: update patches
* chore: bump chromium in DEPS to 99.0.4837.0
* chore: update patches
* chore: update patches
* 3379142: Drop FALLTHROUGH macro
Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3379142
* 3381749: C++17: Allow use of std::map::try_emplace and std::map::insert_or_assign
Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3381749
* chore: bump chromium in DEPS to 99.0.4839.0
* chore: update patches
* chore: bump chromium in DEPS to 99.0.4840.0
* chore: bump chromium in DEPS to 99.0.4844.0
* 3395881: [api] Deprecate Local<v8::Context> v8::Object::CreationContext()
Ref: https://chromium-review.googlesource.com/c/v8/v8/+/3395881
* chore: update patches
* chore: bump chromium in DEPS to 100.0.4845.0
* chore: update patches
* chore: bump chromium in DEPS to 100.0.4847.0
* chore: update patches
* chore: bump chromium in DEPS to 100.0.4849.0
* chore: update patches
* chore: bump chromium in DEPS to 100.0.4851.0
* chore: bump chromium in DEPS to 100.0.4853.0
* update patches
* chore: update patches
* update patches
* 3383599: Fonts Access: Remove prototype that uses a font picker.
https://chromium-review.googlesource.com/c/chromium/src/+/3383599
* 3404768: Remove ALLOW_UNUSED macros
https://chromium-review.googlesource.com/c/chromium/src/+/3404768
* 3374762: Remove ignore_result.h
https://chromium-review.googlesource.com/c/chromium/src/+/3374762
* 3399305: [unseasoned-pdf] Apply proper frame offsets for touch selections
https://chromium-review.googlesource.com/c/chromium/src/+/3399305
* 3402210: [Extensions] Don't trigger unload event for already unloaded extension
https://chromium-review.googlesource.com/c/chromium/src/+/3402210
* 3410912: Combine URLLoaderClient OnReceiveResponse and OnStartLoadingResponseBody.
https://chromium-review.googlesource.com/c/chromium/src/+/3410912
* 3370428: Make the AuthSchemes policy support dynamic refresh
https://chromium-review.googlesource.com/c/chromium/src/+/3370428
* 3407603: Finish ScopedUserPrefUpdate migration to modern base::Value
https://chromium-review.googlesource.com/c/chromium/src/+/3407603
* 3378352: ozone/x11: move code from //ui/p/x11 to //ui/ozone/p/x11
https://chromium-review.googlesource.com/c/chromium/src/+/3378352
* 3370810: Delete chrome/service, AKA the Cloud Print service process.
https://chromium-review.googlesource.com/c/chromium/src/+/3370810
* chore: bump chromium in DEPS to 100.0.4855.0
* chore: update patches
* fixup! 3370810: Delete chrome/service, AKA the Cloud Print service process.
* revert 3348007 to fix windows build
* 3318572: [Code health] Fix gn check errors in //extensions/browser:*
https://chromium-review.googlesource.com/c/chromium/src/+/3318572
* fix printing.patch
* fix iwyu issue
* 3408515: win: Make ShorcutOperation an enum class and modernize names
https://chromium-review.googlesource.com/c/chromium/src/+/3408515
* 3388333: [UIA] Remove dead code accessibility_misc_utils.h/cc
https://chromium-review.googlesource.com/c/chromium/src/+/3388333
* fix windows build? i hope
* patch gn visibility of //ui/ozone/platform/x11
* missing include base/logging.h
* use BUILDFLAG for USE_NSS_CERTS
https://chromium-review.googlesource.com/c/chromium/src/+/3379123
* defined(OS_*) ==> BUILDFLAG(IS_*)
https://bugs.chromium.org/p/chromium/issues/detail?id=1234043
* fixup! 3404768: Remove ALLOW_UNUSED macros
* another attempt to fix windows build
* temporarily disable the custom scheme service worker test
https://github.com/electron/electron/issues/32664
* fix loading mv3 extensions
not sure what cl broke this unfort.
* fixup! 3404768: Remove ALLOW_UNUSED macros
* patch nan
https://chromium-review.googlesource.com/c/v8/v8/+/3395880
* fix node test
* fix nullptr in FindPdfFrame
* patch perfetto to fix build issue on win-ia32
bc44c3c753
* fix build for linux-x64-testing-no-run-as-node
* fix patch
* skip <webview>.capturePage() test
https://github.com/electron/electron/issues/32705
* test: fix failing tests of focus/blur events of WebContents (#32711)
* inherit stdio from app module test child processes
this prevents them from timing out due to full stdout buffers
* test to see if we can get better logs on windows ci
* try again for appveyor log things
* skip contentTracing tests on ia32
* ci: disable gpu compositing
* drop applied patch
* fix merge fail
* Revert "ci: disable gpu compositing"
This reverts commit 0344129fcb19ea3e87e06c1110d751f22eba3fec.
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
Co-authored-by: VerteDinde <khammond@slack-corp.com>
Co-authored-by: VerteDinde <vertedinde@electronjs.org>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
364 lines
18 KiB
Diff
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 3cad85ec824d81ef43796a5c7e4f013dcfd5bf0a..d352b23f4a42b10e77a61de71069083f20f99136 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_; }
|