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

Side by Side 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 wit 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/login/auth/mock_authenticator.h" 5 #include "chromeos/login/auth/mock_authenticator.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "content/public/browser/browser_thread.h" 9 #include "content/public/browser/browser_thread.h"
stevenjb 2014/07/22 16:38:43 Layering violation.
Denis Kuznetsov (DE-MUC) 2014/07/23 17:34:11 Done.
10 10
11 using content::BrowserThread; 11 using content::BrowserThread;
12 12
13 namespace chromeos { 13 namespace chromeos {
14 14
15 MockAuthenticator::MockAuthenticator(AuthStatusConsumer* consumer, 15 MockAuthenticator::MockAuthenticator(AuthStatusConsumer* consumer,
16 const UserContext& expected_user_context) 16 const UserContext& expected_user_context)
17 : Authenticator(consumer), expected_user_context_(expected_user_context) { 17 : Authenticator(consumer), expected_user_context_(expected_user_context) {
18 } 18 }
19 19
(...skipping 16 matching lines...) Expand all
36 GoogleServiceAuthError error( 36 GoogleServiceAuthError error(
37 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS); 37 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS);
38 BrowserThread::PostTask( 38 BrowserThread::PostTask(
39 BrowserThread::UI, 39 BrowserThread::UI,
40 FROM_HERE, 40 FROM_HERE,
41 base::Bind(&MockAuthenticator::OnAuthFailure, 41 base::Bind(&MockAuthenticator::OnAuthFailure,
42 this, 42 this,
43 AuthFailure::FromNetworkAuthFailure(error))); 43 AuthFailure::FromNetworkAuthFailure(error)));
44 } 44 }
45 45
46 void MockAuthenticator::AuthenticateToUnlock( 46 void MockAuthenticator::AuthenticateToUnlock(const UserContext& user_context) {
47 const UserContext& user_context) {
48 AuthenticateToLogin(NULL /* not used */, user_context); 47 AuthenticateToLogin(NULL /* not used */, user_context);
49 } 48 }
50 49
51 void MockAuthenticator::LoginAsSupervisedUser( 50 void MockAuthenticator::LoginAsSupervisedUser(const UserContext& user_context) {
52 const UserContext& user_context) {
53 UserContext new_user_context = user_context; 51 UserContext new_user_context = user_context;
54 new_user_context.SetUserIDHash(user_context.GetUserID()); 52 new_user_context.SetUserIDHash(user_context.GetUserID());
55 consumer_->OnAuthSuccess(new_user_context); 53 consumer_->OnAuthSuccess(new_user_context);
56 } 54 }
57 55
58 void MockAuthenticator::LoginRetailMode() { 56 void MockAuthenticator::LoginRetailMode() {
59 UserContext user_context("demo-mode"); 57 UserContext user_context("demo-mode");
60 user_context.SetUserIDHash("demo-mode"); 58 user_context.SetUserIDHash("demo-mode");
61 consumer_->OnRetailModeAuthSuccess(user_context); 59 consumer_->OnRetailModeAuthSuccess(user_context);
62 } 60 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 102
105 void MockAuthenticator::SetExpectedCredentials( 103 void MockAuthenticator::SetExpectedCredentials(
106 const UserContext& user_context) { 104 const UserContext& user_context) {
107 expected_user_context_ = user_context; 105 expected_user_context_ = user_context;
108 } 106 }
109 107
110 MockAuthenticator::~MockAuthenticator() { 108 MockAuthenticator::~MockAuthenticator() {
111 } 109 }
112 110
113 } // namespace chromeos 111 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698