| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/login_utils.h" | 5 #include "chrome/browser/chromeos/login/login_utils.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 User* active_user = UserManager::Get()->GetActiveUser(); | 452 User* active_user = UserManager::Get()->GetActiveUser(); |
| 453 std::string managed_user_sync_id = | 453 std::string managed_user_sync_id = |
| 454 UserManager::Get()->GetSupervisedUserManager()-> | 454 UserManager::Get()->GetSupervisedUserManager()-> |
| 455 GetUserSyncId(active_user->email()); | 455 GetUserSyncId(active_user->email()); |
| 456 | 456 |
| 457 // TODO(ibraaaa): Remove that when 97% of our users are using M31. | 457 // TODO(ibraaaa): Remove that when 97% of our users are using M31. |
| 458 // http://crbug.com/276163 | 458 // http://crbug.com/276163 |
| 459 if (managed_user_sync_id.empty()) | 459 if (managed_user_sync_id.empty()) |
| 460 managed_user_sync_id = "DUMMY_ID"; | 460 managed_user_sync_id = "DUMMY_ID"; |
| 461 | 461 |
| 462 user_profile->GetPrefs()->SetString(prefs::kManagedUserId, | 462 user_profile->GetPrefs()->SetString(prefs::kSupervisedUserId, |
| 463 managed_user_sync_id); | 463 managed_user_sync_id); |
| 464 } else if (UserManager::Get()->IsLoggedInAsRegularUser()) { | 464 } else if (UserManager::Get()->IsLoggedInAsRegularUser()) { |
| 465 // Make sure that the google service username is properly set (we do this | 465 // Make sure that the google service username is properly set (we do this |
| 466 // on every sign in, not just the first login, to deal with existing | 466 // on every sign in, not just the first login, to deal with existing |
| 467 // profiles that might not have it set yet). | 467 // profiles that might not have it set yet). |
| 468 SigninManagerBase* signin_manager = | 468 SigninManagerBase* signin_manager = |
| 469 SigninManagerFactory::GetForProfile(user_profile); | 469 SigninManagerFactory::GetForProfile(user_profile); |
| 470 signin_manager->SetAuthenticatedUsername(user_id); | 470 signin_manager->SetAuthenticatedUsername(user_id); |
| 471 } | 471 } |
| 472 } | 472 } |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 953 CrosSettings* cros_settings = CrosSettings::Get(); | 953 CrosSettings* cros_settings = CrosSettings::Get(); |
| 954 bool allow_new_user = false; | 954 bool allow_new_user = false; |
| 955 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); | 955 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); |
| 956 if (allow_new_user) | 956 if (allow_new_user) |
| 957 return true; | 957 return true; |
| 958 return cros_settings->FindEmailInList( | 958 return cros_settings->FindEmailInList( |
| 959 kAccountsPrefUsers, username, wildcard_match); | 959 kAccountsPrefUsers, username, wildcard_match); |
| 960 } | 960 } |
| 961 | 961 |
| 962 } // namespace chromeos | 962 } // namespace chromeos |
| OLD | NEW |