| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/fake_login_utils.h" | 5 #include "chrome/browser/chromeos/login/fake_login_utils.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 supervised_user_sync_id = "DUMMY ID"; | 83 supervised_user_sync_id = "DUMMY ID"; |
| 84 profile->GetPrefs()->SetString(prefs::kSupervisedUserId, | 84 profile->GetPrefs()->SetString(prefs::kSupervisedUserId, |
| 85 supervised_user_sync_id); | 85 supervised_user_sync_id); |
| 86 } | 86 } |
| 87 | 87 |
| 88 content::NotificationService::current()->Notify( | 88 content::NotificationService::current()->Notify( |
| 89 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, | 89 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, |
| 90 content::NotificationService::AllSources(), | 90 content::NotificationService::AllSources(), |
| 91 content::Details<Profile>(profile)); | 91 content::Details<Profile>(profile)); |
| 92 if (delegate) | 92 if (delegate) |
| 93 delegate->OnProfilePrepared(profile); | 93 delegate->OnProfilePrepared(profile, false); |
| 94 } | 94 } |
| 95 | 95 |
| 96 void FakeLoginUtils::DelegateDeleted(LoginUtils::Delegate* delegate) { | 96 void FakeLoginUtils::DelegateDeleted(LoginUtils::Delegate* delegate) { |
| 97 NOTREACHED() << "Method not implemented."; | 97 NOTREACHED() << "Method not implemented."; |
| 98 } | 98 } |
| 99 | 99 |
| 100 scoped_refptr<Authenticator> FakeLoginUtils::CreateAuthenticator( | 100 scoped_refptr<Authenticator> FakeLoginUtils::CreateAuthenticator( |
| 101 AuthStatusConsumer* consumer) { | 101 AuthStatusConsumer* consumer) { |
| 102 authenticator_ = new MockAuthenticator(consumer, expected_user_context_); | 102 authenticator_ = new MockAuthenticator(consumer, expected_user_context_); |
| 103 return authenticator_; | 103 return authenticator_; |
| 104 } | 104 } |
| 105 | 105 |
| 106 bool FakeLoginUtils::RestartToApplyPerSessionFlagsIfNeed(Profile* profile, | 106 bool FakeLoginUtils::RestartToApplyPerSessionFlagsIfNeed(Profile* profile, |
| 107 bool early_restart) { | 107 bool early_restart) { |
| 108 NOTREACHED() << "Method not implemented."; | 108 NOTREACHED() << "Method not implemented."; |
| 109 return false; | 109 return false; |
| 110 } | 110 } |
| 111 | 111 |
| 112 void FakeLoginUtils::SetExpectedCredentials(const UserContext& user_context) { | 112 void FakeLoginUtils::SetExpectedCredentials(const UserContext& user_context) { |
| 113 expected_user_context_ = user_context; | 113 expected_user_context_ = user_context; |
| 114 if (authenticator_.get()) { | 114 if (authenticator_.get()) { |
| 115 static_cast<MockAuthenticator*>(authenticator_.get())-> | 115 static_cast<MockAuthenticator*>(authenticator_.get())-> |
| 116 SetExpectedCredentials(user_context); | 116 SetExpectedCredentials(user_context); |
| 117 } | 117 } |
| 118 } | 118 } |
| 119 | 119 |
| 120 } // namespace chromeos | 120 } // namespace chromeos |
| OLD | NEW |