| 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);
|
| };
|
|
|