| OLD | NEW |
| 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" |
| 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, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 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::LoginAsLocallyManagedUser( | 50 void MockAuthenticator::LoginAsLocallyManagedUser( |
| 52 const UserContext& user_context) { | 51 const UserContext& user_context) { |
| 53 UserContext new_user_context = user_context; | 52 UserContext new_user_context = user_context; |
| 54 new_user_context.SetUserIDHash(user_context.GetUserID()); | 53 new_user_context.SetUserIDHash(user_context.GetUserID()); |
| 55 consumer_->OnAuthSuccess(new_user_context); | 54 consumer_->OnAuthSuccess(new_user_context); |
| 56 } | 55 } |
| 57 | 56 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 103 |
| 105 void MockAuthenticator::SetExpectedCredentials( | 104 void MockAuthenticator::SetExpectedCredentials( |
| 106 const UserContext& user_context) { | 105 const UserContext& user_context) { |
| 107 expected_user_context_ = user_context; | 106 expected_user_context_ = user_context; |
| 108 } | 107 } |
| 109 | 108 |
| 110 MockAuthenticator::~MockAuthenticator() { | 109 MockAuthenticator::~MockAuthenticator() { |
| 111 } | 110 } |
| 112 | 111 |
| 113 } // namespace chromeos | 112 } // namespace chromeos |
| OLD | NEW |