| 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..d7551c67adfe80121405937321a24372821fcce9 100644
|
| --- a/chrome/browser/extensions/api/commands/command_service.cc
|
| +++ b/chrome/browser/extensions/api/commands/command_service.cc
|
| @@ -300,14 +300,24 @@ 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
|
| + // key binding updates occur in loaded.
|
| + if (extension->location() != Manifest::COMPONENT)
|
| + 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::UpdateKeybindingPrefs(const std::string& extension_id,
|
|
|