Chromium Code Reviews| 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..f02f3b02cc1e1cc6e414b44f61596bf1a95c15dc 100644 |
| --- a/chrome/browser/extensions/api/commands/command_service.cc |
| +++ b/chrome/browser/extensions/api/commands/command_service.cc |
| @@ -300,7 +300,10 @@ void CommandService::OnExtensionWillBeInstalled( |
| bool is_update, |
| bool from_ephemeral, |
| const std::string& old_name) { |
| - UpdateKeybindings(extension); |
| + // Component extensions don't generate normal install and uninstall events so |
| + // those are handled in loaded. |
|
Finnur
2015/01/08 14:13:50
s/in loaded/in OnExtensionLoaded/
David Tseng
2015/01/08 20:34:41
Done.
|
| + if (extension->location() != Manifest::COMPONENT) |
| + UpdateKeybindings(extension); |
| } |
| void CommandService::OnExtensionUninstalled( |
| @@ -310,6 +313,12 @@ void CommandService::OnExtensionUninstalled( |
| RemoveKeybindingPrefs(extension->id(), std::string()); |
| } |
| +void CommandService::OnExtensionLoaded(content::BrowserContext* browser_context, |
| + const Extension* extension) { |
| + if (extension->location() == Manifest::COMPONENT) |
| + UpdateKeybindings(extension); |
| +} |
| + |
| void CommandService::UpdateKeybindingPrefs(const std::string& extension_id, |
| const std::string& command_name, |
| const std::string& keystroke) { |