Componentize AccountReconcilor.
[chromium-blink-merge.git] / chrome / browser / idle_linux.cc
blobefcbb6da00c6e57773ecfd0ffe3175c35bea230f
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 "base/basictypes.h"
9 #if defined(USE_X11)
10 #include "chrome/browser/idle_query_x11.h"
11 #endif
13 #if !defined(OS_CHROMEOS)
14 #include "chrome/browser/screensaver_window_finder_x11.h"
15 #endif
17 void CalculateIdleTime(IdleTimeCallback notify) {
18 #if defined(USE_X11)
19 chrome::IdleQueryX11 idle_query;
20 notify.Run(idle_query.IdleTime());
21 #endif
24 bool CheckIdleStateIsLocked() {
25 // Usually the screensaver is used to lock the screen, so we do not need to
26 // check if the workstation is locked.
27 #if defined(OS_CHROMEOS)
28 return false;
29 #elif defined(USE_OZONE)
30 return false;
31 #else
32 return ScreensaverWindowFinder::ScreensaverWindowExists();
33 #endif