blob: d558960ef775476abadffa2ea93c9f43b1b1990f [file] [log] [blame]
[email protected]08b14a52012-07-02 23:30:361// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]f5205412010-03-16 00:19:342// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CHROME_BROWSER_IDLE_H_
6#define CHROME_BROWSER_IDLE_H_
[email protected]f5205412010-03-16 00:19:347
[email protected]97156b72011-08-18 13:32:128#include "base/callback.h"
9
[email protected]f5205412010-03-16 00:19:3410enum IdleState {
11 IDLE_STATE_ACTIVE = 0,
[email protected]9e5fbc92011-12-09 11:40:4912 IDLE_STATE_IDLE = 1, // No activity within threshold.
[email protected]97156b72011-08-18 13:32:1213 IDLE_STATE_LOCKED = 2, // Only available on supported systems.
14 IDLE_STATE_UNKNOWN = 3 // Used when waiting for the Idle state or in error
15 // conditions
[email protected]f5205412010-03-16 00:19:3416};
17
[email protected]3c645372011-01-25 20:54:0618// For MacOSX, InitIdleMonitor needs to be called first to setup the monitor.
[email protected]3c645372011-01-25 20:54:0619#if defined(OS_MACOSX)
20void InitIdleMonitor();
[email protected]3c645372011-01-25 20:54:0621#endif
22
[email protected]97156b72011-08-18 13:32:1223typedef base::Callback<void(IdleState)> IdleCallback;
[email protected]4c120af2012-11-17 03:27:3424typedef base::Callback<void(int)> IdleTimeCallback;
[email protected]97156b72011-08-18 13:32:1225
[email protected]484deaa2013-03-01 03:10:3726// Calculate the Idle state and notify the callback. |idle_threshold| is the