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

Unified Diff: chromeos/login/auth/mock_authenticator.cc

Issue 391373002: Refactoring : Move AuthAttempt and Authenticators to chromeos/login (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge w/ToT Created 6 years, 5 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
« no previous file with comments | « chromeos/login/auth/mock_authenticator.h ('k') | chromeos/login/auth/test_attempt_state.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/login/auth/mock_authenticator.cc
diff --git a/chrome/browser/chromeos/login/auth/mock_authenticator.cc b/chromeos/login/auth/mock_authenticator.cc
similarity index 84%
rename from chrome/browser/chromeos/login/auth/mock_authenticator.cc
rename to chromeos/login/auth/mock_authenticator.cc
index 29536b380065427179daf7eac5aee18e3d26012f..3fcc746fed3d3c6a251e2db4e2fca6376016f723 100644
--- a/chrome/browser/chromeos/login/auth/mock_authenticator.cc
+++ b/chromeos/login/auth/mock_authenticator.cc
@@ -2,19 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/chromeos/login/auth/mock_authenticator.h"
+#include "chromeos/login/auth/mock_authenticator.h"
#include "base/bind.h"
+#include "base/location.h"
#include "base/logging.h"
-#include "content/public/browser/browser_thread.h"
-
-using content::BrowserThread;
namespace chromeos {
MockAuthenticator::MockAuthenticator(AuthStatusConsumer* consumer,
const UserContext& expected_user_context)
- : Authenticator(consumer), expected_user_context_(expected_user_context) {
+ : Authenticator(consumer),
+ expected_user_context_(expected_user_context),
+ message_loop_(base::MessageLoopProxy::current()) {
}
void MockAuthenticator::CompleteLogin(Profile* profile,
@@ -27,29 +27,24 @@ void MockAuthenticator::CompleteLogin(Profile* profile,
void MockAuthenticator::AuthenticateToLogin(Profile* profile,
const UserContext& user_context) {
if (user_context == expected_user_context_) {
- BrowserThread::PostTask(
- BrowserThread::UI,
- FROM_HERE,
- base::Bind(&MockAuthenticator::OnAuthSuccess, this));
+ message_loop_->PostTask(
+ FROM_HERE, base::Bind(&MockAuthenticator::OnAuthSuccess, this));
return;
}
GoogleServiceAuthError error(
GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS);
- BrowserThread::PostTask(
- BrowserThread::UI,
+ message_loop_->PostTask(
FROM_HERE,
base::Bind(&MockAuthenticator::OnAuthFailure,
this,
AuthFailure::FromNetworkAuthFailure(error)));
}
-void MockAuthenticator::AuthenticateToUnlock(
- const UserContext& user_context) {
+void MockAuthenticator::AuthenticateToUnlock(const UserContext& user_context) {
AuthenticateToLogin(NULL /* not used */, user_context);
}
-void MockAuthenticator::LoginAsSupervisedUser(
- const UserContext& user_context) {
+void MockAuthenticator::LoginAsSupervisedUser(const UserContext& user_context) {
UserContext new_user_context = user_context;
new_user_context.SetUserIDHash(user_context.GetUserID());
consumer_->OnAuthSuccess(new_user_context);
« no previous file with comments | « chromeos/login/auth/mock_authenticator.h ('k') | chromeos/login/auth/test_attempt_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698