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

Unified Diff: base/idle_timer.h

Issue 7243: Bring up idletimer unittest on Mac port. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 2 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
« no previous file with comments | « base/base.xcodeproj/project.pbxproj ('k') | base/idle_timer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/idle_timer.h
===================================================================
--- base/idle_timer.h (revision 3254)
+++ base/idle_timer.h (working copy)
@@ -28,7 +28,9 @@
#ifndef BASE_IDLE_TIMER_H_
#define BASE_IDLE_TIMER_H_
+#if defined(OS_WIN)
#include <windows.h>
+#endif
#include "base/basictypes.h"
#include "base/task.h"
@@ -36,8 +38,9 @@
namespace base {
-// Function prototype for GetLastInputInfo.
-typedef BOOL (__stdcall *GetLastInputInfoFunction)(PLASTINPUTINFO plii);
+// Function prototype - Get the number of milliseconds that the user has been
+// idle.
+typedef bool (*IdleTimeSource)(int32 *milliseconds_interval_since_last_event);
class IdleTimer {
public:
@@ -60,9 +63,9 @@
virtual void OnIdle() = 0;
protected:
- // Override the GetLastInputInfo function.
- void set_last_input_info_fn(GetLastInputInfoFunction function) {
- get_last_input_info_fn_ = function;
+ // Override the IdleTimeSource.
+ void set_idle_time_source(IdleTimeSource idle_time_source) {
+ idle_time_source_ = idle_time_source;
}
private:
@@ -84,7 +87,7 @@
// will be 0 until the timer fires the first time.
OneShotTimer<IdleTimer> timer_;
- GetLastInputInfoFunction get_last_input_info_fn_;
+ IdleTimeSource idle_time_source_;
DISALLOW_COPY_AND_ASSIGN(IdleTimer);
};
« no previous file with comments | « base/base.xcodeproj/project.pbxproj ('k') | base/idle_timer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698