This source file includes following definitions.
- CalculateIdleStateCallback
- CalculateIdleState
#include "chrome/browser/idle.h"
#include "base/bind.h"
namespace {
void CalculateIdleStateCallback(int idle_threshold,
IdleCallback notify,
int idle_time) {
if (idle_time >= idle_threshold)
notify.Run(IDLE_STATE_IDLE);
else
notify.Run(IDLE_STATE_ACTIVE);
}
}
void CalculateIdleState(int idle_threshold, IdleCallback notify) {
if (CheckIdleStateIsLocked()) {
notify.Run(IDLE_STATE_LOCKED);
return;
}
CalculateIdleTime(base::Bind(&CalculateIdleStateCallback,
idle_threshold,
notify));
}