Update V8 to version 4.7.45.
[chromium-blink-merge.git] / ui / base / idle / idle_chromeos.cc
blob0a382849b79f4d8fbf79d3b44d365d889593cc54
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/time/time.h"
8 #include "chromeos/dbus/dbus_thread_manager.h"
9 #include "chromeos/dbus/session_manager_client.h"
10 #include "ui/base/user_activity/user_activity_detector.h"
12 namespace ui {
14 void CalculateIdleTime(IdleTimeCallback notify) {
15 base::TimeDelta idle_time = base::TimeTicks::Now() -
16 ui::UserActivityDetector::Get()->last_activity_time();
17 notify.Run(static_cast<int>(idle_time.InSeconds()));
20 bool CheckIdleStateIsLocked() {
21 return chromeos::DBusThreadManager::Get()->GetSessionManagerClient()->
22 IsScreenLocked();
25 } // namespace ui