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

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

Issue 2734933004: ash: Use SessionController instead of SessionStateDelegate (Closed)
Patch Set: rebase to get WorkspaceLayoutManagerSoloTest change 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
« no previous file with comments | « ash/common/accelerators/accelerator_controller.cc ('k') | ash/common/session/session_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c7227c2ad601fc2bf27ba9a45788c902991a04d5 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,11 @@ class ASH_EXPORT SessionController
void SetUserSessionOrder(
const std::vector<uint32_t>& user_session_order) override;
+ // Test helpers.
+ void ClearUserSessionsForTest();
+ void FlushMojoForTest();
+ void LockScreenAndFlushForTest();
+
private:
void SetSessionState(session_manager::SessionState state);
void AddUserSession(mojom::UserSessionPtr user_session);
@@ -115,7 +127,7 @@ class ASH_EXPORT SessionController
bool can_lock_ = false;
bool should_lock_screen_automatically_ = false;
AddUserSessionPolicy add_user_session_policy_ = AddUserSessionPolicy::ALLOWED;
- session_manager::SessionState state_ = session_manager::SessionState::UNKNOWN;
+ session_manager::SessionState state_;
// Cached user session info sorted by the order from SetUserSessionOrder.
// Currently the session manager code (chrome) sets a LRU order with the
« no previous file with comments | « ash/common/accelerators/accelerator_controller.cc ('k') | ash/common/session/session_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698