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 #ifndef CHROME_BROWSER_CHROMEOS_KIOSK_MODE_KIOSK_MODE_IDLE_LOGOUT_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_KIOSK_MODE_KIOSK_MODE_IDLE_LOGOUT_H_ |
6 #define CHROME_BROWSER_CHROMEOS_KIOSK_MODE_KIOSK_MODE_IDLE_LOGOUT_H_ | 6 #define CHROME_BROWSER_CHROMEOS_KIOSK_MODE_KIOSK_MODE_IDLE_LOGOUT_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" |
9 #include "chromeos/dbus/power_manager_client.h" | 10 #include "chromeos/dbus/power_manager_client.h" |
10 #include "content/public/browser/notification_observer.h" | 11 #include "content/public/browser/notification_observer.h" |
11 #include "content/public/browser/notification_registrar.h" | 12 #include "content/public/browser/notification_registrar.h" |
12 | 13 |
13 namespace browser { | |
14 | |
15 // Shows or closes the logout dialog for Kiosk Mode. | |
16 void ShowIdleLogoutDialog(); | |
17 void CloseIdleLogoutDialog(); | |
18 | |
19 } // namespace browser | |
20 | |
21 namespace chromeos { | 14 namespace chromeos { |
22 | 15 |
23 class KioskModeIdleLogout : public PowerManagerClient::Observer, | 16 class KioskModeIdleLogout : public PowerManagerClient::Observer, |
24 public content::NotificationObserver { | 17 public content::NotificationObserver { |
25 public: | 18 public: |
| 19 static void Initialize(); |
| 20 |
26 KioskModeIdleLogout(); | 21 KioskModeIdleLogout(); |
27 | 22 |
| 23 private: |
| 24 friend class KioskModeIdleLogoutTest; |
| 25 |
28 // Really initialize idle logout when KioskModeHelper is initialized. | 26 // Really initialize idle logout when KioskModeHelper is initialized. |
29 void Setup(); | 27 void Setup(); |
30 | 28 |
31 // NotificationObserver overrides: | 29 // Overridden from content::NotificationObserver: |
32 virtual void Observe(int type, | 30 virtual void Observe(int type, |
33 const content::NotificationSource& source, | 31 const content::NotificationSource& source, |
34 const content::NotificationDetails& details) OVERRIDE; | 32 const content::NotificationDetails& details) OVERRIDE; |
35 | 33 |
36 // PowerManagerClient::Observer overrides: | 34 // Overridden from PowerManagerClient::Observer: |
37 virtual void IdleNotify(int64 threshold) OVERRIDE; | 35 virtual void IdleNotify(int64 threshold) OVERRIDE; |
38 virtual void ActiveNotify() OVERRIDE; | 36 virtual void ActiveNotify() OVERRIDE; |
39 | 37 |
40 private: | |
41 friend class KioskModeIdleLogoutTest; | |
42 content::NotificationRegistrar registrar_; | |
43 | |
44 void SetupIdleNotifications(); | 38 void SetupIdleNotifications(); |
45 void RequestNextActiveNotification(); | 39 void RequestNextActiveNotification(); |
46 void RequestNextIdleNotification(); | 40 void RequestNextIdleNotification(); |
47 | 41 |
| 42 content::NotificationRegistrar registrar_; |
| 43 |
48 DISALLOW_COPY_AND_ASSIGN(KioskModeIdleLogout); | 44 DISALLOW_COPY_AND_ASSIGN(KioskModeIdleLogout); |
49 }; | 45 }; |
50 | 46 |
51 void InitializeKioskModeIdleLogout(); | |
52 | |
53 } // namespace chromeos | 47 } // namespace chromeos |
54 | 48 |
55 #endif // CHROME_BROWSER_CHROMEOS_KIOSK_MODE_KIOSK_MODE_IDLE_LOGOUT_H_ | 49 #endif // CHROME_BROWSER_CHROMEOS_KIOSK_MODE_KIOSK_MODE_IDLE_LOGOUT_H_ |
OLD | NEW |