Chromium Code Reviews| 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 6fe2fb7ded488bcd9f3e0ec65a98570f6023b3e9..cb18be2d59c4049075a92323913a7c8de434cd34 100644 |
| --- a/chrome/browser/chromeos/app_mode/startup_app_launcher.cc |
| +++ b/chrome/browser/chromeos/app_mode/startup_app_launcher.cc |
| @@ -96,14 +96,21 @@ void StartupAppLauncher::Initialize() { |
| } |
| void StartupAppLauncher::ContinueWithNetworkReady() { |
| - if (!network_ready_handled_) { |
| - network_ready_handled_ = true; |
| - // The network might not be ready when KioskAppManager tries to update |
| - // external cache initially. Update the external cache now that the network |
| - // is ready for sure. |
| - wait_for_crx_update_ = true; |
| - KioskAppManager::Get()->UpdateExternalCache(); |
| + if (network_ready_handled_) |
| + return; |
| + |
| + network_ready_handled_ = true; |
| + |
| + if (!delegate_->ShouldUpdateCacheOnNetworkReady()) { |
| + BeginInstall(); |
|
xiyuan
2017/01/30 23:13:06
Should we skip all installation stuff and jump to
tbarzic
2017/01/30 23:45:21
I'm slightly concerned that in certain situations
xiyuan
2017/01/30 23:49:44
Good point. BeginInstall() it is then.
tbarzic
2017/01/30 23:55:02
Actually, we should only end up in that state if t
xiyuan
2017/01/30 23:59:48
SG.
|
| + return; |
| } |
| + |
| + // The network might not be ready when KioskAppManager tries to update |
| + // external cache initially. Update the external cache now that the network |
| + // is ready for sure. |
| + wait_for_crx_update_ = true; |
| + KioskAppManager::Get()->UpdateExternalCache(); |
| } |
| void StartupAppLauncher::StartLoadingOAuthFile() { |
| @@ -271,7 +278,8 @@ void StartupAppLauncher::MaybeCheckExtensionUpdate() { |
| extensions::ExtensionSystem::Get(profile_) |
| ->extension_service() |
| ->updater(); |
| - if (!delegate_->IsNetworkReady() || !updater || |
| + if (!delegate_->IsNetworkReady() || |
| + !delegate_->ShouldUpdateCacheOnNetworkReady() || !updater || |
| PrimaryAppHasPendingUpdate()) { |
| MaybeLaunchApp(); |
| return; |