Chromium Code Reviews| Index: chrome/browser/extensions/api/management/management_api.cc |
| diff --git a/chrome/browser/extensions/api/management/management_api.cc b/chrome/browser/extensions/api/management/management_api.cc |
| index 86f67ef9684dfffc23e434167800577d11766a4e..fa6a0ffd5c0cc6b5de5566a9d54a15b324fb5692 100644 |
| --- a/chrome/browser/extensions/api/management/management_api.cc |
| +++ b/chrome/browser/extensions/api/management/management_api.cc |
| @@ -580,13 +580,22 @@ void ManagementUninstallFunctionBase::SetAutoConfirmForTest( |
| void ManagementUninstallFunctionBase::Finish(bool should_uninstall) { |
| if (should_uninstall) { |
| - bool success = service()->UninstallExtension( |
| - extension_id_, |
| - false, /* external uninstall */ |
| - NULL); |
| + // The extension can be uninstalled in another window while the UI was |
| + // showing. Do nothing in that case. |
|
not at google - send to devlin
2014/05/16 22:11:00
Do we have any tests which actually exercise the U
Marijn Kruisselbrink
2014/05/16 22:19:12
I think in tests we bypass the dialog, and behave
|
| + ExtensionRegistry* registry = ExtensionRegistry::Get(GetProfile()); |
| + const Extension* extension = registry->GetExtensionById( |
| + extension_id_, ExtensionRegistry::EVERYTHING); |
| + if (!extension) { |
|
not at google - send to devlin
2014/05/16 22:11:00
emulate the extension not being there by using kNo
Marijn Kruisselbrink
2014/05/16 22:19:12
Done.
|
| + SendResponse(false); |
| + } else { |
| + bool success = |
| + service()->UninstallExtension(extension_id_, |
|
not at google - send to devlin
2014/05/16 22:11:00
what kind of behaviour do we have in ExtensionServ
Marijn Kruisselbrink
2014/05/16 22:19:12
It is a CHECK failure already.
|
| + false, /* external uninstall */ |
| + NULL); |
| - // TODO set error_ if !success |
| - SendResponse(success); |
| + // TODO set error_ if !success |
| + SendResponse(success); |
| + } |
| } else { |
| error_ = ErrorUtils::FormatErrorMessage( |
| keys::kUninstallCanceledError, extension_id_); |