OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 "ash/session/session_state_delegate.h" | 7 #include "ash/session/session_state_delegate.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "ui/wm/core/user_activity_detector.h" | 10 #include "ui/wm/core/user_activity_detector.h" |
11 | 11 |
12 void CalculateIdleTime(IdleTimeCallback notify) { | 12 void CalculateIdleTime(IdleTimeCallback notify) { |
13 #if defined(USE_ATHENA) | |
sky
2014/09/02 19:10:26
How about idle_athena with NOTIMPLEMENTEDs?
oshima
2014/09/02 20:37:55
Done.
| |
14 // TODO(oshima): Implement this for athena. crbug.com/408752 | |
15 base::TimeDelta idle_time; | |
16 #else | |
13 base::TimeDelta idle_time = base::TimeTicks::Now() - | 17 base::TimeDelta idle_time = base::TimeTicks::Now() - |
14 ash::Shell::GetInstance()->user_activity_detector()->last_activity_time(); | 18 ash::Shell::GetInstance()->user_activity_detector()->last_activity_time(); |
19 #endif | |
15 notify.Run(static_cast<int>(idle_time.InSeconds())); | 20 notify.Run(static_cast<int>(idle_time.InSeconds())); |
16 } | 21 } |
17 | 22 |
18 bool CheckIdleStateIsLocked() { | 23 bool CheckIdleStateIsLocked() { |
24 #if defined(USE_ATHENA) | |
25 return false; | |
26 #else | |
19 return ash::Shell::GetInstance()->session_state_delegate()->IsScreenLocked(); | 27 return ash::Shell::GetInstance()->session_state_delegate()->IsScreenLocked(); |
28 #endif | |
20 } | 29 } |
OLD | NEW |