Chromium Code Reviews| 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 #include "components/user_manager/user_manager_base.h" | 5 #include "components/user_manager/user_manager_base.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 483 std::set<AccountId>* users_set) { | 483 std::set<AccountId>* users_set) { |
| 484 users_vector->clear(); | 484 users_vector->clear(); |
| 485 users_set->clear(); | 485 users_set->clear(); |
| 486 for (size_t i = 0; i < users_list.GetSize(); ++i) { | 486 for (size_t i = 0; i < users_list.GetSize(); ++i) { |
| 487 std::string email; | 487 std::string email; |
| 488 if (!users_list.GetString(i, &email) || email.empty()) { | 488 if (!users_list.GetString(i, &email) || email.empty()) { |
| 489 LOG(ERROR) << "Corrupt entry in user list at index " << i << "."; | 489 LOG(ERROR) << "Corrupt entry in user list at index " << i << "."; |
| 490 continue; | 490 continue; |
| 491 } | 491 } |
| 492 | 492 |
| 493 const AccountId account_id = known_user::GetAccountId(email, std::string()); | 493 const AccountId account_id = known_user::GetAccountId( |
| 494 email, std::string() /* gaia_id */, AccountType::UNKNOWN); | |
|
Roger Tawa OOO till Jul 10th
2016/12/05 16:34:32
It's unclear to me why the type is unknown. If th
Alexander Alekseev
2016/12/06 02:21:14
"Known_user::GetAccountId()" is a bit tricky. This
| |
| 494 | 495 |
| 495 if (existing_users.find(account_id) != existing_users.end() || | 496 if (existing_users.find(account_id) != existing_users.end() || |
| 496 !users_set->insert(account_id).second) { | 497 !users_set->insert(account_id).second) { |
| 497 LOG(ERROR) << "Duplicate user: " << email; | 498 LOG(ERROR) << "Duplicate user: " << email; |
| 498 continue; | 499 continue; |
| 499 } | 500 } |
| 500 users_vector->push_back(account_id); | 501 users_vector->push_back(account_id); |
| 501 } | 502 } |
| 502 } | 503 } |
| 503 | 504 |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1061 } | 1062 } |
| 1062 | 1063 |
| 1063 void UserManagerBase::DeleteUser(User* user) { | 1064 void UserManagerBase::DeleteUser(User* user) { |
| 1064 const bool is_active_user = (user == active_user_); | 1065 const bool is_active_user = (user == active_user_); |
| 1065 delete user; | 1066 delete user; |
| 1066 if (is_active_user) | 1067 if (is_active_user) |
| 1067 active_user_ = nullptr; | 1068 active_user_ = nullptr; |
| 1068 } | 1069 } |
| 1069 | 1070 |
| 1070 } // namespace user_manager | 1071 } // namespace user_manager |
| OLD | NEW |