OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/webui/chromeos/login/app_launch_splash_screen_handle
r.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/app_launch_splash_screen_handle
r.h" |
6 | 6 |
7 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 7 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
8 #include "chrome/browser/chromeos/login/screens/error_screen_actor.h" | 8 #include "chrome/browser/chromeos/login/screens/error_screen_actor.h" |
9 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 9 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
10 #include "chromeos/network/network_state.h" | 10 #include "chromeos/network/network_state.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 171 |
172 OobeUI::Screen screen = OobeUI::SCREEN_UNKNOWN; | 172 OobeUI::Screen screen = OobeUI::SCREEN_UNKNOWN; |
173 OobeUI* oobe_ui = static_cast<OobeUI*>(web_ui()->GetController()); | 173 OobeUI* oobe_ui = static_cast<OobeUI*>(web_ui()->GetController()); |
174 if (oobe_ui) | 174 if (oobe_ui) |
175 screen = oobe_ui->current_screen(); | 175 screen = oobe_ui->current_screen(); |
176 | 176 |
177 if (screen != OobeUI::SCREEN_ERROR_MESSAGE) | 177 if (screen != OobeUI::SCREEN_ERROR_MESSAGE) |
178 error_screen_actor_->Show(OobeDisplay::SCREEN_APP_LAUNCH_SPLASH, NULL); | 178 error_screen_actor_->Show(OobeDisplay::SCREEN_APP_LAUNCH_SPLASH, NULL); |
179 } | 179 } |
180 | 180 |
| 181 bool AppLaunchSplashScreenHandler::IsNetworkReady() { |
| 182 return network_state_informer_->state() == NetworkStateInformer::ONLINE; |
| 183 } |
| 184 |
181 void AppLaunchSplashScreenHandler::OnNetworkReady() { | 185 void AppLaunchSplashScreenHandler::OnNetworkReady() { |
182 // Purposely leave blank because the online case is handled in UpdateState | 186 // Purposely leave blank because the online case is handled in UpdateState |
183 // call below. | 187 // call below. |
184 } | 188 } |
185 | 189 |
186 void AppLaunchSplashScreenHandler::UpdateState( | 190 void AppLaunchSplashScreenHandler::UpdateState( |
187 ErrorScreenActor::ErrorReason reason) { | 191 ErrorScreenActor::ErrorReason reason) { |
188 if (!delegate_ || | 192 if (!delegate_ || |
189 (state_ != APP_LAUNCH_STATE_PREPARING_NETWORK && | 193 (state_ != APP_LAUNCH_STATE_PREPARING_NETWORK && |
190 state_ != APP_LAUNCH_STATE_NETWORK_WAIT_TIMEOUT)) { | 194 state_ != APP_LAUNCH_STATE_NETWORK_WAIT_TIMEOUT)) { |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 } | 247 } |
244 | 248 |
245 void AppLaunchSplashScreenHandler::HandleCancelAppLaunch() { | 249 void AppLaunchSplashScreenHandler::HandleCancelAppLaunch() { |
246 if (delegate_) | 250 if (delegate_) |
247 delegate_->OnCancelAppLaunch(); | 251 delegate_->OnCancelAppLaunch(); |
248 else | 252 else |
249 LOG(WARNING) << "No delegate set to handle cancel app launch"; | 253 LOG(WARNING) << "No delegate set to handle cancel app launch"; |
250 } | 254 } |
251 | 255 |
252 } // namespace chromeos | 256 } // namespace chromeos |
OLD | NEW |