| Index: ash/common/session/session_controller.h
|
| diff --git a/ash/common/session/session_controller.h b/ash/common/session/session_controller.h
|
| index c7227c2ad601fc2bf27ba9a45788c902991a04d5..23260387737c59e3f5e0d6a23c3305e11bc5b946 100644
|
| --- a/ash/common/session/session_controller.h
|
| +++ b/ash/common/session/session_controller.h
|
| @@ -10,6 +10,7 @@
|
| #include <vector>
|
|
|
| #include "ash/ash_export.h"
|
| +#include "ash/common/login_status.h"
|
| #include "ash/public/cpp/session_types.h"
|
| #include "ash/public/interfaces/session_controller.mojom.h"
|
| #include "base/macros.h"
|
| @@ -20,7 +21,6 @@ class AccountId;
|
|
|
| namespace ash {
|
|
|
| -enum class LoginStatus;
|
| class SessionStateObserver;
|
|
|
| // Implements mojom::SessionController to cache session related info such as
|
| @@ -96,7 +96,7 @@ class ASH_EXPORT SessionController
|
| // Returns the ash notion of login status.
|
| // NOTE: Prefer GetSessionState() in new code because the concept of
|
| // SessionState more closes matches the state in chrome.
|
| - LoginStatus GetLoginStatus() const;
|
| + LoginStatus login_status() const { return login_status_; }
|
|
|
| // mojom::SessionController
|
| void SetClient(mojom::SessionControllerClientPtr client) override;
|
| @@ -114,8 +114,14 @@ class ASH_EXPORT SessionController
|
| void SetSessionState(session_manager::SessionState state);
|
| void AddUserSession(mojom::UserSessionPtr user_session);
|
|
|
| + // Calculate login status based on session state and active user session.
|
| + LoginStatus CalculateLoginStatus() const;
|
| +
|
| // Helper that returns login status when the session state is ACTIVE.
|
| - LoginStatus GetLoginStatusForActiveSession() const;
|
| + LoginStatus CalculateLoginStatusForActiveSession() const;
|
| +
|
| + // Update the |login_status_| and notify observers.
|
| + void UpdateLoginStatus();
|
|
|
| // Bindings for mojom::SessionController interface.
|
| mojo::BindingSet<mojom::SessionController> bindings_;
|
| @@ -139,6 +145,9 @@ class ASH_EXPORT SessionController
|
| // to detect first active user session.
|
| uint32_t active_session_id_ = 0u;
|
|
|
| + // Last known login status. Used to track login status changes.
|
| + LoginStatus login_status_ = LoginStatus::NOT_LOGGED_IN;
|
| +
|
| base::ObserverList<ash::SessionStateObserver> observers_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(SessionController);
|
|
|