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 55c0be6f35e1e314871f044dfcc6003ccac3b46f..1244b0f9c455e98d2494462fae71c4628ea774bd 100644 |
--- a/chrome/browser/extensions/api/commands/command_service.cc |
+++ b/chrome/browser/extensions/api/commands/command_service.cc |
@@ -308,23 +308,19 @@ void CommandService::OnExtensionWillBeInstalled( |
bool is_update, |
bool from_ephemeral, |
const std::string& old_name) { |
- // Component extensions don't generate normal install and uninstall events so |
- // those are handled in OnExtensionLoaded. |
- if (extension->location() != Manifest::COMPONENT) |
- UpdateKeybindings(extension); |
+ UpdateKeybindings(extension); |
not at google - send to devlin
2015/02/20 16:14:50
For the commands case specifically, Finnur, why do
David Tseng
2015/02/20 18:01:09
The loaded case is removed in this cl.
This was p
|
} |
void CommandService::OnExtensionUninstalled( |
content::BrowserContext* browser_context, |
const Extension* extension, |
extensions::UninstallReason reason) { |
- RemoveKeybindingPrefs(extension->id(), std::string()); |
-} |
+ // Component extensions will only ever install once, but can notify uninstall |
+ // repeatedly, see http://crbug.com/458612. |
not at google - send to devlin
2015/02/20 16:14:50
Could you still mention why? The bug describes the
David Tseng
2015/02/20 18:01:09
Done.
|
+ if (reason == extensions::UNINSTALL_REASON_COMPONENT) |
+ return; |
-void CommandService::OnExtensionLoaded(content::BrowserContext* browser_context, |
- const Extension* extension) { |
- if (extension->location() == Manifest::COMPONENT) |
- UpdateKeybindings(extension); |
+ RemoveKeybindingPrefs(extension->id(), std::string()); |
} |
void CommandService::UpdateKeybindingPrefs(const std::string& extension_id, |