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

Unified Diff: chrome/browser/chromeos/login/screen_locker.cc

Issue 12704002: Support for auth code based authentication flow for both app and web UI driven flow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase4 Created 7 years, 9 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/screen_locker.cc
diff --git a/chrome/browser/chromeos/login/screen_locker.cc b/chrome/browser/chromeos/login/screen_locker.cc
index d002223409cc1e7705d7fff0d0c1cfce53a21e4e..caa3cfd9be8ff62b247fd5eb2bcd8c3891a7c42c 100644
--- a/chrome/browser/chromeos/login/screen_locker.cc
+++ b/chrome/browser/chromeos/login/screen_locker.cc
@@ -182,13 +182,12 @@ void ScreenLocker::OnLoginFailure(const LoginFailure& error) {
}
void ScreenLocker::OnLoginSuccess(
- const std::string& username,
- const std::string& password,
+ const UserCredentials& credentials,
bool pending_requests,
bool using_oauth) {
incorrect_passwords_count_ = 0;
if (authentication_start_time_.is_null()) {
- if (!username.empty())
+ if (!credentials.username.empty())
LOG(ERROR) << "Start time is not set at authentication success";
} else {
base::TimeDelta delta = base::Time::Now() - authentication_start_time_;
@@ -197,14 +196,14 @@ void ScreenLocker::OnLoginSuccess(
}
Profile* profile = ProfileManager::GetDefaultProfile();
- if (profile && !password.empty()) {
+ if (profile && !credentials.password.empty()) {
// We have a non-empty password, so notify listeners (such as the sync
// engine).
SigninManager* signin = SigninManagerFactory::GetForProfile(profile);
DCHECK(signin);
GoogleServiceSigninSuccessDetails details(
signin->GetAuthenticatedUsername(),
- password);
+ credentials.password);
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_GOOGLE_SIGNIN_SUCCESSFUL,
content::Source<Profile>(profile),
@@ -212,7 +211,7 @@ void ScreenLocker::OnLoginSuccess(
}
authentication_capture_.reset(new AuthenticationParametersCapture());
- authentication_capture_->username = username;
+ authentication_capture_->username = credentials.username;
authentication_capture_->pending_requests = pending_requests;
authentication_capture_->using_oauth = using_oauth;
@@ -244,8 +243,9 @@ void ScreenLocker::UnlockOnLoginSuccess() {
if (login_status_consumer_) {
login_status_consumer_->OnLoginSuccess(
- authentication_capture_->username,
- std::string(),
+ UserCredentials(authentication_capture_->username,
+ std::string(), // password
+ std::string()), // auth_code
authentication_capture_->pending_requests,
authentication_capture_->using_oauth);
}
@@ -263,13 +263,17 @@ void ScreenLocker::Authenticate(const string16& password) {
if (LoginPerformer::default_performer()) {
DVLOG(1) << "Delegating authentication to LoginPerformer.";
LoginPerformer::default_performer()->PerformLogin(
- user_.email(), UTF16ToUTF8(password),
+ UserCredentials(user_.email(),
+ UTF16ToUTF8(password),
+ std::string()), // auth_code
LoginPerformer::AUTH_MODE_INTERNAL);
} else {
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(&Authenticator::AuthenticateToUnlock, authenticator_.get(),
- user_.email(), UTF16ToUTF8(password)));
+ UserCredentials(user_.email(),
+ UTF16ToUTF8(password),
+ std::string()))); // auth_code
}
}
« no previous file with comments | « chrome/browser/chromeos/login/screen_locker.h ('k') | chrome/browser/chromeos/login/screen_locker_tester.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698