Add ICU message format support
[chromium-blink-merge.git] / ui / base / idle / idle_linux.cc
blob622ae8d07ec309ce7856624f26d51c29319eabe4
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"
9 #if defined(USE_X11)
10 #include "ui/base/idle/idle_query_x11.h"
11 #include "ui/base/idle/screensaver_window_finder_x11.h"
12 #endif
14 namespace ui {
16 void CalculateIdleTime(IdleTimeCallback notify) {
17 #if defined(USE_X11)
18 IdleQueryX11 idle_query;
19 notify.Run(idle_query.IdleTime());
20 #endif
23 bool CheckIdleStateIsLocked() {
24 #if defined(USE_X11)
25 // Usually the screensaver is used to lock the screen.
26 return ScreensaverWindowFinder::ScreensaverWindowExists();
27 #else
28 return false;
29 #endif
32 } // namespace ui