1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_IDLE_H_
6 #define CHROME_BROWSER_IDLE_H_
8 #include "base/callback.h"
11 IDLE_STATE_ACTIVE
= 0,
12 IDLE_STATE_IDLE
= 1, // No activity within threshold.
13 IDLE_STATE_LOCKED
= 2, // Only available on supported systems.
14 IDLE_STATE_UNKNOWN
= 3 // Used when waiting for the Idle state or in error
18 // For MacOSX, InitIdleMonitor needs to be called first to setup the monitor.
19 // StopIdleMonitor should be called if it is not needed any more.
20 #if defined(OS_MACOSX)
21 void InitIdleMonitor();
22 void StopIdleMonitor();
25 typedef base::Callback
<void(IdleState
)> IdleCallback
;
27 // Calculate the Idle state and notify the callback.
28 void CalculateIdleState(unsigned int idle_threshold
, IdleCallback notify
);
30 // Checks synchronously if Idle state is IDLE_STATE_LOCKED.
31 bool CheckIdleStateIsLocked();
33 #endif // CHROME_BROWSER_IDLE_H_