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 "chrome/browser/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 |
(...skipping 30 matching lines...) Expand all Loading... |
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( |
47 const UserContext& user_context) { | 47 const UserContext& user_context) { |
48 AuthenticateToLogin(NULL /* not used */, user_context); | 48 AuthenticateToLogin(NULL /* not used */, user_context); |
49 } | 49 } |
50 | 50 |
51 void MockAuthenticator::LoginAsLocallyManagedUser( | 51 void MockAuthenticator::LoginAsSupervisedUser( |
52 const UserContext& user_context) { | 52 const UserContext& user_context) { |
53 UserContext new_user_context = user_context; | 53 UserContext new_user_context = user_context; |
54 new_user_context.SetUserIDHash(user_context.GetUserID()); | 54 new_user_context.SetUserIDHash(user_context.GetUserID()); |
55 consumer_->OnAuthSuccess(new_user_context); | 55 consumer_->OnAuthSuccess(new_user_context); |
56 } | 56 } |
57 | 57 |
58 void MockAuthenticator::LoginRetailMode() { | 58 void MockAuthenticator::LoginRetailMode() { |
59 UserContext user_context("demo-mode"); | 59 UserContext user_context("demo-mode"); |
60 user_context.SetUserIDHash("demo-mode"); | 60 user_context.SetUserIDHash("demo-mode"); |
61 consumer_->OnRetailModeAuthSuccess(user_context); | 61 consumer_->OnRetailModeAuthSuccess(user_context); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 104 |
105 void MockAuthenticator::SetExpectedCredentials( | 105 void MockAuthenticator::SetExpectedCredentials( |
106 const UserContext& user_context) { | 106 const UserContext& user_context) { |
107 expected_user_context_ = user_context; | 107 expected_user_context_ = user_context; |
108 } | 108 } |
109 | 109 |
110 MockAuthenticator::~MockAuthenticator() { | 110 MockAuthenticator::~MockAuthenticator() { |
111 } | 111 } |
112 | 112 |
113 } // namespace chromeos | 113 } // namespace chromeos |
OLD | NEW |