Index: chrome/browser/extensions/api/commands/command_service.cc |
diff --git a/chrome/browser/extensions/api/commands/command_service.cc b/chrome/browser/extensions/api/commands/command_service.cc |
index 33a522e04104bb5816b4e2fcae386448c0a9715d..47b070c03a467d3ace0bdcf71dba424785667307 100644 |
--- a/chrome/browser/extensions/api/commands/command_service.cc |
+++ b/chrome/browser/extensions/api/commands/command_service.cc |
@@ -300,14 +300,30 @@ void CommandService::OnExtensionWillBeInstalled( |
bool is_update, |
bool from_ephemeral, |
const std::string& old_name) { |
- UpdateKeybindings(extension); |
+ if (extension->location() != Manifest::COMPONENT) |
Finnur
2014/12/11 13:51:49
I would document this with:
// Component extensio
David Tseng
2014/12/12 18:38:31
As mentioned before, I was seeing component extens
Finnur
2014/12/15 14:01:42
OK, in that case I'd remove the if-check from OnEx
Finnur
2014/12/19 15:26:52
What about this?
David Tseng
2014/12/19 19:41:00
Done.
|
+ UpdateKeybindings(extension); |
} |
void CommandService::OnExtensionUninstalled( |
content::BrowserContext* browser_context, |
const Extension* extension, |
extensions::UninstallReason reason) { |
- RemoveKeybindingPrefs(extension->id(), std::string()); |
+ if (extension->location() != Manifest::COMPONENT) |
+ RemoveKeybindingPrefs(extension->id(), std::string()); |
+} |
+ |
+void CommandService::OnExtensionLoaded(content::BrowserContext* browser_context, |
+ const Extension* extension) { |
+ if (extension->location() == Manifest::COMPONENT) |
+ UpdateKeybindings(extension); |
+} |
+ |
+void CommandService::OnExtensionUnloaded( |
+ content::BrowserContext* browser_context, |
+ const Extension* extension, |
+ UnloadedExtensionInfo::Reason reason) { |
+ if (extension->location() == Manifest::COMPONENT) |
+ RemoveKeybindingPrefs(extension->id(), std::string()); |
Finnur
2014/12/11 13:51:49
Do we even want to remove keybindings for componen
David Tseng
2014/12/12 18:38:31
Removed this method.
|
} |
void CommandService::UpdateKeybindingPrefs(const std::string& extension_id, |