OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 virtual bool current_user_is_owner() const; | 118 virtual bool current_user_is_owner() const; |
119 virtual void set_current_user_is_owner(bool current_user_is_owner); | 119 virtual void set_current_user_is_owner(bool current_user_is_owner); |
120 | 120 |
121 // Accessor for current_user_is_new_. | 121 // Accessor for current_user_is_new_. |
122 bool current_user_is_new() const { | 122 bool current_user_is_new() const { |
123 return current_user_is_new_; | 123 return current_user_is_new_; |
124 } | 124 } |
125 | 125 |
126 bool user_is_logged_in() const { return user_is_logged_in_; } | 126 bool user_is_logged_in() const { return user_is_logged_in_; } |
127 | 127 |
128 void set_offline_login(bool value) { offline_login_ = value; } | |
129 bool offline_login() { return offline_login_; } | |
130 | |
131 // Returns true if we're logged in as a Guest. | 128 // Returns true if we're logged in as a Guest. |
132 bool IsLoggedInAsGuest() const; | 129 bool IsLoggedInAsGuest() const; |
133 | 130 |
134 // Interface that observers of UserManager must implement in order | 131 // Interface that observers of UserManager must implement in order |
135 // to receive notification when local state preferences is changed | 132 // to receive notification when local state preferences is changed |
136 class Observer { | 133 class Observer { |
137 public: | 134 public: |
138 // Called when the local state preferences is changed | 135 // Called when the local state preferences is changed |
139 virtual void LocalStateChanged(UserManager* user_manager) = 0; | 136 virtual void LocalStateChanged(UserManager* user_manager) = 0; |
140 | 137 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 User guest_user_; | 233 User guest_user_; |
237 | 234 |
238 // A stub User instance for test paths (running without a logged-in user). | 235 // A stub User instance for test paths (running without a logged-in user). |
239 User stub_user_; | 236 User stub_user_; |
240 | 237 |
241 // The logged-in user. NULL until a user has logged in, then points to one | 238 // The logged-in user. NULL until a user has logged in, then points to one |
242 // of the User instances in |users_| or to the |guest_user_| instance. | 239 // of the User instances in |users_| or to the |guest_user_| instance. |
243 // In test paths without login points to the |stub_user_| instance. | 240 // In test paths without login points to the |stub_user_| instance. |
244 User* logged_in_user_; | 241 User* logged_in_user_; |
245 | 242 |
246 // Current user is logged in offline. Valid only for WebUI login flow. | |
247 bool offline_login_; | |
248 | |
249 // Cached flag of whether currently logged-in user is owner or not. | 243 // Cached flag of whether currently logged-in user is owner or not. |
250 // May be accessed on different threads, requires locking. | 244 // May be accessed on different threads, requires locking. |
251 bool current_user_is_owner_; | 245 bool current_user_is_owner_; |
252 mutable base::Lock current_user_is_owner_lock_; | 246 mutable base::Lock current_user_is_owner_lock_; |
253 | 247 |
254 // Cached flag of whether the currently logged-in user existed before this | 248 // Cached flag of whether the currently logged-in user existed before this |
255 // login. | 249 // login. |
256 bool current_user_is_new_; | 250 bool current_user_is_new_; |
257 | 251 |
258 // Cached flag of whether any user is logged in at the moment. | 252 // Cached flag of whether any user is logged in at the moment. |
(...skipping 21 matching lines...) Expand all Loading... |
280 | 274 |
281 // Data URL for |downloaded_profile_image_|. | 275 // Data URL for |downloaded_profile_image_|. |
282 std::string downloaded_profile_image_data_url_; | 276 std::string downloaded_profile_image_data_url_; |
283 | 277 |
284 DISALLOW_COPY_AND_ASSIGN(UserManager); | 278 DISALLOW_COPY_AND_ASSIGN(UserManager); |
285 }; | 279 }; |
286 | 280 |
287 } // namespace chromeos | 281 } // namespace chromeos |
288 | 282 |
289 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_ | 283 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_ |
OLD | NEW |