Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1083)

Unified Diff: chrome/browser/chromeos/idle_detector.h

Issue 156493004: Add the ability to show a demo app on OOBE if a machine is derelict. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/idle_detector.h
diff --git a/chrome/browser/chromeos/idle_detector.h b/chrome/browser/chromeos/idle_detector.h
new file mode 100644
index 0000000000000000000000000000000000000000..e585c405491654f480856e1020ad7ab8381837e0
--- /dev/null
+++ b/chrome/browser/chromeos/idle_detector.h
@@ -0,0 +1,42 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_IDLE_DETECTOR_H_
+#define CHROME_BROWSER_CHROMEOS_IDLE_DETECTOR_H_
+
+#include "ash/wm/user_activity_observer.h"
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "base/timer/timer.h"
+
+namespace chromeos {
+
+class IdleDetector : public ash::UserActivityObserver {
bartfab (slow) 2014/02/13 19:51:53 The location and name of this file imply that it i
rkc 2014/02/13 23:22:01 UserActivityDetector is used multiple places in th
+ public:
+ IdleDetector(const base::Closure& on_active_callback,
bartfab (slow) 2014/02/13 19:51:53 What is |on_active_callback| meant for? Nobody eve
rkc 2014/02/13 23:22:01 This code is entirely reusable for the idle_logout
bartfab (slow) 2014/02/17 15:53:46 As discussed offline, the retail mode idle logout
+ const base::Closure& on_idle_callback);
+ virtual ~IdleDetector();
+
+ void Start(const base::TimeDelta& timeout);
+
+ private:
+ // UserActivityObserver overrides:
+ virtual void OnUserActivity(const ui::Event* event) OVERRIDE;
+
+ // Resets |timer_| to fire when we reach our idle timeout.
+ void ResetTimer();
+
+ base::OneShotTimer<IdleDetector> timer_;
+
+ base::Closure active_callback_;
bartfab (slow) 2014/02/13 19:51:53 Nit: #include "base/callback.h"
rkc 2014/02/13 23:22:01 Done.
+ base::Closure idle_callback_;
+
+ base::TimeDelta timeout_;
bartfab (slow) 2014/02/13 19:51:53 Nit: #include "base/time.h"
rkc 2014/02/13 23:22:01 Done.
+
+ DISALLOW_COPY_AND_ASSIGN(IdleDetector);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_IDLE_DETECTOR_H_

Powered by Google App Engine
This is Rietveld 408576698