Chromium Code Reviews| Index: chrome/browser/extensions/extension_service.cc |
| diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc |
| index b5b7ae9f2abba597de3beb72a565ba886c4efee7..f717c608bc34529c918f8b957bbf4bd1f4332c45 100644 |
| --- a/chrome/browser/extensions/extension_service.cc |
| +++ b/chrome/browser/extensions/extension_service.cc |
| @@ -410,9 +410,20 @@ void ExtensionService::OnExternalExtensionUpdateUrlFound( |
| CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| CHECK(Extension::IdIsValid(id)); |
| - if (GetExtensionById(id, true)) { |
| - // Already installed. Do not change the update URL that the extension set. |
| - return; |
| + const Extension* extension = GetExtensionById(id, true); |
| + if (extension) { |
| + if (location != extension->location() && |
|
Sam Kerner (Chrome)
2011/06/24 20:03:34
Uninstalling wipes any extension state in localsto
gfeher
2011/06/27 12:59:49
Your comment got me thinking. In the case you desc
Sam Kerner (Chrome)
2011/06/27 14:26:30
Yes, we can't do the right thing here without some
|
| + location == Extension::EXTERNAL_POLICY_DOWNLOAD) { |
| + // Already installed, but not as a policy controlled extension. |
| + // Trigger a reainstall to make its location right, and thus disable its |
| + // manual uninstall. |
| + std::string error; |
| + UninstallExtension(extension->id(), false, &error); |
| + } else { |
| + // Already installed. Do not change the update URL that the extension |
| + // set. |
| + return; |
| + } |
| } |
| pending_extension_manager()->AddFromExternalUpdateUrl( |
| id, update_url, location); |