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.h" | 5 #include "chrome/browser/idle.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" | 9 #include "chromeos/dbus/dbus_thread_manager.h" |
10 #include "chrome/browser/chromeos/dbus/power_manager_client.h" | 10 #include "chromeos/dbus/power_manager_client.h" |
11 #if !defined(USE_AURA) | 11 #if !defined(USE_AURA) |
12 #include "chrome/browser/screensaver_window_finder_gtk.h" | 12 #include "chrome/browser/screensaver_window_finder_gtk.h" |
13 #endif | 13 #endif |
oshima
2012/04/05 23:30:46
looks like this (and code below) is dead code. Can
hashimoto
2012/04/06 00:19:24
Done.
| |
14 | 14 |
15 void CalculateIdleStateNotifier(unsigned int idle_treshold, | 15 void CalculateIdleStateNotifier(unsigned int idle_treshold, |
16 IdleCallback notify, | 16 IdleCallback notify, |
17 int64_t idle_time_s) { | 17 int64_t idle_time_s) { |
18 if (idle_time_s >= (int64_t)idle_treshold) { | 18 if (idle_time_s >= (int64_t)idle_treshold) { |
19 notify.Run(IDLE_STATE_IDLE); | 19 notify.Run(IDLE_STATE_IDLE); |
20 } else if (idle_time_s < 0) { | 20 } else if (idle_time_s < 0) { |
21 notify.Run(IDLE_STATE_UNKNOWN); | 21 notify.Run(IDLE_STATE_UNKNOWN); |
22 } else { | 22 } else { |
23 notify.Run(IDLE_STATE_ACTIVE); | 23 notify.Run(IDLE_STATE_ACTIVE); |
(...skipping 12 matching lines...) Expand all Loading... | |
36 | 36 |
37 bool CheckIdleStateIsLocked() { | 37 bool CheckIdleStateIsLocked() { |
38 // Usually the screensaver is used to lock the screen, so we do not need to | 38 // Usually the screensaver is used to lock the screen, so we do not need to |
39 // check if the workstation is locked. | 39 // check if the workstation is locked. |
40 #if defined(USE_AURA) | 40 #if defined(USE_AURA) |
41 return false; | 41 return false; |
42 #else | 42 #else |
43 return ScreensaverWindowFinder::ScreensaverWindowExists(); | 43 return ScreensaverWindowFinder::ScreensaverWindowExists(); |
44 #endif | 44 #endif |
45 } | 45 } |
OLD | NEW |