Chromium Code Reviews| Index: chrome/browser/chromeos/login/app_launch_controller.cc |
| diff --git a/chrome/browser/chromeos/login/app_launch_controller.cc b/chrome/browser/chromeos/login/app_launch_controller.cc |
| index 7cda1fc3eb69eeecce5dbb5f1491bc5b6c0ace95..6030b78beeae39b9274d1a14decbf3155c1bc37b 100644 |
| --- a/chrome/browser/chromeos/login/app_launch_controller.cc |
| +++ b/chrome/browser/chromeos/login/app_launch_controller.cc |
| @@ -119,6 +119,7 @@ AppLaunchController::AppLaunchController(const std::string& app_id, |
| waiting_for_network_(false), |
| network_wait_timedout_(false), |
| showing_network_dialog_(false), |
| + network_config_requested_(false), |
| launch_splash_start_time_(0) { |
| } |
| @@ -216,11 +217,25 @@ void AppLaunchController::OnCancelAppLaunch() { |
| OnLaunchFailed(KioskAppLaunchError::USER_CANCEL); |
| } |
| +void AppLaunchController::OnNetworkConfigRequested(bool requested) { |
| + LOG(ERROR) << "OnNetworkConfigRequested: " << requested; |
|
xiyuan
2014/03/26 16:24:16
nit: Do we still need the LOG here and around line
zel
2014/03/26 17:30:58
Done.
|
| + network_config_requested_ = requested; |
| + if (requested) |
| + MaybeShowNetworkConfigureUI(); |
| + else |
| + startup_app_launcher_->RestartLauncher(); |
| +} |
| + |
| void AppLaunchController::OnNetworkStateChanged(bool online) { |
| + LOG(ERROR) << "OnNetworkStateChanged: " |
| + << "online: " << online |
| + << ", waiting_for_network_: " << waiting_for_network_ |
| + << ", network_config_requested_: " << network_config_requested_ |
| + << ", network_wait_timedout_: " << network_wait_timedout_; |
| if (!waiting_for_network_) |
| return; |
| - if (online) |
| + if (online && !network_config_requested_) |
| startup_app_launcher_->ContinueWithNetworkReady(); |
| else if (network_wait_timedout_) |
| MaybeShowNetworkConfigureUI(); |
| @@ -300,7 +315,10 @@ bool AppLaunchController::NeedOwnerAuthToConfigureNetwork() { |
| void AppLaunchController::MaybeShowNetworkConfigureUI() { |
| if (CanConfigureNetwork()) { |
| if (NeedOwnerAuthToConfigureNetwork()) { |
| - app_launch_splash_screen_actor_->ToggleNetworkConfig(true); |
| + if (network_config_requested_) |
| + OnConfigureNetwork(); |
| + else |
| + app_launch_splash_screen_actor_->ToggleNetworkConfig(true); |
| } else { |
| showing_network_dialog_ = true; |
| app_launch_splash_screen_actor_->ShowNetworkConfigureUI(); |
| @@ -312,7 +330,7 @@ void AppLaunchController::MaybeShowNetworkConfigureUI() { |
| } |
| void AppLaunchController::InitializeNetwork() { |
| - // Show the network configration dialog if network is not initialized |
| + // Show the network configuration dialog if network is not initialized |
| // after a brief wait time. |
| waiting_for_network_ = true; |
| network_wait_timer_.Start( |
| @@ -357,6 +375,10 @@ void AppLaunchController::OnInstallingApp() { |
| void AppLaunchController::OnReadyToLaunch() { |
| launcher_ready_ = true; |
| + |
| + if (network_config_requested_) |
| + return; |
| + |
| if (!webui_visible_) |
| return; |
| @@ -402,4 +424,9 @@ void AppLaunchController::OnLaunchFailed(KioskAppLaunchError::Error error) { |
| CleanUp(); |
| } |
| +bool AppLaunchController::IsShowingNetworkConfigScreen() { |
| + return network_config_requested_; |
| +} |
| + |
| + |
|
xiyuan
2014/03/26 16:24:16
nit: nuke one empty line
zel
2014/03/26 17:30:58
Done.
|
| } // namespace chromeos |