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

Unified Diff: chrome/browser/chromeos/login/mock_authenticator.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/mock_authenticator.cc
diff --git a/chrome/browser/chromeos/login/mock_authenticator.cc b/chrome/browser/chromeos/login/mock_authenticator.cc
index c1c2ad15dbe4b150caa8bd89870072dd9c46253c..ac505e25fa5415fb1255e67a1c00eb63345568a0 100644
--- a/chrome/browser/chromeos/login/mock_authenticator.cc
+++ b/chrome/browser/chromeos/login/mock_authenticator.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/chromeos/login/mock_authenticator.h"
#include "base/bind.h"
+#include "chrome/browser/chromeos/login/user.h"
#include "content/public/browser/browser_thread.h"
using content::BrowserThread;
@@ -12,11 +13,11 @@ using content::BrowserThread;
namespace chromeos {
void MockAuthenticator::AuthenticateToLogin(Profile* profile,
- const std::string& username,
- const std::string& password,
+ const UserCredentials& credentials,
const std::string& login_token,
const std::string& login_captcha) {
- if (expected_username_ == username && expected_password_ == password) {
+ if (expected_username_ == credentials.username &&
+ expected_password_ == credentials.password) {
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::Bind(&MockAuthenticator::OnLoginSuccess, this, false));
return;
@@ -29,22 +30,23 @@ void MockAuthenticator::AuthenticateToLogin(Profile* profile,
}
void MockAuthenticator::CompleteLogin(Profile* profile,
- const std::string& username,
- const std::string& password) {
- CHECK_EQ(expected_username_, username);
- CHECK_EQ(expected_password_, password);
+ const UserCredentials& credentials) {
+ CHECK_EQ(expected_username_, credentials.username);
+ CHECK_EQ(expected_password_, credentials.password);
OnLoginSuccess(false);
}
-void MockAuthenticator::AuthenticateToUnlock(const std::string& username,
- const std::string& password) {
- AuthenticateToLogin(NULL /* not used */, username, password,
+void MockAuthenticator::AuthenticateToUnlock(
+ const UserCredentials& credentials) {
+ AuthenticateToLogin(NULL /* not used */, credentials,
std::string(), std::string());
}
-void MockAuthenticator::LoginAsLocallyManagedUser(const std::string& username,
- const std::string& password) {
- consumer_->OnLoginSuccess(expected_username_, "", false, false);
+void MockAuthenticator::LoginAsLocallyManagedUser(
+ const UserCredentials& credentials) {
+ consumer_->OnLoginSuccess(UserCredentials(expected_username_, "", ""),
+ false,
+ false);
}
void MockAuthenticator::LoginRetailMode() {
@@ -52,7 +54,9 @@ void MockAuthenticator::LoginRetailMode() {
}
void MockAuthenticator::LoginAsPublicAccount(const std::string& username) {
- consumer_->OnLoginSuccess(expected_username_, "", false, false);
+ consumer_->OnLoginSuccess(UserCredentials(expected_username_, "", ""),
+ false,
+ false);
}
void MockAuthenticator::LoginOffTheRecord() {
@@ -66,8 +70,9 @@ void MockAuthenticator::OnRetailModeLoginSuccess() {
void MockAuthenticator::OnLoginSuccess(bool request_pending) {
// If we want to be more like the real thing, we could save username
// in AuthenticateToLogin, but there's not much of a point.
- consumer_->OnLoginSuccess(expected_username_,
- expected_password_,
+ consumer_->OnLoginSuccess(UserCredentials(expected_username_,
+ expected_password_,
+ ""),
request_pending,
false);
}
« no previous file with comments | « chrome/browser/chromeos/login/mock_authenticator.h ('k') | chrome/browser/chromeos/login/mock_login_status_consumer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698