Fix sorting issues in chrome_browser.gypi restructuring
[chromium-blink-merge.git] / chrome / browser / idle_chromeos.cc
blob96b058c398cd60e9c56fd11872a56a181decb38a
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 #include "chrome/browser/idle.h"
7 #include "ash/session/session_state_delegate.h"
8 #include "ash/shell.h"
9 #include "base/time/time.h"
10 #include "ui/wm/core/user_activity_detector.h"
12 void CalculateIdleTime(IdleTimeCallback notify) {
13 base::TimeDelta idle_time = base::TimeTicks::Now() -
14 wm::UserActivityDetector::Get()->last_activity_time();
15 notify.Run(static_cast<int>(idle_time.InSeconds()));
18 bool CheckIdleStateIsLocked() {
19 #if defined(USE_ATHENA)
20 return false;
21 #else
22 return ash::Shell::GetInstance()->session_state_delegate()->IsScreenLocked();
23 #endif