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 55c0be6f35e1e314871f044dfcc6003ccac3b46f..f2962cc58c63fc52eed5b73304ed978dec2ddaf4 100644 |
| --- a/chrome/browser/extensions/api/commands/command_service.cc |
| +++ b/chrome/browser/extensions/api/commands/command_service.cc |
| @@ -308,23 +308,17 @@ 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) |
|
Finnur
2015/02/18 11:51:31
It is good to see these special-cases go away.
|
| - UpdateKeybindings(extension); |
| + UpdateKeybindings(extension); |
| } |
| void CommandService::OnExtensionUninstalled( |
| content::BrowserContext* browser_context, |
| const Extension* extension, |
| extensions::UninstallReason reason) { |
| - RemoveKeybindingPrefs(extension->id(), std::string()); |
| -} |
| + if (reason == extensions::UNINSTALL_REASON_COMPONENT) |
| + return; |
|
Finnur
2015/02/18 11:51:31
A casual reader would benefit from an explanation
David Tseng
2015/02/18 18:24:40
Correct.
tapted
2015/02/18 23:10:55
Wow - those were some of my first patches on Chrom
David Tseng
2015/02/18 23:22:26
It does get triggered, but only on a version upgra
|
| -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, |