Chromium Code Reviews| Index: chrome/browser/extensions/pending_extension_manager.cc |
| diff --git a/chrome/browser/extensions/pending_extension_manager.cc b/chrome/browser/extensions/pending_extension_manager.cc |
| index d4446a95c639f1632d1c6cd5da12d72ef88c1166..fece1bebc2c4ff2b3ecdc72d4a993b01a43f3e59 100644 |
| --- a/chrome/browser/extensions/pending_extension_manager.cc |
| +++ b/chrome/browser/extensions/pending_extension_manager.cc |
| @@ -68,19 +68,22 @@ bool PendingExtensionManager::AddFromSync( |
| void PendingExtensionManager::AddFromExternalUpdateUrl( |
| const std::string& id, const GURL& update_url, |
| - Extension::Location location) { |
| + Extension::Location location, bool overwrite) { |
|
Sam Kerner (Chrome)
2011/08/10 17:21:09
There are two reasons |overwrite| is useful:
1) T
Joao da Silva
2011/08/11 10:03:23
Done.
|
| CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| const bool kIsFromSync = false; |
| const bool kInstallSilently = true; |
| - if (service_.IsExternalExtensionUninstalled(id)) |
| - return; |
| + if (!overwrite) { |
| + if (service_.IsExternalExtensionUninstalled(id)) { |
| + return; |
| + } |
| - if (service_.GetInstalledExtension(id)) { |
| - LOG(DFATAL) << "Trying to add extension " << id |
| - << " by external update, but it is already installed."; |
| - return; |
| + if (service_.GetInstalledExtension(id)) { |
| + LOG(DFATAL) << "Trying to add extension " << id |
| + << " by external update, but it is already installed."; |
| + return; |
| + } |
| } |
| AddExtensionImpl(id, update_url, &AlwaysInstall, |