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 6425c251fc1699da0aa5feab1ac590a19d973280..74f1676d1dd728ca667703c796bacc62276e60dd 100644 |
| --- a/chrome/browser/extensions/extension_service.cc |
| +++ b/chrome/browser/extensions/extension_service.cc |
| @@ -2261,13 +2261,19 @@ bool ExtensionService::OnExternalExtensionFileFound( |
| if (extension_prefs_->IsExternalExtensionUninstalled(id)) |
| return false; |
| - DCHECK(version); |
| - |
| // Before even bothering to unpack, check and see if we already have this |
| // version. This is important because these extensions are going to get |
| // installed on every startup. |
| const Extension* existing = GetExtensionById(id, true); |
| - if (existing) { |
| + |
| + // The default apps will have the location set as INTERNAL. Since older |
| + // default apps are installed as EXTERNAL, we override them. However, if the |
| + // app is already installed as internal, then do the version check. |
| + if (existing && (location != Extension::INTERNAL || |
|
Mihai Parparita -not on Chrome
2012/08/15 00:32:13
I found this boolean expression hard to read becau
|
| + !Extension::IsExternalLocation(existing->location()))) { |
| + |
| + DCHECK(version); |
| + |
| switch (existing->version()->CompareTo(*version)) { |
| case -1: // existing version is older, we should upgrade |
| break; |
| @@ -2276,8 +2282,8 @@ bool ExtensionService::OnExternalExtensionFileFound( |
| case 1: // existing version is newer, uh-oh |
| LOG(WARNING) << "Found external version of extension " << id |
| << "that is older than current version. Current version " |
| - << "is: " << existing->VersionString() << ". New version " |
| - << "is: " << version->GetString() |
| + << "is: " << existing->VersionString() << ". New " |
| + << "version is: " << version->GetString() |
| << ". Keeping current version."; |
| return false; |
| } |