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

Unified Diff: chrome/browser/chromeos/login/auth/online_attempt_host.cc

Issue 296773002: Add a Key class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 years, 7 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/auth/online_attempt_host.cc
diff --git a/chrome/browser/chromeos/login/auth/online_attempt_host.cc b/chrome/browser/chromeos/login/auth/online_attempt_host.cc
index 6a88b76c5de5927a27c4b7b003275362afb004c5..36c4fa2c10aa786b6f3a194091162450c72e4a93 100644
--- a/chrome/browser/chromeos/login/auth/online_attempt_host.cc
+++ b/chrome/browser/chromeos/login/auth/online_attempt_host.cc
@@ -5,7 +5,6 @@
#include "chrome/browser/chromeos/login/auth/online_attempt_host.h"
#include "base/bind.h"
-#include "base/sha1.h"
#include "chrome/browser/chromeos/login/auth/auth_attempt_state.h"
#include "chrome/browser/chromeos/login/auth/online_attempt.h"
#include "chrome/browser/chromeos/login/auth/user_context.h"
@@ -25,12 +24,9 @@ OnlineAttemptHost::~OnlineAttemptHost() {
void OnlineAttemptHost::Check(content::BrowserContext* auth_context,
const UserContext& user_context) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
- std::string attempt_hash = base::SHA1HashString(
- user_context.GetUserID() + "\n" + user_context.GetPassword());
- if (attempt_hash != current_attempt_hash_) {
+ if (user_context != current_attempt_user_context_) {
Reset();
- current_attempt_hash_ = attempt_hash;
- current_username_ = user_context.GetUserID();
+ current_attempt_user_context_ = user_context;
state_.reset(new AuthAttemptState(user_context,
User::USER_TYPE_REGULAR,
@@ -45,8 +41,7 @@ void OnlineAttemptHost::Check(content::BrowserContext* auth_context,
void OnlineAttemptHost::Reset() {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
online_attempt_.reset(NULL);
- current_attempt_hash_.clear();
- current_username_.clear();
+ current_attempt_user_context_ = UserContext();
}
void OnlineAttemptHost::Resolve() {
@@ -64,7 +59,7 @@ void OnlineAttemptHost::Resolve() {
void OnlineAttemptHost::ResolveOnUIThread(bool success) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
- delegate_->OnChecked(current_username_, success);
+ delegate_->OnChecked(current_attempt_user_context_.GetUserID(), success);
Reset();
}
« no previous file with comments | « chrome/browser/chromeos/login/auth/online_attempt_host.h ('k') | chrome/browser/chromeos/login/auth/parallel_authenticator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698