| 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 UserManager::Get()->SessionStarted(); | 54 UserManager::Get()->SessionStarted(); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void FakeLoginUtils::PrepareProfile(const UserContext& user_context, | 57 void FakeLoginUtils::PrepareProfile(const UserContext& user_context, |
| 58 const std::string& display_email, | 58 const std::string& display_email, |
| 59 bool has_cookies, | 59 bool has_cookies, |
| 60 bool has_active_session, | 60 bool has_active_session, |
| 61 LoginUtils::Delegate* delegate) { | 61 LoginUtils::Delegate* delegate) { |
| 62 UserManager::Get()->UserLoggedIn( | 62 UserManager::Get()->UserLoggedIn( |
| 63 user_context.username, user_context.username_hash, false); | 63 user_context.username, user_context.username_hash, false); |
| 64 Profile* profile = CreateProfile(user_context.username); | 64 Profile* profile = CreateProfile(user_context.username_hash); |
| 65 | 65 |
| 66 if (UserManager::Get()->IsLoggedInAsLocallyManagedUser()) { | 66 if (UserManager::Get()->IsLoggedInAsLocallyManagedUser()) { |
| 67 User* active_user = UserManager::Get()->GetActiveUser(); | 67 User* active_user = UserManager::Get()->GetActiveUser(); |
| 68 std::string managed_user_sync_id = | 68 std::string managed_user_sync_id = |
| 69 UserManager::Get()->GetSupervisedUserManager()-> | 69 UserManager::Get()->GetSupervisedUserManager()-> |
| 70 GetUserSyncId(active_user->email()); | 70 GetUserSyncId(active_user->email()); |
| 71 if (managed_user_sync_id.empty()) | 71 if (managed_user_sync_id.empty()) |
| 72 managed_user_sync_id = "DUMMY ID"; | 72 managed_user_sync_id = "DUMMY ID"; |
| 73 profile->GetPrefs()->SetString(prefs::kManagedUserId, | 73 profile->GetPrefs()->SetString(prefs::kManagedUserId, |
| 74 managed_user_sync_id); | 74 managed_user_sync_id); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 const std::string& password) { | 121 const std::string& password) { |
| 122 expected_username_ = username; | 122 expected_username_ = username; |
| 123 expected_password_ = password; | 123 expected_password_ = password; |
| 124 if (authenticator_.get()) { | 124 if (authenticator_.get()) { |
| 125 static_cast<MockAuthenticator*>(authenticator_.get())-> | 125 static_cast<MockAuthenticator*>(authenticator_.get())-> |
| 126 SetExpectedCredentials(username, password); | 126 SetExpectedCredentials(username, password); |
| 127 } | 127 } |
| 128 } | 128 } |
| 129 | 129 |
| 130 } // namespace chromeos | 130 } // namespace chromeos |
| OLD | NEW |