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

Unified Diff: ash/metrics/user_metrics_recorder.cc

Issue 2826313002: cros: Use SessionController in UserMetricsRecorder to get login status (Closed)
Patch Set: review comments Created 3 years, 8 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
« no previous file with comments | « no previous file | ash/metrics/user_metrics_recorder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/metrics/user_metrics_recorder.cc
diff --git a/ash/metrics/user_metrics_recorder.cc b/ash/metrics/user_metrics_recorder.cc
index f06b8c6f8a00ae8617c6c94c515586c4c3b11b3f..a6ff35eafe6f271c10eeb30f26cd1d2f4cf67d29 100644
--- a/ash/metrics/user_metrics_recorder.cc
+++ b/ash/metrics/user_metrics_recorder.cc
@@ -8,13 +8,13 @@
#include "ash/metrics/pointer_metrics_recorder.h"
#include "ash/public/cpp/shelf_item.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/session/session_controller.h"
#include "ash/session/session_state_delegate.h"
#include "ash/shelf/shelf_model.h"
#include "ash/shelf/shelf_view.h"
#include "ash/shelf/wm_shelf.h"
#include "ash/shell.h"
#include "ash/shell_port.h"
-#include "ash/system/tray/system_tray_delegate.h"
#include "ash/wm/window_state.h"
#include "ash/wm/window_state_aura.h"
#include "ash/wm_window.h"
@@ -79,34 +79,21 @@ ActiveWindowStateType GetActiveWindowState() {
// Returns true if kiosk mode is active.
bool IsKioskModeActive() {
- return Shell::Get()->system_tray_delegate()->GetUserLoginStatus() ==
+ return Shell::Get()->session_controller()->login_status() ==
LoginStatus::KIOSK_APP;
}
// Returns true if ARC kiosk mode is active.
bool IsArcKioskModeActive() {
- return Shell::Get()->system_tray_delegate()->GetUserLoginStatus() ==
+ return Shell::Get()->session_controller()->login_status() ==
LoginStatus::ARC_KIOSK_APP;
}
// Returns true if there is an active user and their session isn't currently
// locked.
bool IsUserActive() {
- switch (Shell::Get()->system_tray_delegate()->GetUserLoginStatus()) {
- case LoginStatus::NOT_LOGGED_IN:
- case LoginStatus::LOCKED:
- return false;
- case LoginStatus::USER:
- case LoginStatus::OWNER:
- case LoginStatus::GUEST:
- case LoginStatus::PUBLIC:
- case LoginStatus::SUPERVISED:
- case LoginStatus::KIOSK_APP:
- case LoginStatus::ARC_KIOSK_APP:
- return true;
- }
- NOTREACHED();
- return false;
+ SessionController* session = Shell::Get()->session_controller();
+ return session->IsActiveUserSessionStarted() && !session->IsScreenLocked();
}
// Array of window container ids that contain visible windows to be counted for
« no previous file with comments | « no previous file | ash/metrics/user_metrics_recorder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698