1 // Copyright (c) 2011 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 #include "chrome/browser/idle.h"
11 void CalculateIdleStateCallback(int idle_threshold
,
14 if (idle_time
>= idle_threshold
)
15 notify
.Run(IDLE_STATE_IDLE
);
17 notify
.Run(IDLE_STATE_ACTIVE
);
22 void CalculateIdleState(int idle_threshold
, IdleCallback notify
) {
23 if (CheckIdleStateIsLocked()) {
24 notify
.Run(IDLE_STATE_LOCKED
);
28 CalculateIdleTime(base::Bind(&CalculateIdleStateCallback
,