| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/idle_query_linux.h" | 5 #include "chrome/browser/idle_query_linux.h" |
| 6 | 6 |
| 7 #include <X11/extensions/scrnsaver.h> | 7 #include <X11/extensions/scrnsaver.h> |
| 8 #include "ui/base/x/x11_util.h" | 8 #include "ui/base/x/x11_util.h" |
| 9 | 9 |
| 10 namespace browser { | 10 namespace chrome { |
| 11 | 11 |
| 12 class IdleData { | 12 class IdleData { |
| 13 public: | 13 public: |
| 14 IdleData() { | 14 IdleData() { |
| 15 int event_base; | 15 int event_base; |
| 16 int error_base; | 16 int error_base; |
| 17 if (XScreenSaverQueryExtension(ui::GetXDisplay(), &event_base, | 17 if (XScreenSaverQueryExtension(ui::GetXDisplay(), &event_base, |
| 18 &error_base)) { | 18 &error_base)) { |
| 19 mit_info = XScreenSaverAllocInfo(); | 19 mit_info = XScreenSaverAllocInfo(); |
| 20 } else { | 20 } else { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 if (XScreenSaverQueryInfo(ui::GetXDisplay(), | 41 if (XScreenSaverQueryInfo(ui::GetXDisplay(), |
| 42 RootWindow(ui::GetXDisplay(), 0), | 42 RootWindow(ui::GetXDisplay(), 0), |
| 43 idle_data_->mit_info)) { | 43 idle_data_->mit_info)) { |
| 44 return (idle_data_->mit_info->idle) / 1000; | 44 return (idle_data_->mit_info->idle) / 1000; |
| 45 } else { | 45 } else { |
| 46 return 0; | 46 return 0; |
| 47 } | 47 } |
| 48 } | 48 } |
| 49 | 49 |
| 50 } // namespace browser | 50 } // namespace chrome |
| OLD | NEW |