Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Unified Diff: chrome/browser/extensions/extension_sync_service.cc

Issue 297263003: Optimize promotion of ephemeral apps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
}

Powered by Google App Engine
This is Rietveld 408576698