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

Unified Diff: chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.cc

Issue 11363109: Check for login screen availibility before showing spinner. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.cc
diff --git a/chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.cc b/chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.cc
index b8af080d9695ef9fc214f227832bee6448916d8f..cfecb722ddb03ce4853aa1b9f126f435755d5e25 100644
--- a/chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.cc
+++ b/chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.cc
@@ -177,7 +177,7 @@ void KioskModeScreensaver::SetupScreensaver(
extension_base_path_ = extension_base_path;
// If the user is already logged in, don't need to display the screensaver.
- if (chromeos::UserManager::Get()->IsUserLoggedIn())
+ if (chromeos::UserManager::Get()->IsSessionStarted())
Nikita (slow) 2012/11/07 10:51:37 Difference between these two is that IsSessionStar
rkc 2012/11/07 20:25:02 IsSessionStarted seemed more appropriate (since it
return;
ash::Shell::GetInstance()->user_activity_detector()->AddObserver(this);
@@ -199,15 +199,16 @@ void KioskModeScreensaver::OnUserActivity() {
ash::Shell::GetInstance()->user_activity_detector()->RemoveObserver(this);
// Find the retail mode login page.
- CHECK(WebUILoginDisplayHost::default_host());
- WebUILoginDisplayHost* webui_host =
- static_cast<WebUILoginDisplayHost*>(
- WebUILoginDisplayHost::default_host());
- OobeUI* oobe_ui = webui_host->GetOobeUI();
-
- // Show the login spinner.
- CHECK(oobe_ui);
- oobe_ui->ShowRetailModeLoginSpinner();
+ if (WebUILoginDisplayHost::default_host()) {
Nikita (slow) 2012/11/07 10:51:37 If default_host is gone now I believe login alread
rkc 2012/11/07 20:25:02 If you're certain that is the only case that the d
+ WebUILoginDisplayHost* webui_host =
+ static_cast<WebUILoginDisplayHost*>(
+ WebUILoginDisplayHost::default_host());
+ OobeUI* oobe_ui = webui_host->GetOobeUI();
+
+ // Show the login spinner.
+ if (oobe_ui)
+ oobe_ui->ShowRetailModeLoginSpinner();
+ }
// Close the screensaver, our login spinner is already showing.
ash::CloseScreensaver();
@@ -215,8 +216,8 @@ void KioskModeScreensaver::OnUserActivity() {
// Log us in.
ExistingUserController* controller =
ExistingUserController::current_controller();
- CHECK(controller);
- controller->LoginAsDemoUser();
+ if (controller && !chromeos::UserManager::Get()->IsSessionStarted())
+ controller->LoginAsDemoUser();
ShutdownKioskModeScreensaver();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698