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

Unified Diff: chrome/browser/chromeos/power/user_activity_notifier.cc

Issue 10544011: chromeos: Notify power manager about user activity. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/power/user_activity_notifier.cc
diff --git a/chrome/browser/chromeos/power/video_activity_notifier.cc b/chrome/browser/chromeos/power/user_activity_notifier.cc
similarity index 62%
copy from chrome/browser/chromeos/power/video_activity_notifier.cc
copy to chrome/browser/chromeos/power/user_activity_notifier.cc
index d0880628cc06ccb697f13d6948f6e4f53d8b1e5d..a558f6edb8b5c095bf25a7a660129c2d4090a746 100644
--- a/chrome/browser/chromeos/power/video_activity_notifier.cc
+++ b/chrome/browser/chromeos/power/user_activity_notifier.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/chromeos/power/video_activity_notifier.h"
+#include "chrome/browser/chromeos/power/user_activity_notifier.h"
#include "ash/shell.h"
#include "chromeos/dbus/dbus_thread_manager.h"
@@ -17,21 +17,21 @@ const int kNotifyIntervalSec = 5;
namespace chromeos {
-VideoActivityNotifier::VideoActivityNotifier() {
- ash::Shell::GetInstance()->video_detector()->AddObserver(this);
+UserActivityNotifier::UserActivityNotifier() {
+ ash::Shell::GetInstance()->user_activity_detector()->AddObserver(this);
}
-VideoActivityNotifier::~VideoActivityNotifier() {
- ash::Shell::GetInstance()->video_detector()->RemoveObserver(this);
+UserActivityNotifier::~UserActivityNotifier() {
+ ash::Shell::GetInstance()->user_activity_detector()->RemoveObserver(this);
}
-void VideoActivityNotifier::OnVideoDetected() {
+void UserActivityNotifier::OnUserActivity() {
base::TimeTicks now = base::TimeTicks::Now();
// InSeconds() truncates rather than rounding, so it's fine for this
// comparison.
if (last_notify_time_.is_null() ||
(now - last_notify_time_).InSeconds() >= kNotifyIntervalSec) {
- DBusThreadManager::Get()->GetPowerManagerClient()->NotifyVideoActivity(now);
+ DBusThreadManager::Get()->GetPowerManagerClient()->NotifyUserActivity(now);
last_notify_time_ = now;
}
}

Powered by Google App Engine
This is Rietveld 408576698