Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4867)

Unified Diff: chrome/browser/extensions/extension_commands_global_registry.cc

Issue 576413002: Reland Track the active ExtensionKeybindingRegistry and make it available to EventRewriter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_commands_global_registry.cc
diff --git a/chrome/browser/extensions/extension_commands_global_registry.cc b/chrome/browser/extensions/extension_commands_global_registry.cc
index 1982addbe9c5be19b611a1cb0a0d9b452a797cab..a6016dd796734a3f33b444b58047ffb00e2979b5 100644
--- a/chrome/browser/extensions/extension_commands_global_registry.cc
+++ b/chrome/browser/extensions/extension_commands_global_registry.cc
@@ -16,7 +16,8 @@ ExtensionCommandsGlobalRegistry::ExtensionCommandsGlobalRegistry(
: ExtensionKeybindingRegistry(context,
ExtensionKeybindingRegistry::ALL_EXTENSIONS,
NULL),
- browser_context_(context) {
+ browser_context_(context),
+ registry_for_active_window_(NULL) {
Init();
}
@@ -58,6 +59,13 @@ void ExtensionCommandsGlobalRegistry::SetShortcutHandlingSuspended(
suspended);
}
+bool ExtensionCommandsGlobalRegistry::IsRegistered(
+ const ui::Accelerator& accelerator) {
+ return (registry_for_active_window() &&
+ registry_for_active_window()->IsAcceleratorRegistered(accelerator)) ||
+ IsAcceleratorRegistered(accelerator);
+}
+
void ExtensionCommandsGlobalRegistry::AddExtensionKeybinding(
const extensions::Extension* extension,
const std::string& command_name) {

Powered by Google App Engine
This is Rietveld 408576698