| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_USER_MANAGER_IMPL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_IMPL_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_IMPL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 bool AreEphemeralUsersEnabled() const; | 147 bool AreEphemeralUsersEnabled() const; |
| 148 | 148 |
| 149 // Returns true if the user with the given email address is to be treated as | 149 // Returns true if the user with the given email address is to be treated as |
| 150 // ephemeral. | 150 // ephemeral. |
| 151 bool IsEphemeralUser(const std::string& email) const; | 151 bool IsEphemeralUser(const std::string& email) const; |
| 152 | 152 |
| 153 // Returns the user with the given email address if found in the persistent | 153 // Returns the user with the given email address if found in the persistent |
| 154 // list. Returns |NULL| otherwise. | 154 // list. Returns |NULL| otherwise. |
| 155 const User* FindUserInList(const std::string& email) const; | 155 const User* FindUserInList(const std::string& email) const; |
| 156 | 156 |
| 157 // Makes stub user the current logged-in user (for test paths). | |
| 158 void StubUserLoggedIn(); | |
| 159 | |
| 160 // Notifies on new user session. | 157 // Notifies on new user session. |
| 161 void NotifyOnLogin(); | 158 void NotifyOnLogin(); |
| 162 | 159 |
| 163 // Reads user's oauth token status from local state preferences. | 160 // Reads user's oauth token status from local state preferences. |
| 164 User::OAuthTokenStatus LoadUserOAuthStatus(const std::string& username) const; | 161 User::OAuthTokenStatus LoadUserOAuthStatus(const std::string& username) const; |
| 165 | 162 |
| 166 void SetCurrentUserIsOwner(bool is_current_user_owner); | 163 void SetCurrentUserIsOwner(bool is_current_user_owner); |
| 167 | 164 |
| 168 // Sets one of the default images for the specified user and saves this | 165 // Sets one of the default images for the specified user and saves this |
| 169 // setting in local state. | 166 // setting in local state. |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 | 306 |
| 310 // Loads user image from its file. | 307 // Loads user image from its file. |
| 311 scoped_refptr<UserImageLoader> image_loader_; | 308 scoped_refptr<UserImageLoader> image_loader_; |
| 312 | 309 |
| 313 // List of all known users. User instances are owned by |this| and deleted | 310 // List of all known users. User instances are owned by |this| and deleted |
| 314 // when users are removed by |RemoveUserFromListInternal|. | 311 // when users are removed by |RemoveUserFromListInternal|. |
| 315 mutable UserList users_; | 312 mutable UserList users_; |
| 316 | 313 |
| 317 // The logged-in user. NULL until a user has logged in, then points to one | 314 // The logged-in user. NULL until a user has logged in, then points to one |
| 318 // of the User instances in |users_|, the |guest_user_| instance or an | 315 // of the User instances in |users_|, the |guest_user_| instance or an |
| 319 // ephemeral user instance. In test paths without login points to the | 316 // ephemeral user instance. |
| 320 // |stub_user_| instance. | |
| 321 User* logged_in_user_; | 317 User* logged_in_user_; |
| 322 | 318 |
| 323 // True if SessionStarted() has been called. | 319 // True if SessionStarted() has been called. |
| 324 bool session_started_; | 320 bool session_started_; |
| 325 | 321 |
| 326 // Cached flag of whether currently logged-in user is owner or not. | 322 // Cached flag of whether currently logged-in user is owner or not. |
| 327 // May be accessed on different threads, requires locking. | 323 // May be accessed on different threads, requires locking. |
| 328 bool is_current_user_owner_; | 324 bool is_current_user_owner_; |
| 329 mutable base::Lock is_current_user_owner_lock_; | 325 mutable base::Lock is_current_user_owner_lock_; |
| 330 | 326 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 | 387 |
| 392 // Timer triggering DownloadProfileDataScheduled for refreshing profile data. | 388 // Timer triggering DownloadProfileDataScheduled for refreshing profile data. |
| 393 base::RepeatingTimer<UserManagerImpl> profile_download_timer_; | 389 base::RepeatingTimer<UserManagerImpl> profile_download_timer_; |
| 394 | 390 |
| 395 DISALLOW_COPY_AND_ASSIGN(UserManagerImpl); | 391 DISALLOW_COPY_AND_ASSIGN(UserManagerImpl); |
| 396 }; | 392 }; |
| 397 | 393 |
| 398 } // namespace chromeos | 394 } // namespace chromeos |
| 399 | 395 |
| 400 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_IMPL_H_ | 396 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_IMPL_H_ |
| OLD | NEW |