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

Unified Diff: chrome/browser/chromeos/system/automatic_reboot_manager.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, 2 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/system/automatic_reboot_manager.cc
diff --git a/chrome/browser/chromeos/system/automatic_reboot_manager.cc b/chrome/browser/chromeos/system/automatic_reboot_manager.cc
index 1d91ec13f6306c791c5b3a83baf20e7e85bbc5d0..81d6dcdfc3ff888994f99c15c930ea47013388f9 100644
--- a/chrome/browser/chromeos/system/automatic_reboot_manager.cc
+++ b/chrome/browser/chromeos/system/automatic_reboot_manager.cc
@@ -11,7 +11,6 @@
#include <algorithm>
#include <string>
-#include "ash/shell.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/callback.h"
@@ -172,8 +171,8 @@ AutomaticRebootManager::AutomaticRebootManager(
// idle. Start listening for user activity to determine whether the user is
// idle or not.
if (!user_manager::UserManager::Get()->IsUserLoggedIn()) {
- if (ash::Shell::HasInstance())
- ash::Shell::GetInstance()->user_activity_detector()->AddObserver(this);
+ if (wm::UserActivityDetector::Get())
+ wm::UserActivityDetector::Get()->AddObserver(this);
notification_registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_CHANGED,
content::NotificationService::AllSources());
login_screen_idle_timer_.reset(
@@ -202,8 +201,8 @@ AutomaticRebootManager::~AutomaticRebootManager() {
DBusThreadManager* dbus_thread_manager = DBusThreadManager::Get();
dbus_thread_manager->GetPowerManagerClient()->RemoveObserver(this);
dbus_thread_manager->GetUpdateEngineClient()->RemoveObserver(this);
- if (ash::Shell::HasInstance())
- ash::Shell::GetInstance()->user_activity_detector()->RemoveObserver(this);
+ if (wm::UserActivityDetector::Get())
+ wm::UserActivityDetector::Get()->RemoveObserver(this);
}
void AutomaticRebootManager::AddObserver(
@@ -270,8 +269,8 @@ void AutomaticRebootManager::Observe(
} else if (type == chrome::NOTIFICATION_LOGIN_USER_CHANGED) {
// A session is starting. Stop listening for user activity as it no longer
// is a relevant criterion.
- if (ash::Shell::HasInstance())
- ash::Shell::GetInstance()->user_activity_detector()->RemoveObserver(this);
+ if (wm::UserActivityDetector::Get())
+ wm::UserActivityDetector::Get()->RemoveObserver(this);
notification_registrar_.Remove(
this, chrome::NOTIFICATION_LOGIN_USER_CHANGED,
content::NotificationService::AllSources());

Powered by Google App Engine
This is Rietveld 408576698