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

Unified Diff: chrome/browser/chromeos/login/easy_unlock/bootstrap_manager.cc

Issue 1494153002: This CL replaces e-mail with AccountId in easy signin code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build. Created 5 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/easy_unlock/bootstrap_manager.cc
diff --git a/chrome/browser/chromeos/login/easy_unlock/bootstrap_manager.cc b/chrome/browser/chromeos/login/easy_unlock/bootstrap_manager.cc
index 7ad5ddeaaaa4f4faa7a497ef3f7e811afb6a6c3a..c3fa8d6fbdf97c2d779376075b3fe158f81ccd65 100644
--- a/chrome/browser/chromeos/login/easy_unlock/bootstrap_manager.cc
+++ b/chrome/browser/chromeos/login/easy_unlock/bootstrap_manager.cc
@@ -31,21 +31,22 @@ BootstrapManager::BootstrapManager(Delegate* delegate)
BootstrapManager::~BootstrapManager() {
}
-void BootstrapManager::AddPendingBootstrap(const std::string& user_id) {
- DCHECK(!user_id.empty());
+void BootstrapManager::AddPendingBootstrap(const AccountId& account_id) {
+ DCHECK(account_id.is_valid());
PrefService* local_state = g_browser_process->local_state();
ListPrefUpdate update(local_state, kPendingEasyBootstrapUsers);
- update->AppendString(user_id);
+ update->AppendString(account_id.GetUserEmail());
}
-void BootstrapManager::FinishPendingBootstrap(const std::string& user_id) {
+void BootstrapManager::FinishPendingBootstrap(const AccountId& account_id) {
PrefService* local_state = g_browser_process->local_state();
ListPrefUpdate update(local_state, kPendingEasyBootstrapUsers);
for (size_t i = 0; i < update->GetSize(); ++i) {
std::string current_user;
achuithb 2015/12/04 10:12:52 let's make this current_user_email too
Alexander Alekseev 2015/12/04 12:44:06 Done.
- if (update->GetString(i, &current_user) && user_id == current_user) {
+ if (update->GetString(i, &current_user) &&
+ account_id.GetUserEmail() == current_user) {
update->Remove(i, NULL);
break;
}
@@ -58,23 +59,27 @@ void BootstrapManager::RemoveAllPendingBootstrap() {
const base::ListValue* users =
local_state->GetList(kPendingEasyBootstrapUsers);
for (size_t i = 0; i < users->GetSize(); ++i) {
- std::string current_user;
- if (users->GetString(i, &current_user))
- delegate_->RemovePendingBootstrapUser(current_user);
+ std::string current_user_email;
+ if (users->GetString(i, &current_user_email)) {
+ delegate_->RemovePendingBootstrapUser(
+ user_manager::UserManager::Get()->GetKnownUserAccountId(
+ current_user_email, std::string()));
achuithb 2015/12/04 10:12:52 add comment /* gaia_id */
Alexander Alekseev 2015/12/04 12:44:06 Done.
+ }
}
local_state->ClearPref(kPendingEasyBootstrapUsers);
local_state->CommitPendingWrite();
}
-bool BootstrapManager::HasPendingBootstrap(const std::string& user_id) const {
+bool BootstrapManager::HasPendingBootstrap(const AccountId& account_id) const {
PrefService* local_state = g_browser_process->local_state();
const base::ListValue* users =
local_state->GetList(kPendingEasyBootstrapUsers);
for (size_t i = 0; i < users->GetSize(); ++i) {
std::string current_user;
- if (users->GetString(i, &current_user) && user_id == current_user)
+ if (users->GetString(i, &current_user) &&
+ account_id.GetUserEmail() == current_user)
return true;
}
return false;

Powered by Google App Engine
This is Rietveld 408576698