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_MANAGER_BASE_H_ | 5 #ifndef COMPONENTS_USER_MANAGER_USER_MANAGER_BASE_H_ |
6 #define COMPONENTS_USER_MANAGER_USER_MANAGER_BASE_H_ | 6 #define COMPONENTS_USER_MANAGER_USER_MANAGER_BASE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 int reauth_reason) override; | 147 int reauth_reason) override; |
148 bool FindReauthReason(const AccountId& account_id, int* out_value) override; | 148 bool FindReauthReason(const AccountId& account_id, int* out_value) override; |
149 | 149 |
150 // This method updates "User was added to the device in this session nad is | 150 // This method updates "User was added to the device in this session nad is |
151 // not full initialized yet" flag. | 151 // not full initialized yet" flag. |
152 virtual void SetIsCurrentUserNew(bool is_new); | 152 virtual void SetIsCurrentUserNew(bool is_new); |
153 | 153 |
154 // TODO(xiyuan): Figure out a better way to expose this info. | 154 // TODO(xiyuan): Figure out a better way to expose this info. |
155 virtual bool HasPendingBootstrap(const AccountId& account_id) const; | 155 virtual bool HasPendingBootstrap(const AccountId& account_id) const; |
156 | 156 |
157 // Helper function that copies users from |users_list| to |users_vector| and | 157 // Helper function that converts users from |users_list| to |users_vector| and |
158 // |users_set|. Duplicates and users already present in |existing_users| are | 158 // |users_set|. Duplicates and users already present in |existing_users| are |
159 // skipped. | 159 // skipped. |
160 static void ParseUserList(const base::ListValue& users_list, | 160 void ParseUserList(const base::ListValue& users_list, |
161 const std::set<AccountId>& existing_users, | 161 const std::set<AccountId>& existing_users, |
162 std::vector<AccountId>* users_vector, | 162 std::vector<AccountId>* users_vector, |
163 std::set<AccountId>* users_set); | 163 std::set<AccountId>* users_set); |
164 | 164 |
165 // Returns true if trusted device policies have successfully been retrieved | 165 // Returns true if trusted device policies have successfully been retrieved |
166 // and ephemeral users are enabled. | 166 // and ephemeral users are enabled. |
167 virtual bool AreEphemeralUsersEnabled() const = 0; | 167 virtual bool AreEphemeralUsersEnabled() const = 0; |
168 | 168 |
169 protected: | 169 protected: |
170 // Adds |user| to users list, and adds it to front of LRU list. It is assumed | 170 // Adds |user| to users list, and adds it to front of LRU list. It is assumed |
171 // that there is no user with same id. | 171 // that there is no user with same id. |
172 virtual void AddUserRecord(User* user); | 172 virtual void AddUserRecord(User* user); |
173 | 173 |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 scoped_refptr<base::TaskRunner> blocking_task_runner_; | 432 scoped_refptr<base::TaskRunner> blocking_task_runner_; |
433 | 433 |
434 base::WeakPtrFactory<UserManagerBase> weak_factory_; | 434 base::WeakPtrFactory<UserManagerBase> weak_factory_; |
435 | 435 |
436 DISALLOW_COPY_AND_ASSIGN(UserManagerBase); | 436 DISALLOW_COPY_AND_ASSIGN(UserManagerBase); |
437 }; | 437 }; |
438 | 438 |
439 } // namespace user_manager | 439 } // namespace user_manager |
440 | 440 |
441 #endif // COMPONENTS_USER_MANAGER_USER_MANAGER_BASE_H_ | 441 #endif // COMPONENTS_USER_MANAGER_USER_MANAGER_BASE_H_ |
OLD | NEW |