Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Side by Side Diff: chrome/browser/idle_chromeos.cc

Issue 693643004: Make UserActivityDetector a singleton (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@athena_do_not_use_ash45
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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)
14 // TODO(oshima): Implement this for athena. crbug.com/408752
15 base::TimeDelta idle_time;
16 NOTIMPLEMENTED();
17 #else
18 base::TimeDelta idle_time = base::TimeTicks::Now() - 13 base::TimeDelta idle_time = base::TimeTicks::Now() -
19 ash::Shell::GetInstance()->user_activity_detector()->last_activity_time(); 14 wm::UserActivityDetector::Get()->last_activity_time();
20 #endif
21 notify.Run(static_cast<int>(idle_time.InSeconds())); 15 notify.Run(static_cast<int>(idle_time.InSeconds()));
22 } 16 }
23 17
24 bool CheckIdleStateIsLocked() { 18 bool CheckIdleStateIsLocked() {
25 #if defined(USE_ATHENA) 19 #if defined(USE_ATHENA)
26 return false; 20 return false;
27 #else 21 #else
28 return ash::Shell::GetInstance()->session_state_delegate()->IsScreenLocked(); 22 return ash::Shell::GetInstance()->session_state_delegate()->IsScreenLocked();
29 #endif 23 #endif
30 } 24 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698