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

Unified Diff: chrome/browser/chromeos/app_mode/kiosk_mode_idle_app_name_notification.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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/app_mode/kiosk_mode_idle_app_name_notification.cc
diff --git a/chrome/browser/chromeos/app_mode/kiosk_mode_idle_app_name_notification.cc b/chrome/browser/chromeos/app_mode/kiosk_mode_idle_app_name_notification.cc
index 52cba04e06ab53cd686073186f1574ce31116a17..651d22705bf995c1c530286dad22c113c2a82ae4 100644
--- a/chrome/browser/chromeos/app_mode/kiosk_mode_idle_app_name_notification.cc
+++ b/chrome/browser/chromeos/app_mode/kiosk_mode_idle_app_name_notification.cc
@@ -4,7 +4,6 @@
#include "chrome/browser/chromeos/app_mode/kiosk_mode_idle_app_name_notification.h"
-#include "ash/shell.h"
#include "base/bind.h"
#include "base/command_line.h"
#include "base/logging.h"
@@ -57,9 +56,10 @@ KioskModeIdleAppNameNotification::KioskModeIdleAppNameNotification()
}
KioskModeIdleAppNameNotification::~KioskModeIdleAppNameNotification() {
- if (ash::Shell::HasInstance() &&
- ash::Shell::GetInstance()->user_activity_detector()->HasObserver(this)) {
- ash::Shell::GetInstance()->user_activity_detector()->RemoveObserver(this);
+ wm::UserActivityDetector* user_activity_detector =
+ wm::UserActivityDetector::Get();
+ if (user_activity_detector && user_activity_detector->HasObserver(this)) {
+ user_activity_detector->RemoveObserver(this);
// At this time the DBusThreadManager might already be gone.
if (chromeos::DBusThreadManager::IsInitialized())
chromeos::DBusThreadManager::Get()->GetPowerManagerClient(
@@ -98,8 +98,8 @@ void KioskModeIdleAppNameNotification::SuspendDone(
}
void KioskModeIdleAppNameNotification::Start() {
- if (!ash::Shell::GetInstance()->user_activity_detector()->HasObserver(this)) {
- ash::Shell::GetInstance()->user_activity_detector()->AddObserver(this);
+ if (!wm::UserActivityDetector::Get()->HasObserver(this)) {
+ wm::UserActivityDetector::Get()->AddObserver(this);
chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver(
this);
}
« no previous file with comments | « ash/system/chromeos/power/power_event_observer.cc ('k') | chrome/browser/chromeos/dbus/display_power_service_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698