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

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

Issue 788973002: Observe OnExtensionLoaded to trigger update of chrome.commands keybindings for component extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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_keybinding_registry.cc
diff --git a/chrome/browser/extensions/extension_keybinding_registry.cc b/chrome/browser/extensions/extension_keybinding_registry.cc
index dae15fd8b0561f973cf6181f7880a041c2bd3566..4c93381c85f1ac2770b21ac544e309132d4390fc 100644
--- a/chrome/browser/extensions/extension_keybinding_registry.cc
+++ b/chrome/browser/extensions/extension_keybinding_registry.cc
@@ -198,6 +198,12 @@ void ExtensionKeybindingRegistry::Observe(
return;
if (ExtensionMatchesFilter(extension)) {
+ // Component extensions triggers OnExtensionLoaded for extension
+ // installs as well as loads. This can cause adding of multiple key
Finnur 2015/01/08 14:13:50 It seems weird that OnExtensionLoaded is called tw
David Tseng 2015/01/08 20:34:41 It is clear after I got the right logging in. OnEx
+ // targets.
+ if (extension->location() == Manifest::COMPONENT)
+ return;
Finnur 2015/01/08 14:13:50 We don't need to early-return when type == COMMAND
David Tseng 2015/01/08 20:34:41 Done. (since we don't process OnExtensionUnloaded
+
if (type == extensions::NOTIFICATION_EXTENSION_COMMAND_ADDED)
AddExtensionKeybinding(extension, payload->second);
else

Powered by Google App Engine
This is Rietveld 408576698