Chromium Code Reviews| Index: chrome/browser/extensions/extension_sync_service.cc |
| diff --git a/chrome/browser/extensions/extension_sync_service.cc b/chrome/browser/extensions/extension_sync_service.cc |
| index ae8b8197a192603006df60fd318f7c8adaf1e0e1..59360548f283a8b5102306ce7a7270e558f7924a 100644 |
| --- a/chrome/browser/extensions/extension_sync_service.cc |
| +++ b/chrome/browser/extensions/extension_sync_service.cc |
| @@ -495,15 +495,23 @@ bool ExtensionSyncService::ProcessExtensionSyncDataHelper( |
| // incognito flag invalidates the |extension| pointer (it reloads the |
| // extension). |
| bool extension_installed = (extension != NULL); |
| - int result = extension ? |
| + int version_compare_result = extension ? |
| extension->version()->CompareTo(extension_sync_data.version()) : 0; |
| + |
| + // If the target extension has already been installed ephemerally, it can |
| + // be promoted to a regular installed extension and downloading from the Web |
| + // Store is not necessary. |
| + if (extension && extensions::util::IsEphemeralApp(id, profile_)) |
| + extension_service_->InstallEphemeralApp(extension, false); |
|
benwells
2014/05/27 01:42:56
Is this code path tested at all?
tmdiep
2014/05/27 07:46:05
Done.
|
| + |
| + // Update the incognito flag. |
| extensions::util::SetIsIncognitoEnabled( |
| id, profile_, extension_sync_data.incognito_enabled()); |
| extension = NULL; // No longer safe to use. |
| if (extension_installed) { |
| // If the extension is already installed, check if it's outdated. |
| - if (result < 0) { |
| + if (version_compare_result < 0) { |
| // Extension is outdated. |
| return false; |
| } |