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

Unified Diff: ash/common/session/session_controller.h

Issue 2734933004: ash: Use SessionController instead of SessionStateDelegate (Closed)
Patch Set: rebase Created 3 years, 9 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: ash/common/session/session_controller.h
diff --git a/ash/common/session/session_controller.h b/ash/common/session/session_controller.h
index 70150a3aa33de7a8a10a259190280c3cbc6ae88f..e13f6728cd1c7e75b3a1d3755a9918e77f9578e3 100644
--- a/ash/common/session/session_controller.h
+++ b/ash/common/session/session_controller.h
@@ -61,17 +61,24 @@ class ASH_EXPORT SessionController
// is turned off or the system is suspended.
bool ShouldLockScreenAutomatically() const;
- // Returns |true| if user session blocked by some overlying UI. It can be
+ // Returns true if user session blocked by some overlying UI. It can be
// login screen, lock screen or screen for adding users into multi-profile
// session.
bool IsUserSessionBlocked() const;
+ // Convenience function that returns true if session state is LOGIN_SECONDARY.
+ bool IsInSecondaryLoginScreen() const;
+
// Gets the ash session state.
session_manager::SessionState GetSessionState() const;
// Gets the user sessions in LRU order with the active session being first.
const std::vector<mojom::UserSessionPtr>& GetUserSessions() const;
+ // Convenience helper to gets the user session at a given index. Returns
+ // nullptr if no user session is found for the index.
+ const mojom::UserSession* GetUserSession(UserIndex index) const;
+
// Locks the screen. The locking happens asynchronously.
void LockScreen();
@@ -98,6 +105,10 @@ class ASH_EXPORT SessionController
void SetUserSessionOrder(
const std::vector<uint32_t>& user_session_order) override;
+ // Test helpers.
+ void ClearUserSessionsForTest();
+ void LockScreenAndFlushForTest();
+
private:
void SetSessionState(session_manager::SessionState state);
void AddUserSession(mojom::UserSessionPtr user_session);

Powered by Google App Engine
This is Rietveld 408576698