Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: components/user_manager/user_manager_base.cc

Issue 2593133002: Revert of Add account_type into AccountId (Closed)
Patch Set: Created 3 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/user_manager/known_user.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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( 497 const AccountId account_id = known_user::GetAccountId(email, std::string());
498 email, std::string() /* id */, AccountType::UNKNOWN);
499 498
500 if (existing_users.find(account_id) != existing_users.end() || 499 if (existing_users.find(account_id) != existing_users.end() ||
501 !users_set->insert(account_id).second) { 500 !users_set->insert(account_id).second) {
502 LOG(ERROR) << "Duplicate user: " << email; 501 LOG(ERROR) << "Duplicate user: " << email;
503 continue; 502 continue;
504 } 503 }
505 users_vector->push_back(account_id); 504 users_vector->push_back(account_id);
506 } 505 }
507 } 506 }
508 507
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after
1086 } 1085 }
1087 1086
1088 void UserManagerBase::DeleteUser(User* user) { 1087 void UserManagerBase::DeleteUser(User* user) {
1089 const bool is_active_user = (user == active_user_); 1088 const bool is_active_user = (user == active_user_);
1090 delete user; 1089 delete user;
1091 if (is_active_user) 1090 if (is_active_user)
1092 active_user_ = nullptr; 1091 active_user_ = nullptr;
1093 } 1092 }
1094 1093
1095 } // namespace user_manager 1094 } // namespace user_manager
OLDNEW
« no previous file with comments | « components/user_manager/known_user.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698