| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chromeos/kiosk_mode/kiosk_mode_idle_logout.h" | 5 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_idle_logout.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 } | 41 } |
| 42 } | 42 } |
| 43 | 43 |
| 44 KioskModeIdleLogout::~KioskModeIdleLogout() { | 44 KioskModeIdleLogout::~KioskModeIdleLogout() { |
| 45 if (ash::Shell::HasInstance() && | 45 if (ash::Shell::HasInstance() && |
| 46 ash::Shell::GetInstance()->user_activity_detector()->HasObserver(this)) | 46 ash::Shell::GetInstance()->user_activity_detector()->HasObserver(this)) |
| 47 ash::Shell::GetInstance()->user_activity_detector()->RemoveObserver(this); | 47 ash::Shell::GetInstance()->user_activity_detector()->RemoveObserver(this); |
| 48 } | 48 } |
| 49 | 49 |
| 50 void KioskModeIdleLogout::Setup() { | 50 void KioskModeIdleLogout::Setup() { |
| 51 if (UserManager::Get()->IsLoggedInAsDemoUser()) { | 51 if (GetUserManager()->IsLoggedInAsDemoUser()) { |
| 52 // This means that we're recovering from a crash. The user is already | 52 // This means that we're recovering from a crash. The user is already |
| 53 // logged in, so go ahead and start the timer. | 53 // logged in, so go ahead and start the timer. |
| 54 Start(); | 54 Start(); |
| 55 } else { | 55 } else { |
| 56 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_CHANGED, | 56 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_CHANGED, |
| 57 content::NotificationService::AllSources()); | 57 content::NotificationService::AllSources()); |
| 58 } | 58 } |
| 59 } | 59 } |
| 60 | 60 |
| 61 void KioskModeIdleLogout::Observe( | 61 void KioskModeIdleLogout::Observe( |
| (...skipping 27 matching lines...) Expand all Loading... |
| 89 base::Bind(&KioskModeIdleLogout::OnTimeout, | 89 base::Bind(&KioskModeIdleLogout::OnTimeout, |
| 90 base::Unretained(this))); | 90 base::Unretained(this))); |
| 91 } | 91 } |
| 92 } | 92 } |
| 93 | 93 |
| 94 void KioskModeIdleLogout::OnTimeout() { | 94 void KioskModeIdleLogout::OnTimeout() { |
| 95 IdleLogoutDialogView::ShowDialog(); | 95 IdleLogoutDialogView::ShowDialog(); |
| 96 } | 96 } |
| 97 | 97 |
| 98 } // namespace chromeos | 98 } // namespace chromeos |
| OLD | NEW |