OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROME_BROWSER_CHROMEOS_LOGIN_USERS_USER_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USERS_USER_MANAGER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USERS_USER_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USERS_USER_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "chrome/browser/chromeos/login/user_flow.h" | 10 #include "chrome/browser/chromeos/login/user_flow.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 // Called when active user has changed. | 42 // Called when active user has changed. |
43 virtual void ActiveUserChanged(const User* active_user); | 43 virtual void ActiveUserChanged(const User* active_user); |
44 | 44 |
45 // Called when another user got added to the existing session. | 45 // Called when another user got added to the existing session. |
46 virtual void UserAddedToSession(const User* added_user); | 46 virtual void UserAddedToSession(const User* added_user); |
47 | 47 |
48 // Called right before notifying on user change so that those who rely | 48 // Called right before notifying on user change so that those who rely |
49 // on user_id hash would be accessing up-to-date value. | 49 // on user_id hash would be accessing up-to-date value. |
50 virtual void ActiveUserHashChanged(const std::string& hash); | 50 virtual void ActiveUserHashChanged(const std::string& hash); |
51 | 51 |
52 // Called when UserManager finishes restoring user sessions after crash. | |
53 virtual void PendingUserSessionsRestoreFinished(); | |
54 | |
55 protected: | 52 protected: |
56 virtual ~UserSessionStateObserver(); | 53 virtual ~UserSessionStateObserver(); |
57 }; | 54 }; |
58 | 55 |
59 // Data retrieved from user account. | 56 // Data retrieved from user account. |
60 class UserAccountData { | 57 class UserAccountData { |
61 public: | 58 public: |
62 UserAccountData(const base::string16& display_name, | 59 UserAccountData(const base::string16& display_name, |
63 const base::string16& given_name, | 60 const base::string16& given_name, |
64 const std::string& locale); | 61 const std::string& locale); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 | 150 |
154 // Called when browser session is started i.e. after | 151 // Called when browser session is started i.e. after |
155 // browser_creator.LaunchBrowser(...) was called after user sign in. | 152 // browser_creator.LaunchBrowser(...) was called after user sign in. |
156 // When user is at the image screen IsUserLoggedIn() will return true | 153 // When user is at the image screen IsUserLoggedIn() will return true |
157 // but IsSessionStarted() will return false. During the kiosk splash screen, | 154 // but IsSessionStarted() will return false. During the kiosk splash screen, |
158 // we perform additional initialization after the user is logged in but | 155 // we perform additional initialization after the user is logged in but |
159 // before the session has been started. | 156 // before the session has been started. |
160 // Fires NOTIFICATION_SESSION_STARTED. | 157 // Fires NOTIFICATION_SESSION_STARTED. |
161 virtual void SessionStarted() = 0; | 158 virtual void SessionStarted() = 0; |
162 | 159 |
163 // Usually is called when Chrome is restarted after a crash and there's an | |
164 // active session. First user (one that is passed with --login-user) Chrome | |
165 // session has been already restored at this point. This method asks session | |
166 // manager for all active user sessions, marks them as logged in | |
167 // and notifies observers. | |
168 virtual void RestoreActiveSessions() = 0; | |
169 | |
170 // Removes the user from the device. Note, it will verify that the given user | 160 // Removes the user from the device. Note, it will verify that the given user |
171 // isn't the owner, so calling this method for the owner will take no effect. | 161 // isn't the owner, so calling this method for the owner will take no effect. |
172 // Note, |delegate| can be NULL. | 162 // Note, |delegate| can be NULL. |
173 virtual void RemoveUser(const std::string& user_id, | 163 virtual void RemoveUser(const std::string& user_id, |
174 RemoveUserDelegate* delegate) = 0; | 164 RemoveUserDelegate* delegate) = 0; |
175 | 165 |
176 // Removes the user from the persistent list only. Also removes the user's | 166 // Removes the user from the persistent list only. Also removes the user's |
177 // picture. | 167 // picture. |
178 virtual void RemoveUserFromList(const std::string& user_id) = 0; | 168 virtual void RemoveUserFromList(const std::string& user_id) = 0; |
179 | 169 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 virtual bool IsLoggedInAsKioskApp() const = 0; | 269 virtual bool IsLoggedInAsKioskApp() const = 0; |
280 | 270 |
281 // Returns true if we're logged in as the stub user used for testing on Linux. | 271 // Returns true if we're logged in as the stub user used for testing on Linux. |
282 virtual bool IsLoggedInAsStub() const = 0; | 272 virtual bool IsLoggedInAsStub() const = 0; |
283 | 273 |
284 // Returns true if we're logged in and browser has been started i.e. | 274 // Returns true if we're logged in and browser has been started i.e. |
285 // browser_creator.LaunchBrowser(...) was called after sign in | 275 // browser_creator.LaunchBrowser(...) was called after sign in |
286 // or restart after crash. | 276 // or restart after crash. |
287 virtual bool IsSessionStarted() const = 0; | 277 virtual bool IsSessionStarted() const = 0; |
288 | 278 |
289 // Returns true iff browser has been restarted after crash and UserManager | |
290 // finished restoring user sessions. | |
291 virtual bool UserSessionsRestored() const = 0; | |
292 | |
293 // Returns true if data stored or cached for the user with the given user id | 279 // Returns true if data stored or cached for the user with the given user id |
294 // address outside that user's cryptohome (wallpaper, avatar, OAuth token | 280 // address outside that user's cryptohome (wallpaper, avatar, OAuth token |
295 // status, display name, display email) is to be treated as ephemeral. | 281 // status, display name, display email) is to be treated as ephemeral. |
296 virtual bool IsUserNonCryptohomeDataEphemeral( | 282 virtual bool IsUserNonCryptohomeDataEphemeral( |
297 const std::string& user_id) const = 0; | 283 const std::string& user_id) const = 0; |
298 | 284 |
299 // Method that allows to set |flow| for user identified by |user_id|. | 285 // Method that allows to set |flow| for user identified by |user_id|. |
300 // Flow should be set before login attempt. | 286 // Flow should be set before login attempt. |
301 // Takes ownership of the |flow|, |flow| will be deleted in case of login | 287 // Takes ownership of the |flow|, |flow| will be deleted in case of login |
302 // failure. | 288 // failure. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 ScopedTestUserManager(); | 343 ScopedTestUserManager(); |
358 ~ScopedTestUserManager(); | 344 ~ScopedTestUserManager(); |
359 | 345 |
360 private: | 346 private: |
361 DISALLOW_COPY_AND_ASSIGN(ScopedTestUserManager); | 347 DISALLOW_COPY_AND_ASSIGN(ScopedTestUserManager); |
362 }; | 348 }; |
363 | 349 |
364 } // namespace chromeos | 350 } // namespace chromeos |
365 | 351 |
366 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USERS_USER_MANAGER_H_ | 352 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USERS_USER_MANAGER_H_ |
OLD | NEW |