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

Unified Diff: chrome/browser/chromeos/session_length_limiter.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/session_length_limiter.cc
diff --git a/chrome/browser/chromeos/session_length_limiter.cc b/chrome/browser/chromeos/session_length_limiter.cc
index 63e0b12cfd1f8c0cfc29de189b90923de547dcb1..1714982528abb2b96d441fcab416770d2eba2815 100644
--- a/chrome/browser/chromeos/session_length_limiter.cc
+++ b/chrome/browser/chromeos/session_length_limiter.cc
@@ -6,7 +6,6 @@
#include <algorithm>
-#include "ash/shell.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/location.h"
@@ -98,20 +97,20 @@ SessionLengthLimiter::SessionLengthLimiter(Delegate* delegate,
UpdateSessionStartTime();
}
- if (!user_activity_seen_ && ash::Shell::HasInstance())
- ash::Shell::GetInstance()->user_activity_detector()->AddObserver(this);
+ if (!user_activity_seen_ && wm::UserActivityDetector::Get())
+ wm::UserActivityDetector::Get()->AddObserver(this);
}
SessionLengthLimiter::~SessionLengthLimiter() {
- if (!user_activity_seen_ && ash::Shell::HasInstance())
- ash::Shell::GetInstance()->user_activity_detector()->RemoveObserver(this);
+ if (!user_activity_seen_ && wm::UserActivityDetector::Get())
+ wm::UserActivityDetector::Get()->RemoveObserver(this);
}
void SessionLengthLimiter::OnUserActivity(const ui::Event* event) {
if (user_activity_seen_)
return;
- if (ash::Shell::HasInstance())
- ash::Shell::GetInstance()->user_activity_detector()->RemoveObserver(this);
+ if (wm::UserActivityDetector::Get())
+ wm::UserActivityDetector::Get()->RemoveObserver(this);
user_activity_seen_ = true;
PrefService* local_state = g_browser_process->local_state();

Powered by Google App Engine
This is Rietveld 408576698