| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_USERS_FAKE_CHROME_USER_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USERS_FAKE_CHROME_USER_MANAGER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USERS_FAKE_CHROME_USER_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USERS_FAKE_CHROME_USER_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 | 169 |
| 170 void set_bootstrap_manager(BootstrapManager* bootstrap_manager) { | 170 void set_bootstrap_manager(BootstrapManager* bootstrap_manager) { |
| 171 bootstrap_manager_ = bootstrap_manager; | 171 bootstrap_manager_ = bootstrap_manager; |
| 172 } | 172 } |
| 173 | 173 |
| 174 void set_multi_profile_user_controller( | 174 void set_multi_profile_user_controller( |
| 175 MultiProfileUserController* controller) { | 175 MultiProfileUserController* controller) { |
| 176 multi_profile_user_controller_ = controller; | 176 multi_profile_user_controller_ = controller; |
| 177 } | 177 } |
| 178 | 178 |
| 179 void set_current_user_new(bool new_user) { current_user_new_ = new_user; } |
| 180 |
| 179 private: | 181 private: |
| 180 // Lazily creates default user flow. | 182 // Lazily creates default user flow. |
| 181 UserFlow* GetDefaultUserFlow() const; | 183 UserFlow* GetDefaultUserFlow() const; |
| 182 | 184 |
| 183 // Returns the active user. | 185 // Returns the active user. |
| 184 user_manager::User* GetActiveUserInternal() const; | 186 user_manager::User* GetActiveUserInternal() const; |
| 185 | 187 |
| 186 std::unique_ptr<FakeSupervisedUserManager> supervised_user_manager_; | 188 std::unique_ptr<FakeSupervisedUserManager> supervised_user_manager_; |
| 187 AccountId owner_account_id_ = EmptyAccountId(); | 189 AccountId owner_account_id_ = EmptyAccountId(); |
| 188 bool fake_ephemeral_users_enabled_ = false; | 190 bool fake_ephemeral_users_enabled_ = false; |
| 191 bool current_user_new_ = false; |
| 189 | 192 |
| 190 BootstrapManager* bootstrap_manager_ = nullptr; | 193 BootstrapManager* bootstrap_manager_ = nullptr; |
| 191 MultiProfileUserController* multi_profile_user_controller_ = nullptr; | 194 MultiProfileUserController* multi_profile_user_controller_ = nullptr; |
| 192 | 195 |
| 193 // If set this is the active user. If empty, the first created user is the | 196 // If set this is the active user. If empty, the first created user is the |
| 194 // active user. | 197 // active user. |
| 195 AccountId active_account_id_ = EmptyAccountId(); | 198 AccountId active_account_id_ = EmptyAccountId(); |
| 196 | 199 |
| 197 // Lazy-initialized default flow. | 200 // Lazy-initialized default flow. |
| 198 mutable std::unique_ptr<UserFlow> default_flow_; | 201 mutable std::unique_ptr<UserFlow> default_flow_; |
| 199 | 202 |
| 200 using FlowMap = std::map<AccountId, UserFlow*>; | 203 using FlowMap = std::map<AccountId, UserFlow*>; |
| 201 | 204 |
| 202 // Specific flows by user e-mail. | 205 // Specific flows by user e-mail. |
| 203 // Keys should be canonicalized before access. | 206 // Keys should be canonicalized before access. |
| 204 FlowMap specific_flows_; | 207 FlowMap specific_flows_; |
| 205 | 208 |
| 206 DISALLOW_COPY_AND_ASSIGN(FakeChromeUserManager); | 209 DISALLOW_COPY_AND_ASSIGN(FakeChromeUserManager); |
| 207 }; | 210 }; |
| 208 | 211 |
| 209 } // namespace chromeos | 212 } // namespace chromeos |
| 210 | 213 |
| 211 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USERS_FAKE_CHROME_USER_MANAGER_H_ | 214 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USERS_FAKE_CHROME_USER_MANAGER_H_ |
| OLD | NEW |