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

Side by Side Diff: components/signin/core/browser/account_tracker_service.cc

Issue 964563002: Replace SetAuthenticatedUsername with SetAuthenticatedAccountId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@priv
Patch Set: rebased Created 5 years, 8 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
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/signin/core/browser/account_tracker_service.h" 5 #include "components/signin/core/browser/account_tracker_service.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 return (email.find('@') == std::string::npos) ? email : 594 return (email.find('@') == std::string::npos) ? email :
595 gaia::CanonicalizeEmail(email); 595 gaia::CanonicalizeEmail(email);
596 case MIGRATION_DONE: 596 case MIGRATION_DONE:
597 return gaia; 597 return gaia;
598 default: 598 default:
599 NOTREACHED(); 599 NOTREACHED();
600 return email; 600 return email;
601 } 601 }
602 } 602 }
603 603
604 void AccountTrackerService::SeedAccountInfo(const std::string& gaia, 604 std::string AccountTrackerService::SeedAccountInfo(const std::string& gaia,
605 const std::string& email) { 605 const std::string& email) {
606 DVLOG(1) << "AccountTrackerService::SeedAccountInfo"
607 << " gaia_id=" << gaia
608 << " email=" << email;
609
610 DCHECK(!gaia.empty()); 606 DCHECK(!gaia.empty());
611 DCHECK(!email.empty()); 607 DCHECK(!email.empty());
612 const std::string account_id = PickAccountIdForAccount(gaia, email); 608 const std::string account_id = PickAccountIdForAccount(gaia, email);
613 const bool already_exists = ContainsKey(accounts_, account_id); 609 const bool already_exists = ContainsKey(accounts_, account_id);
614 StartTrackingAccount(account_id); 610 StartTrackingAccount(account_id);
615 AccountState& state = accounts_[account_id]; 611 AccountState& state = accounts_[account_id];
616 DCHECK(!already_exists || state.info.gaia == gaia); 612 DCHECK(!already_exists || state.info.gaia == gaia);
617 state.info.gaia = gaia; 613 state.info.gaia = gaia;
618 state.info.email = email; 614 state.info.email = email;
619 SaveToPrefs(state); 615 SaveToPrefs(state);
616
617 DVLOG(1) << "AccountTrackerService::SeedAccountInfo"
618 << " account_id=" << account_id
619 << " gaia_id=" << gaia
620 << " email=" << email;
621
622 return account_id;
620 } 623 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698