summaryrefslogtreecommitdiff
path: root/chromium/ui/base/idle/idle.cc
blob: 0333fbc18ce92c69561e669abf380039099883e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ui/base/idle/idle.h"

namespace ui {

IdleState CalculateIdleState(int idle_threshold) {
  if (CheckIdleStateIsLocked())
    return IDLE_STATE_LOCKED;

  if (CalculateIdleTime() >= idle_threshold)
    return IDLE_STATE_IDLE;

  return IDLE_STATE_ACTIVE;
}

}  // namespace ui