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

Unified Diff: chrome/browser/chromeos/app_mode/startup_app_launcher.cc

Issue 1869483002: kiosk: Defer app update until platform matches (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: for comments from jenny 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/chromeos/app_mode/startup_app_launcher.cc
diff --git a/chrome/browser/chromeos/app_mode/startup_app_launcher.cc b/chrome/browser/chromeos/app_mode/startup_app_launcher.cc
index 2f67c0e956d69c9900ab30d31ef02949219e422b..3eb88a0c07944b6c1c12d78e9c0db8010f39e455 100644
--- a/chrome/browser/chromeos/app_mode/startup_app_launcher.cc
+++ b/chrome/browser/chromeos/app_mode/startup_app_launcher.cc
@@ -269,7 +269,8 @@ void StartupAppLauncher::MaybeCheckExtensionUpdate() {
extensions::ExtensionSystem::Get(profile_)
->extension_service()
->updater();
- if (!delegate_->IsNetworkReady() || !updater) {
+ if (!delegate_->IsNetworkReady() || !updater ||
+ PrimaryAppHasPendingUpdate()) {
MaybeLaunchApp();
return;
}
@@ -405,6 +406,12 @@ bool StartupAppLauncher::HasSecondaryApps() const {
return extensions::KioskModeInfo::HasSecondaryApps(extension);
}
+bool StartupAppLauncher::PrimaryAppHasPendingUpdate() const {
+ return !!extensions::ExtensionSystem::Get(profile_)
+ ->extension_service()
+ ->GetPendingExtensionUpdate(app_id_);
+}
+
bool StartupAppLauncher::DidPrimaryOrSecondaryAppFailedToInstall(
bool success,
const std::string& id) const {
@@ -536,11 +543,16 @@ void StartupAppLauncher::MaybeInstallSecondaryApps() {
void StartupAppLauncher::OnReadyToLaunch() {
ready_to_launch_ = true;
- UpdateAppData();
+ MaybeUpdateAppData();
delegate_->OnReadyToLaunch();
}
-void StartupAppLauncher::UpdateAppData() {
+void StartupAppLauncher::MaybeUpdateAppData() {
+ // Skip copying meta data from the current installed primary app when
+ // there is a pending update.
+ if (PrimaryAppHasPendingUpdate())
+ return;
+
KioskAppManager::Get()->ClearAppData(app_id_);
KioskAppManager::Get()->UpdateAppDataFromProfile(app_id_, profile_, NULL);
}
« no previous file with comments | « chrome/browser/chromeos/app_mode/startup_app_launcher.h ('k') | chrome/browser/chromeos/login/kiosk_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698