| Index: base/idle_timer.h
|
| ===================================================================
|
| --- base/idle_timer.h (revision 2086)
|
| +++ 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 // OS_WIN
|
|
|
| #include "base/basictypes.h"
|
| #include "base/task.h"
|
| @@ -37,7 +39,7 @@
|
| namespace base {
|
|
|
| // Function prototype for GetLastInputInfo.
|
| -typedef BOOL (__stdcall *GetLastInputInfoFunction)(PLASTINPUTINFO plii);
|
| +typedef bool (*GetIdleTimeFunction)(int32* milliseconds);
|
|
|
| class IdleTimer {
|
| public:
|
| @@ -61,8 +63,8 @@
|
|
|
| protected:
|
| // Override the GetLastInputInfo function.
|
| - void set_last_input_info_fn(GetLastInputInfoFunction function) {
|
| - get_last_input_info_fn_ = function;
|
| + void set_idle_time_fn(GetIdleTimeFunction function) {
|
| + get_idle_time_fn_ = function;
|
| }
|
|
|
| private:
|
| @@ -78,13 +80,26 @@
|
| // Compute time until idle. Returns 0 if we are now idle.
|
| TimeDelta TimeUntilIdle();
|
|
|
| +#if defined(OS_LINUX)
|
| + struct XssInfoLazyInstanceTraits {
|
| + static void New(void* instance);
|
| + static void Delete(void* instance);
|
| + };
|
| + struct XssInfo {
|
| + bool have_xss;
|
| + ThreadLocalPointer<XScreenSaverInfo> xss_info;
|
| + };
|
| +#endif // OS_LINUX
|
| +
|
| + static bool DefaultIdleTimeFunction(int32* milliseconds);
|
| +
|
| TimeDelta idle_interval_;
|
| bool repeat_;
|
| Time last_time_fired_; // The last time the idle timer fired.
|
| // will be 0 until the timer fires the first time.
|
| OneShotTimer<IdleTimer> timer_;
|
|
|
| - GetLastInputInfoFunction get_last_input_info_fn_;
|
| + GetIdleTimeFunction get_idle_time_fn_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(IdleTimer);
|
| };
|
|
|