| 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 COMPONENTS_USER_MANAGER_USER_H_ | 5 #ifndef COMPONENTS_USER_MANAGER_USER_H_ |
| 6 #define COMPONENTS_USER_MANAGER_USER_H_ | 6 #define COMPONENTS_USER_MANAGER_USER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 158 |
| 159 // True if current user is logged in. | 159 // True if current user is logged in. |
| 160 bool is_logged_in() const; | 160 bool is_logged_in() const; |
| 161 | 161 |
| 162 // True if current user is active within the current session. | 162 // True if current user is active within the current session. |
| 163 bool is_active() const; | 163 bool is_active() const; |
| 164 | 164 |
| 165 // True if the user Profile is created. | 165 // True if the user Profile is created. |
| 166 bool is_profile_created() const { return profile_is_created_; } | 166 bool is_profile_created() const { return profile_is_created_; } |
| 167 | 167 |
| 168 // True if the user is affiliated to the device. |
| 169 bool is_affiliated() const { return is_affiliated_; } |
| 170 |
| 168 protected: | 171 protected: |
| 169 friend class UserManagerBase; | 172 friend class UserManagerBase; |
| 170 friend class chromeos::ChromeUserManagerImpl; | 173 friend class chromeos::ChromeUserManagerImpl; |
| 171 friend class chromeos::SupervisedUserManagerImpl; | 174 friend class chromeos::SupervisedUserManagerImpl; |
| 172 friend class chromeos::UserImageManagerImpl; | 175 friend class chromeos::UserImageManagerImpl; |
| 173 friend class chromeos::UserSessionManager; | 176 friend class chromeos::UserSessionManager; |
| 174 | 177 |
| 175 // For testing: | 178 // For testing: |
| 176 friend class FakeUserManager; | 179 friend class FakeUserManager; |
| 177 friend class chromeos::FakeChromeUserManager; | 180 friend class chromeos::FakeChromeUserManager; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 | 239 |
| 237 void set_can_lock(bool can_lock) { can_lock_ = can_lock; } | 240 void set_can_lock(bool can_lock) { can_lock_ = can_lock; } |
| 238 | 241 |
| 239 void set_is_active(bool is_active) { is_active_ = is_active; } | 242 void set_is_active(bool is_active) { is_active_ = is_active; } |
| 240 | 243 |
| 241 void set_profile_is_created() { profile_is_created_ = true; } | 244 void set_profile_is_created() { profile_is_created_ = true; } |
| 242 | 245 |
| 243 // True if user has google account (not a guest or managed user). | 246 // True if user has google account (not a guest or managed user). |
| 244 bool has_gaia_account() const; | 247 bool has_gaia_account() const; |
| 245 | 248 |
| 249 void set_affiliation(bool is_affiliated) { |
| 250 is_affiliated_ = is_affiliated; |
| 251 } |
| 252 |
| 246 private: | 253 private: |
| 247 std::string email_; | 254 std::string email_; |
| 248 base::string16 display_name_; | 255 base::string16 display_name_; |
| 249 base::string16 given_name_; | 256 base::string16 given_name_; |
| 250 // The displayed user email, defaults to |email_|. | 257 // The displayed user email, defaults to |email_|. |
| 251 std::string display_email_; | 258 std::string display_email_; |
| 252 bool using_saml_; | 259 bool using_saml_; |
| 253 UserImage user_image_; | 260 UserImage user_image_; |
| 254 OAuthTokenStatus oauth_token_status_; | 261 OAuthTokenStatus oauth_token_status_; |
| 255 bool force_online_signin_; | 262 bool force_online_signin_; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 278 | 285 |
| 279 // True if user is currently logged in in current session. | 286 // True if user is currently logged in in current session. |
| 280 bool is_logged_in_; | 287 bool is_logged_in_; |
| 281 | 288 |
| 282 // True if user is currently logged in and active in current session. | 289 // True if user is currently logged in and active in current session. |
| 283 bool is_active_; | 290 bool is_active_; |
| 284 | 291 |
| 285 // True if user Profile is created | 292 // True if user Profile is created |
| 286 bool profile_is_created_; | 293 bool profile_is_created_; |
| 287 | 294 |
| 295 // True if the user is affiliated to the device. |
| 296 bool is_affiliated_; |
| 297 |
| 288 DISALLOW_COPY_AND_ASSIGN(User); | 298 DISALLOW_COPY_AND_ASSIGN(User); |
| 289 }; | 299 }; |
| 290 | 300 |
| 291 // List of known users. | 301 // List of known users. |
| 292 typedef std::vector<User*> UserList; | 302 typedef std::vector<User*> UserList; |
| 293 | 303 |
| 294 } // namespace user_manager | 304 } // namespace user_manager |
| 295 | 305 |
| 296 #endif // COMPONENTS_USER_MANAGER_USER_H_ | 306 #endif // COMPONENTS_USER_MANAGER_USER_H_ |
| OLD | NEW |