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

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

Issue 1165323004: We should use UserID object to identify users instead of username. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 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..644afedfe152436c2b3e4e894f6b9364ee3c2be8 100644
--- a/chrome/browser/chromeos/login/easy_unlock/bootstrap_manager.cc
+++ b/chrome/browser/chromeos/login/easy_unlock/bootstrap_manager.cc
@@ -31,21 +31,21 @@ BootstrapManager::BootstrapManager(Delegate* delegate)
BootstrapManager::~BootstrapManager() {
}
-void BootstrapManager::AddPendingBootstrap(const std::string& user_id) {
+void BootstrapManager::AddPendingBootstrap(const user_manager::UserID& user_id) {
DCHECK(!user_id.empty());
PrefService* local_state = g_browser_process->local_state();
ListPrefUpdate update(local_state, kPendingEasyBootstrapUsers);
- update->AppendString(user_id);
+ update->AppendString(user_id.GetUserEmail());
}
-void BootstrapManager::FinishPendingBootstrap(const std::string& user_id) {
+void BootstrapManager::FinishPendingBootstrap(const user_manager::UserID& user_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;
- if (update->GetString(i, &current_user) && user_id == current_user) {
+ if (update->GetString(i, &current_user) && user_id.GetUserEmail() == current_user) {
update->Remove(i, NULL);
break;
}
@@ -58,23 +58,23 @@ 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::UserID::FromUserEmail(current_user_email));
}
local_state->ClearPref(kPendingEasyBootstrapUsers);
local_state->CommitPendingWrite();
}
-bool BootstrapManager::HasPendingBootstrap(const std::string& user_id) const {
+bool BootstrapManager::HasPendingBootstrap(const user_manager::UserID& user_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)
+ std::string current_user_email;
+ if (users->GetString(i, &current_user_email) && user_id.GetUserEmail() == current_user_email)
return true;
}
return false;

Powered by Google App Engine
This is Rietveld 408576698