diff options
author | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-13 23:03:36 +0000 |
---|---|---|
committer | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-13 23:03:36 +0000 |
commit | 806ca33bec1bf4d618d5ae6814f297ea027e72da (patch) | |
tree | cd1e89acc52d42984711c7410e9b7181cff9f5e6 /base/idle_timer.h | |
parent | 75b537e299ea0c8993d08230719799bba05380e0 (diff) | |
download | chromium_src-806ca33bec1bf4d618d5ae6814f297ea027e72da.zip chromium_src-806ca33bec1bf4d618d5ae6814f297ea027e72da.tar.gz chromium_src-806ca33bec1bf4d618d5ae6814f297ea027e72da.tar.bz2 |
Bring up idletimer unittest on Mac port.
Review URL: http://codereview.chromium.org/7243
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3328 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/idle_timer.h')
-rw-r--r-- | base/idle_timer.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/base/idle_timer.h b/base/idle_timer.h index 7b9446e..355c217 100644 --- a/base/idle_timer.h +++ b/base/idle_timer.h @@ -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 @@ class IdleTimer { 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 @@ class IdleTimer { // 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); }; |