OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ASH_COMMON_SESSION_SESSION_CONTROLLER_H_ | 5 #ifndef ASH_COMMON_SESSION_SESSION_CONTROLLER_H_ |
6 #define ASH_COMMON_SESSION_SESSION_CONTROLLER_H_ | 6 #define ASH_COMMON_SESSION_SESSION_CONTROLLER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 // NOTE: Prefer GetSessionState() in new code because the concept of | 97 // NOTE: Prefer GetSessionState() in new code because the concept of |
98 // SessionState more closes matches the state in chrome. | 98 // SessionState more closes matches the state in chrome. |
99 LoginStatus login_status() const { return login_status_; } | 99 LoginStatus login_status() const { return login_status_; } |
100 | 100 |
101 // mojom::SessionController | 101 // mojom::SessionController |
102 void SetClient(mojom::SessionControllerClientPtr client) override; | 102 void SetClient(mojom::SessionControllerClientPtr client) override; |
103 void SetSessionInfo(mojom::SessionInfoPtr info) override; | 103 void SetSessionInfo(mojom::SessionInfoPtr info) override; |
104 void UpdateUserSession(mojom::UserSessionPtr user_session) override; | 104 void UpdateUserSession(mojom::UserSessionPtr user_session) override; |
105 void SetUserSessionOrder( | 105 void SetUserSessionOrder( |
106 const std::vector<uint32_t>& user_session_order) override; | 106 const std::vector<uint32_t>& user_session_order) override; |
| 107 void RunUnlockAnimation(const RunUnlockAnimationCallback& callback) override; |
107 | 108 |
108 // Test helpers. | 109 // Test helpers. |
109 void ClearUserSessionsForTest(); | 110 void ClearUserSessionsForTest(); |
110 void FlushMojoForTest(); | 111 void FlushMojoForTest(); |
111 void LockScreenAndFlushForTest(); | 112 void LockScreenAndFlushForTest(); |
112 | 113 |
113 private: | 114 private: |
114 void SetSessionState(session_manager::SessionState state); | 115 void SetSessionState(session_manager::SessionState state); |
115 void AddUserSession(mojom::UserSessionPtr user_session); | 116 void AddUserSession(mojom::UserSessionPtr user_session); |
116 | 117 |
(...skipping 24 matching lines...) Expand all Loading... |
141 std::vector<mojom::UserSessionPtr> user_sessions_; | 142 std::vector<mojom::UserSessionPtr> user_sessions_; |
142 | 143 |
143 // The user session id of the current active user session. User session id | 144 // The user session id of the current active user session. User session id |
144 // is managed by session manager code, starting at 1. 0u is an invalid id | 145 // is managed by session manager code, starting at 1. 0u is an invalid id |
145 // to detect first active user session. | 146 // to detect first active user session. |
146 uint32_t active_session_id_ = 0u; | 147 uint32_t active_session_id_ = 0u; |
147 | 148 |
148 // Last known login status. Used to track login status changes. | 149 // Last known login status. Used to track login status changes. |
149 LoginStatus login_status_ = LoginStatus::NOT_LOGGED_IN; | 150 LoginStatus login_status_ = LoginStatus::NOT_LOGGED_IN; |
150 | 151 |
| 152 // Whether unlocking is in progress. The flag is set when the pre-unlock |
| 153 // animation starts and reset when session state is no longer LOCKED. |
| 154 bool is_unlocking_ = false; |
| 155 |
151 base::ObserverList<ash::SessionStateObserver> observers_; | 156 base::ObserverList<ash::SessionStateObserver> observers_; |
152 | 157 |
153 DISALLOW_COPY_AND_ASSIGN(SessionController); | 158 DISALLOW_COPY_AND_ASSIGN(SessionController); |
154 }; | 159 }; |
155 | 160 |
156 } // namespace ash | 161 } // namespace ash |
157 | 162 |
158 #endif // ASH_COMMON_SESSION_SESSION_CONTROLLER_H_ | 163 #endif // ASH_COMMON_SESSION_SESSION_CONTROLLER_H_ |
OLD | NEW |