Index: chrome/browser/chromeos/kiosk_mode/kiosk_mode_idle_logout.cc |
diff --git a/chrome/browser/chromeos/kiosk_mode/kiosk_mode_idle_logout.cc b/chrome/browser/chromeos/kiosk_mode/kiosk_mode_idle_logout.cc |
index a12dd38497094fbc7a28eb9ac39ddfc2696f554e..90f71ba5748168380f8523af17255d9637606012 100644 |
--- a/chrome/browser/chromeos/kiosk_mode/kiosk_mode_idle_logout.cc |
+++ b/chrome/browser/chromeos/kiosk_mode/kiosk_mode_idle_logout.cc |
@@ -18,33 +18,28 @@ |
#include "content/public/browser/notification_registrar.h" |
#include "content/public/browser/notification_service.h" |
+namespace chromeos { |
+ |
namespace { |
const int64 kLoginIdleTimeout = 100; // seconds |
-} // namespace |
- |
-namespace browser { |
+static base::LazyInstance<KioskModeIdleLogout> |
+ g_kiosk_mode_idle_logout = LAZY_INSTANCE_INITIALIZER; |
-void ShowIdleLogoutDialog() { |
- chromeos::IdleLogoutDialogView::ShowDialog(); |
-} |
+} // namespace |
-void CloseIdleLogoutDialog() { |
- chromeos::IdleLogoutDialogView::CloseDialog(); |
+// static |
+void KioskModeIdleLogout::Initialize() { |
+ g_kiosk_mode_idle_logout.Get(); |
} |
-} // namespace browser |
- |
-namespace chromeos { |
- |
KioskModeIdleLogout::KioskModeIdleLogout() { |
- if (chromeos::KioskModeSettings::Get()->is_initialized()) |
+ if (KioskModeSettings::Get()->is_initialized()) |
Setup(); |
else |
- chromeos::KioskModeSettings::Get()->Initialize( |
- base::Bind(&KioskModeIdleLogout::Setup, |
- base::Unretained(this))); |
+ KioskModeSettings::Get()->Initialize(base::Bind(&KioskModeIdleLogout::Setup, |
+ base::Unretained(this))); |
} |
void KioskModeIdleLogout::Setup() { |
@@ -78,12 +73,12 @@ void KioskModeIdleLogout::IdleNotify(int64 threshold) { |
// the logout dialog if it's still up. |
RequestNextActiveNotification(); |
- browser::ShowIdleLogoutDialog(); |
+ IdleLogoutDialogView::ShowDialog(); |
} |
void KioskModeIdleLogout::ActiveNotify() { |
// Before anything else, close the logout dialog to prevent restart |
- browser::CloseIdleLogoutDialog(); |
+ IdleLogoutDialogView::CloseDialog(); |
// Now that we're active, register a request for notification for |
// the next time we go idle. |
@@ -91,28 +86,21 @@ void KioskModeIdleLogout::ActiveNotify() { |
} |
void KioskModeIdleLogout::SetupIdleNotifications() { |
- chromeos::PowerManagerClient* power_manager = |
- chromeos::DBusThreadManager::Get()->GetPowerManagerClient(); |
+ PowerManagerClient* power_manager = |
+ DBusThreadManager::Get()->GetPowerManagerClient(); |
if (!power_manager->HasObserver(this)) |
power_manager->AddObserver(this); |
} |
void KioskModeIdleLogout::RequestNextActiveNotification() { |
- chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> |
+ DBusThreadManager::Get()->GetPowerManagerClient()-> |
RequestActiveNotification(); |
} |
void KioskModeIdleLogout::RequestNextIdleNotification() { |
- chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> |
- RequestIdleNotification(chromeos::KioskModeSettings::Get()-> |
+ DBusThreadManager::Get()->GetPowerManagerClient()-> |
+ RequestIdleNotification(KioskModeSettings::Get()-> |
GetIdleLogoutTimeout().InMilliseconds()); |
} |
-static base::LazyInstance<KioskModeIdleLogout> |
- g_kiosk_mode_idle_logout = LAZY_INSTANCE_INITIALIZER; |
- |
-void InitializeKioskModeIdleLogout() { |
- g_kiosk_mode_idle_logout.Get(); |
-} |
- |
} // namespace chromeos |