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

Unified Diff: chrome/browser/chromeos/login/supervised/supervised_user_creation_screen.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/supervised/supervised_user_creation_screen.cc
diff --git a/chrome/browser/chromeos/login/supervised/supervised_user_creation_screen.cc b/chrome/browser/chromeos/login/supervised/supervised_user_creation_screen.cc
index 1cfd624486b1664ea1da3f182f07c07480053346..32182749f3bc0356f906b27d4abf2080f8f46b00 100644
--- a/chrome/browser/chromeos/login/supervised/supervised_user_creation_screen.cc
+++ b/chrome/browser/chromeos/login/supervised/supervised_user_creation_screen.cc
@@ -216,7 +216,7 @@ void SupervisedUserCreationScreen::HideFlow() {
}
void SupervisedUserCreationScreen::AuthenticateManager(
- const std::string& manager_id,
+ const user_manager::UserID& manager_id,
const std::string& manager_password) {
if (manager_signin_in_progress_)
return;
@@ -250,13 +250,13 @@ void SupervisedUserCreationScreen::CreateSupervisedUser(
}
void SupervisedUserCreationScreen::ImportSupervisedUser(
- const std::string& user_id) {
+ const user_manager::UserID& user_id) {
DCHECK(controller_.get());
DCHECK(existing_users_.get());
- VLOG(1) << "Importing user " << user_id;
+ VLOG(1) << "Importing user " << user_id.GetUserEmail();
base::DictionaryValue* user_info;
- if (!existing_users_->GetDictionary(user_id, &user_info)) {
- LOG(ERROR) << "Can not import non-existing user " << user_id;
+ if (!existing_users_->GetDictionary(user_id.GetUserEmail(), &user_info)) {
+ LOG(ERROR) << "Can not import non-existing user " << user_id.GetUserEmail();
return;
}
base::string16 display_name;
@@ -294,7 +294,7 @@ void SupervisedUserCreationScreen::ImportSupervisedUser(
SupervisedUserSharedSettingsServiceFactory::GetForBrowserContext(
controller_->GetManagerProfile());
const base::Value* value = shared_settings_service->GetValue(
- user_id, supervised_users::kChromeOSPasswordData);
+ user_id.GetUserEmail(), supervised_users::kChromeOSPasswordData);
bool password_right_here = value && value->GetAsDictionary(&password_data) &&
!password_data->empty();
@@ -302,7 +302,7 @@ void SupervisedUserCreationScreen::ImportSupervisedUser(
if (password_right_here) {
controller_->StartImport(display_name,
avatar_index,
- user_id,
+ user_id.GetUserEmail(),
master_key,
password_data,
encryption_key,
@@ -315,14 +315,14 @@ void SupervisedUserCreationScreen::ImportSupervisedUser(
// TODO(antrim): Code duplication with previous method will be removed once
// password sync is implemented.
void SupervisedUserCreationScreen::ImportSupervisedUserWithPassword(
- const std::string& user_id,
+ const user_manager::UserID& user_id,
const std::string& password) {
DCHECK(controller_.get());
DCHECK(existing_users_.get());
- VLOG(1) << "Importing user " << user_id;
+ VLOG(1) << "Importing user " << user_id.GetUserEmail();
base::DictionaryValue* user_info;
- if (!existing_users_->GetDictionary(user_id, &user_info)) {
- LOG(ERROR) << "Can not import non-existing user " << user_id;
+ if (!existing_users_->GetDictionary(user_id.GetUserEmail(), &user_info)) {
+ LOG(ERROR) << "Can not import non-existing user " << user_id.GetUserEmail();
return;
}
base::string16 display_name;
@@ -352,7 +352,7 @@ void SupervisedUserCreationScreen::ImportSupervisedUserWithPassword(
controller_->StartImport(display_name,
password,
avatar_index,
- user_id,
+ user_id.GetUserEmail(),
master_key);
}
@@ -458,7 +458,7 @@ void SupervisedUserCreationScreen::OnLongCreationWarning() {
bool SupervisedUserCreationScreen::FindUserByDisplayName(
const base::string16& display_name,
- std::string *out_id) const {
+ std::string *out_email) const {
if (!existing_users_.get())
return false;
for (base::DictionaryValue::Iterator it(*existing_users_.get());
@@ -469,8 +469,8 @@ bool SupervisedUserCreationScreen::FindUserByDisplayName(
if (user_info->GetString(SupervisedUserSyncService::kName,
&user_display_name)) {
if (display_name == user_display_name) {
- if (out_id)
- *out_id = it.key();
+ if (out_email)
+ *out_email = it.key();
return true;
}
}
@@ -482,7 +482,7 @@ bool SupervisedUserCreationScreen::FindUserByDisplayName(
// It should be removed by issue 251179.
void SupervisedUserCreationScreen::ApplyPicture() {
- std::string user_id = controller_->GetSupervisedUserId();
+ user_manager::UserID user_id = controller_->GetSupervisedUserId();
UserImageManager* image_manager =
ChromeUserManager::Get()->GetUserImageManager(user_id);
switch (selected_image_) {

Powered by Google App Engine
This is Rietveld 408576698