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

Unified Diff: chrome/browser/chromeos/login/screens/user_selection_screen.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: Bugfix in original easy unlock code' 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/screens/user_selection_screen.cc
diff --git a/chrome/browser/chromeos/login/screens/user_selection_screen.cc b/chrome/browser/chromeos/login/screens/user_selection_screen.cc
index c2df683dd457b54069f5d02b229ae9267011bbaf..68609e657cef6f24c09d7498a62dcfe01c783c67 100644
--- a/chrome/browser/chromeos/login/screens/user_selection_screen.cc
+++ b/chrome/browser/chromeos/login/screens/user_selection_screen.cc
@@ -429,29 +429,25 @@ void UserSelectionScreen::OnUserStatusChecked(
if (status == TokenHandleUtil::INVALID) {
RecordReauthReason(account_id, ReauthReason::INVALID_TOKEN_HANDLE);
token_handle_util_->MarkHandleInvalid(account_id);
- SetAuthType(account_id.GetUserEmail(), ONLINE_SIGN_IN, base::string16());
+ SetAuthType(account_id, ONLINE_SIGN_IN, base::string16());
}
}
// EasyUnlock stuff
-void UserSelectionScreen::SetAuthType(const std::string& user_id,
+void UserSelectionScreen::SetAuthType(const AccountId& account_id,
AuthType auth_type,
const base::string16& initial_value) {
- const AccountId& account_id =
- user_manager::UserManager::GetKnownUserAccountId(user_id, std::string());
- if (GetAuthType(account_id.GetUserEmail()) == FORCE_OFFLINE_PASSWORD)
+ if (GetAuthType(account_id) == FORCE_OFFLINE_PASSWORD)
return;
- DCHECK(GetAuthType(account_id.GetUserEmail()) != FORCE_OFFLINE_PASSWORD ||
+ DCHECK(GetAuthType(account_id) != FORCE_OFFLINE_PASSWORD ||
auth_type == FORCE_OFFLINE_PASSWORD);
user_auth_type_map_[account_id] = auth_type;
view_->SetAuthType(account_id, auth_type, initial_value);
}
proximity_auth::ScreenlockBridge::LockHandler::AuthType
-UserSelectionScreen::GetAuthType(const std::string& username) const {
- const AccountId& account_id =
- user_manager::UserManager::GetKnownUserAccountId(username, std::string());
+UserSelectionScreen::GetAuthType(const AccountId& account_id) const {
if (user_auth_type_map_.find(account_id) == user_auth_type_map_.end())
return OFFLINE_PASSWORD;
return user_auth_type_map_.find(account_id)->second;
@@ -473,20 +469,16 @@ void UserSelectionScreen::ShowBannerMessage(const base::string16& message) {
}
void UserSelectionScreen::ShowUserPodCustomIcon(
- const std::string& user_id,
+ const AccountId& account_id,
const proximity_auth::ScreenlockBridge::UserPodCustomIconOptions&
icon_options) {
scoped_ptr<base::DictionaryValue> icon = icon_options.ToDictionaryValue();
if (!icon || icon->empty())
return;
- const AccountId account_id =
- user_manager::UserManager::GetKnownUserAccountId(user_id, std::string());
view_->ShowUserPodCustomIcon(account_id, *icon);
}
-void UserSelectionScreen::HideUserPodCustomIcon(const std::string& user_id) {
- const AccountId account_id =
- user_manager::UserManager::GetKnownUserAccountId(user_id, std::string());
+void UserSelectionScreen::HideUserPodCustomIcon(const AccountId& account_id) {
view_->HideUserPodCustomIcon(account_id);
}
@@ -498,18 +490,17 @@ void UserSelectionScreen::EnableInput() {
ScreenLocker::default_screen_locker()->EnableInput();
}
-void UserSelectionScreen::Unlock(const std::string& user_email) {
+void UserSelectionScreen::Unlock(const AccountId& account_id) {
DCHECK_EQ(GetScreenType(), LOCK_SCREEN);
ScreenLocker::Hide();
}
-void UserSelectionScreen::AttemptEasySignin(const std::string& user_id,
+void UserSelectionScreen::AttemptEasySignin(const AccountId& account_id,
const std::string& secret,
const std::string& key_label) {
DCHECK_EQ(GetScreenType(), SIGNIN_SCREEN);
- UserContext user_context(
- user_manager::UserManager::GetKnownUserAccountId(user_id, std::string()));
+ UserContext user_context(account_id);
user_context.SetAuthFlow(UserContext::AUTH_FLOW_EASY_UNLOCK);
user_context.SetKey(Key(secret));
user_context.GetKey()->SetLabel(key_label);
@@ -529,7 +520,7 @@ void UserSelectionScreen::AttemptEasyUnlock(const AccountId& account_id) {
EasyUnlockService* service = GetEasyUnlockServiceForUser(account_id);
if (!service)
return;
- service->AttemptAuth(account_id.GetUserEmail());
+ service->AttemptAuth(account_id);
}
void UserSelectionScreen::RecordClickOnLockIcon(const AccountId& account_id) {

Powered by Google App Engine
This is Rietveld 408576698