| 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 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 std::set<AccountId>* users_set) { | 487 std::set<AccountId>* users_set) { |
| 488 users_vector->clear(); | 488 users_vector->clear(); |
| 489 users_set->clear(); | 489 users_set->clear(); |
| 490 for (size_t i = 0; i < users_list.GetSize(); ++i) { | 490 for (size_t i = 0; i < users_list.GetSize(); ++i) { |
| 491 std::string email; | 491 std::string email; |
| 492 if (!users_list.GetString(i, &email) || email.empty()) { | 492 if (!users_list.GetString(i, &email) || email.empty()) { |
| 493 LOG(ERROR) << "Corrupt entry in user list at index " << i << "."; | 493 LOG(ERROR) << "Corrupt entry in user list at index " << i << "."; |
| 494 continue; | 494 continue; |
| 495 } | 495 } |
| 496 | 496 |
| 497 const AccountId account_id = known_user::GetAccountId(email, std::string()); | 497 const AccountId account_id = known_user::GetAccountId( |
| 498 email, std::string() /* id */, AccountType::UNKNOWN); |
| 498 | 499 |
| 499 if (existing_users.find(account_id) != existing_users.end() || | 500 if (existing_users.find(account_id) != existing_users.end() || |
| 500 !users_set->insert(account_id).second) { | 501 !users_set->insert(account_id).second) { |
| 501 LOG(ERROR) << "Duplicate user: " << email; | 502 LOG(ERROR) << "Duplicate user: " << email; |
| 502 continue; | 503 continue; |
| 503 } | 504 } |
| 504 users_vector->push_back(account_id); | 505 users_vector->push_back(account_id); |
| 505 } | 506 } |
| 506 } | 507 } |
| 507 | 508 |
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1085 } | 1086 } |
| 1086 | 1087 |
| 1087 void UserManagerBase::DeleteUser(User* user) { | 1088 void UserManagerBase::DeleteUser(User* user) { |
| 1088 const bool is_active_user = (user == active_user_); | 1089 const bool is_active_user = (user == active_user_); |
| 1089 delete user; | 1090 delete user; |
| 1090 if (is_active_user) | 1091 if (is_active_user) |
| 1091 active_user_ = nullptr; | 1092 active_user_ = nullptr; |
| 1092 } | 1093 } |
| 1093 | 1094 |
| 1094 } // namespace user_manager | 1095 } // namespace user_manager |
| OLD | NEW |