Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / chromeos / kiosk_mode / kiosk_mode_idle_logout.h
blobc35827760328f660cf969a16f5a1f17a3c6b8935
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CHROMEOS_KIOSK_MODE_KIOSK_MODE_IDLE_LOGOUT_H_
6 #define CHROME_BROWSER_CHROMEOS_KIOSK_MODE_KIOSK_MODE_IDLE_LOGOUT_H_
8 #include "ash/wm/user_activity_observer.h"
9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h"
11 #include "base/timer/timer.h"
12 #include "content/public/browser/notification_observer.h"
13 #include "content/public/browser/notification_registrar.h"
15 namespace chromeos {
17 class KioskModeIdleLogout : public ash::UserActivityObserver,
18 public content::NotificationObserver {
19 public:
20 static void Initialize();
22 KioskModeIdleLogout();
23 virtual ~KioskModeIdleLogout();
25 private:
26 friend class KioskModeIdleLogoutTest;
28 // Really initialize idle logout when KioskModeHelper is initialized.
29 void Setup();
31 // Overridden from content::NotificationObserver:
32 virtual void Observe(int type,
33 const content::NotificationSource& source,
34 const content::NotificationDetails& details) OVERRIDE;
36 // UserActivityObserver overrides:
37 virtual void OnUserActivity(const ui::Event* event) OVERRIDE;
39 // Begins listening for user activity and calls ResetTimer().
40 void Start();
42 // Resets |timer_| to fire when the logout dialog should be shown.
43 void ResetTimer();
45 // Invoked by |timer_| to display the logout dialog.
46 void OnTimeout();
48 content::NotificationRegistrar registrar_;
50 base::OneShotTimer<KioskModeIdleLogout> timer_;
52 DISALLOW_COPY_AND_ASSIGN(KioskModeIdleLogout);
55 } // namespace chromeos
57 #endif // CHROME_BROWSER_CHROMEOS_KIOSK_MODE_KIOSK_MODE_IDLE_LOGOUT_H_