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

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

Issue 1869483002: kiosk: Defer app update until platform matches (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 018b5d67f65ca6d17bbc20944290d43685b1000c..3a0c4a7f50ed598d80550fcb52a0629bf9ccfd03 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -99,6 +99,7 @@
#endif
#if defined(OS_CHROMEOS)
+#include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
#include "chrome/browser/chromeos/extensions/install_limiter.h"
#include "storage/browser/fileapi/file_system_backend.h"
#include "storage/browser/fileapi/file_system_context.h"
@@ -1812,6 +1813,26 @@ void ExtensionService::OnExtensionInstalled(
install_parameter);
delayed_installs_.Insert(extension);
}
+#if defined(OS_CHROMEOS)
+ } else if (!chromeos::KioskAppManager::Get()->IsPlatformCompliantWithApp(
+ extension) &&
+ !!GetInstalledExtension(extension->id())) {
+ // Delay updating of an existing extension when required platform version
+ // of the new extension is not compliant.
+ extension_prefs_->SetDelayedInstallInfo(
+ extension,
+ initial_state,
+ install_flags,
+ extensions::ExtensionPrefs::DELAY_REASON_WAIT_FOR_OS_UPDATE,
+ page_ordinal,
+ install_parameter);
+ delayed_installs_.Insert(extension);
+
+ // Updates the required platform version meta data to allow update engine
+ // to move on to the new OS version.
+ chromeos::KioskAppManager::Get()->UpdateAppDataFromProfile(
+ extension->id(), profile(), extension);
+#endif
asargent_no_longer_on_chrome 2016/04/06 19:32:23 This function is already getting kind of long and
xiyuan 2016/04/19 18:38:54 Done.
} else {
AddNewOrUpdatedExtension(extension,
initial_state,
@@ -1898,6 +1919,14 @@ void ExtensionService::MaybeFinishDelayedInstallation(
}
}
+#if defined(OS_CHROMEOS)
+ if (reason == extensions::ExtensionPrefs::DELAY_REASON_WAIT_FOR_OS_UPDATE &&
+ !chromeos::KioskAppManager::Get()->IsPlatformCompliantWithApp(
+ extension)) {
+ return;
+ }
+#endif
+
FinishDelayedInstallation(extension_id);
}

Powered by Google App Engine
This is Rietveld 408576698