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 #include "chrome/browser/chromeos/login/users/chrome_user_manager_util.h" | 5 #include "chrome/browser/chromeos/login/users/chrome_user_manager_util.h" |
6 | 6 |
7 #include "chromeos/login/user_names.h" | |
8 #include "components/user_manager/user.h" | 7 #include "components/user_manager/user.h" |
| 8 #include "components/user_manager/user_names.h" |
9 #include "components/user_manager/user_type.h" | 9 #include "components/user_manager/user_type.h" |
10 | 10 |
11 namespace chromeos { | 11 namespace chromeos { |
12 namespace chrome_user_manager_util { | 12 namespace chrome_user_manager_util { |
13 | 13 |
14 bool GetPlatformKnownUserId(const std::string& user_email, | 14 bool GetPlatformKnownUserId(const std::string& user_email, |
15 const std::string& gaia_id, | 15 const std::string& gaia_id, |
16 AccountId* out_account_id) { | 16 AccountId* out_account_id) { |
17 if (user_email == chromeos::login::kStubUser) { | 17 if (user_email == user_manager::kStubUser) { |
18 *out_account_id = chromeos::login::StubAccountId(); | 18 *out_account_id = user_manager::StubAccountId(); |
19 return true; | 19 return true; |
20 } | 20 } |
21 | 21 |
22 if (user_email == chromeos::login::kGuestUserName) { | 22 if (user_email == user_manager::kGuestUserName) { |
23 *out_account_id = chromeos::login::GuestAccountId(); | 23 *out_account_id = user_manager::GuestAccountId(); |
24 return true; | 24 return true; |
25 } | 25 } |
26 return false; | 26 return false; |
27 } | 27 } |
28 | 28 |
29 void UpdateLoginState(const user_manager::User* active_user, | 29 void UpdateLoginState(const user_manager::User* active_user, |
30 const user_manager::User* primary_user, | 30 const user_manager::User* primary_user, |
31 bool is_current_user_owner) { | 31 bool is_current_user_owner) { |
32 if (!chromeos::LoginState::IsInitialized()) | 32 if (!chromeos::LoginState::IsInitialized()) |
33 return; // LoginState may not be initialized in tests. | 33 return; // LoginState may not be initialized in tests. |
(...skipping 24 matching lines...) Expand all Loading... |
58 chromeos::LoginState::Get()->SetLoggedInStateAndPrimaryUser( | 58 chromeos::LoginState::Get()->SetLoggedInStateAndPrimaryUser( |
59 logged_in_state, login_user_type, primary_user->username_hash()); | 59 logged_in_state, login_user_type, primary_user->username_hash()); |
60 } else { | 60 } else { |
61 chromeos::LoginState::Get()->SetLoggedInState(logged_in_state, | 61 chromeos::LoginState::Get()->SetLoggedInState(logged_in_state, |
62 login_user_type); | 62 login_user_type); |
63 } | 63 } |
64 } | 64 } |
65 | 65 |
66 } // namespace chrome_user_manager_util | 66 } // namespace chrome_user_manager_util |
67 } // namespace chromeos | 67 } // namespace chromeos |
OLD | NEW |