fix: Fix broken globalShortcuts.registerAll() on non-macOS platforms (#20983)

This was a regression in #16125, which unintentionally put
`GlobalShortcutListener::RegisterAccelerator` into a
`#if defined(OS_MACOSX)` block.

Notes: Fix broken `globalShortcut.registerAll()` on Windows and Linux
This commit is contained in:
trop[bot]
2019-11-06 13:37:22 -08:00
committed by Shelley Vohr
parent 2e8349c520
commit 7a1b3c5f2d

View File

@@ -73,19 +73,13 @@ bool GlobalShortcut::RegisterAll(
std::vector<ui::Accelerator> registered;
for (auto& accelerator : accelerators) {
#if defined(OS_MACOSX)
if (RegisteringMediaKeyForUntrustedClient(accelerator))
return false;
GlobalShortcutListener* listener = GlobalShortcutListener::GetInstance();
if (!listener->RegisterAccelerator(accelerator, this)) {
if (!Register(accelerator, callback)) {
// unregister all shortcuts if any failed
UnregisterSome(registered);
return false;
}
#endif
registered.push_back(accelerator);
accelerator_callback_map_[accelerator] = callback;
}
return true;
}