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 "ui/base/idle/idle.h"
7 #include "base/basictypes.h"
10 #include "ui/base/idle/idle_query_x11.h"
11 #include "ui/base/idle/screensaver_window_finder_x11.h"
16 void CalculateIdleTime(IdleTimeCallback notify
) {
18 IdleQueryX11 idle_query
;
19 notify
.Run(idle_query
.IdleTime());
23 bool CheckIdleStateIsLocked() {
25 // Usually the screensaver is used to lock the screen.
26 return ScreensaverWindowFinder::ScreensaverWindowExists();