| 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 <memory> | 9 #include <memory> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 // skipped. | 125 // skipped. |
| 126 void ParseUserList(const base::ListValue& users_list, | 126 void ParseUserList(const base::ListValue& users_list, |
| 127 const std::set<AccountId>& existing_users, | 127 const std::set<AccountId>& existing_users, |
| 128 std::vector<AccountId>* users_vector, | 128 std::vector<AccountId>* users_vector, |
| 129 std::set<AccountId>* users_set); | 129 std::set<AccountId>* users_set); |
| 130 | 130 |
| 131 // Returns true if trusted device policies have successfully been retrieved | 131 // Returns true if trusted device policies have successfully been retrieved |
| 132 // and ephemeral users are enabled. | 132 // and ephemeral users are enabled. |
| 133 virtual bool AreEphemeralUsersEnabled() const = 0; | 133 virtual bool AreEphemeralUsersEnabled() const = 0; |
| 134 | 134 |
| 135 void AddUserRecordForTesting(User* user) { |
| 136 return AddUserRecord(user); |
| 137 } |
| 138 |
| 135 protected: | 139 protected: |
| 136 // Adds |user| to users list, and adds it to front of LRU list. It is assumed | 140 // Adds |user| to users list, and adds it to front of LRU list. It is assumed |
| 137 // that there is no user with same id. | 141 // that there is no user with same id. |
| 138 virtual void AddUserRecord(User* user); | 142 virtual void AddUserRecord(User* user); |
| 139 | 143 |
| 140 // Returns true if user may be removed. | 144 // Returns true if user may be removed. |
| 141 virtual bool CanUserBeRemoved(const User* user) const; | 145 virtual bool CanUserBeRemoved(const User* user) const; |
| 142 | 146 |
| 143 // A wrapper around C++ delete operator. Deletes |user|, and when |user| | 147 // A wrapper around C++ delete operator. Deletes |user|, and when |user| |
| 144 // equals to active_user_, active_user_ is reset to NULL. | 148 // equals to active_user_, active_user_ is reset to NULL. |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 scoped_refptr<base::TaskRunner> task_runner_; | 390 scoped_refptr<base::TaskRunner> task_runner_; |
| 387 | 391 |
| 388 base::WeakPtrFactory<UserManagerBase> weak_factory_; | 392 base::WeakPtrFactory<UserManagerBase> weak_factory_; |
| 389 | 393 |
| 390 DISALLOW_COPY_AND_ASSIGN(UserManagerBase); | 394 DISALLOW_COPY_AND_ASSIGN(UserManagerBase); |
| 391 }; | 395 }; |
| 392 | 396 |
| 393 } // namespace user_manager | 397 } // namespace user_manager |
| 394 | 398 |
| 395 #endif // COMPONENTS_USER_MANAGER_USER_MANAGER_BASE_H_ | 399 #endif // COMPONENTS_USER_MANAGER_USER_MANAGER_BASE_H_ |
| OLD | NEW |