fix: use the new MediaPlayPause key listener for internal chrome logic (#21959)

This commit is contained in:
Samuel Attard 2020-01-29 18:18:59 -08:00 committed by GitHub
parent 7c070c58af
commit 6428bf36d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 66 additions and 18 deletions

View file

@ -112,18 +112,3 @@ index 85378bb565de617b1bd611d28c8714361747a357..94a899e76586d2c7bb199828bfa4aa1e
return event;
}
@@ -223,12 +233,14 @@ static CGEventRef EventTapCallback(CGEventTapProxy proxy,
// For Mac OS 10.12.2 or later, we want to use MPRemoteCommandCenter for
// getting media keys globally if there is a RemoteCommandCenterDelegate
// available.
+#if !BUILDFLAG(ENABLE_MEDIA_KEY_OVERRIDES)
if (scope == Scope::kGlobal) {
auto listener =
std::make_unique<SystemMediaControlsMediaKeysListener>(delegate);
if (listener->Initialize())
return listener;
}
+#endif
return std::make_unique<MediaKeysListenerImpl>(delegate, scope);
}