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 "ash/wm/user_activity_detector.h" | 8 #include "ash/wm/user_activity_detector.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
13 #include "chrome/browser/chrome_notification_types.h" | 13 #include "chrome/browser/chrome_notification_types.h" |
14 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" | 14 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" |
15 #include "chrome/browser/chromeos/login/user_manager.h" | 15 #include "chrome/browser/chromeos/login/user_manager.h" |
16 #include "chrome/browser/chromeos/ui/idle_logout_dialog_view.h" | 16 #include "chrome/browser/chromeos/ui/idle_logout_dialog_view.h" |
17 #include "content/public/browser/notification_observer.h" | 17 #include "content/public/browser/notification_observer.h" |
18 #include "content/public/browser/notification_registrar.h" | 18 #include "content/public/browser/notification_registrar.h" |
19 #include "content/public/browser/notification_service.h" | 19 #include "content/public/browser/notification_service.h" |
20 | 20 |
21 namespace chromeos { | 21 namespace chromeos { |
22 | 22 |
23 namespace { | 23 namespace { |
24 | 24 |
25 const int64 kLoginIdleTimeout = 100; // seconds | |
26 | |
27 static base::LazyInstance<KioskModeIdleLogout> | 25 static base::LazyInstance<KioskModeIdleLogout> |
28 g_kiosk_mode_idle_logout = LAZY_INSTANCE_INITIALIZER; | 26 g_kiosk_mode_idle_logout = LAZY_INSTANCE_INITIALIZER; |
29 | 27 |
30 } // namespace | 28 } // namespace |
31 | 29 |
32 // static | 30 // static |
33 void KioskModeIdleLogout::Initialize() { | 31 void KioskModeIdleLogout::Initialize() { |
34 g_kiosk_mode_idle_logout.Get(); | 32 g_kiosk_mode_idle_logout.Get(); |
35 } | 33 } |
36 | 34 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 base::Bind(&KioskModeIdleLogout::OnTimeout, | 89 base::Bind(&KioskModeIdleLogout::OnTimeout, |
92 base::Unretained(this))); | 90 base::Unretained(this))); |
93 } | 91 } |
94 } | 92 } |
95 | 93 |
96 void KioskModeIdleLogout::OnTimeout() { | 94 void KioskModeIdleLogout::OnTimeout() { |
97 IdleLogoutDialogView::ShowDialog(); | 95 IdleLogoutDialogView::ShowDialog(); |
98 } | 96 } |
99 | 97 |
100 } // namespace chromeos | 98 } // namespace chromeos |
OLD | NEW |