chore: bump chromium to e836cbe709f3cd703f233de8eb6cc6ec99b72c9d (#27475)

Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
This commit is contained in:
Shelley Vohr 2021-02-09 12:16:21 -08:00 committed by GitHub
parent 44460e84c0
commit e46446e7e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
93 changed files with 705 additions and 896 deletions

View file

@ -9,7 +9,6 @@
#include "base/stl_util.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/common/extensions/command.h"
#include "gin/dictionary.h"
#include "gin/object_template_builder.h"
#include "shell/browser/api/electron_api_system_preferences.h"
@ -22,7 +21,6 @@
#include "base/mac/mac_util.h"
#endif
using extensions::Command;
using extensions::GlobalShortcutListener;
namespace {
@ -46,15 +44,6 @@ bool RegisteringMediaKeyForUntrustedClient(const ui::Accelerator& accelerator) {
}
return false;
}
bool MapHasMediaKeys(
const std::map<ui::Accelerator, base::Closure>& accelerator_map) {
auto media_key = std::find_if(
accelerator_map.begin(), accelerator_map.end(),
[](const auto& ac) { return Command::IsMediaKey(ac.first); });
return media_key != accelerator_map.end();
}
#endif
} // namespace
@ -112,12 +101,8 @@ bool GlobalShortcut::Register(const ui::Accelerator& accelerator,
return false;
}
#if defined(OS_MAC)
if (Command::IsMediaKey(accelerator)) {
if (RegisteringMediaKeyForUntrustedClient(accelerator))
return false;
GlobalShortcutListener::SetShouldUseInternalMediaKeyHandling(false);
}
if (RegisteringMediaKeyForUntrustedClient(accelerator))
return false;
#endif
if (!GlobalShortcutListener::GetInstance()->RegisterAccelerator(accelerator,
@ -138,13 +123,6 @@ void GlobalShortcut::Unregister(const ui::Accelerator& accelerator) {
if (accelerator_callback_map_.erase(accelerator) == 0)
return;
#if defined(OS_MAC)
if (Command::IsMediaKey(accelerator) &&
!MapHasMediaKeys(accelerator_callback_map_)) {
GlobalShortcutListener::SetShouldUseInternalMediaKeyHandling(true);
}
#endif
GlobalShortcutListener::GetInstance()->UnregisterAccelerator(accelerator,
this);
}