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/session/session_manager.h" | 5 #include "chrome/browser/chromeos/login/session/session_manager.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 void SessionManager::InitProfilePreferences(Profile* profile, | 372 void SessionManager::InitProfilePreferences(Profile* profile, |
373 const std::string& user_id) { | 373 const std::string& user_id) { |
374 if (UserManager::Get()->IsCurrentUserNew()) | 374 if (UserManager::Get()->IsCurrentUserNew()) |
375 SetFirstLoginPrefs(profile->GetPrefs()); | 375 SetFirstLoginPrefs(profile->GetPrefs()); |
376 | 376 |
377 if (UserManager::Get()->IsLoggedInAsLocallyManagedUser()) { | 377 if (UserManager::Get()->IsLoggedInAsLocallyManagedUser()) { |
378 User* active_user = UserManager::Get()->GetActiveUser(); | 378 User* active_user = UserManager::Get()->GetActiveUser(); |
379 std::string managed_user_sync_id = | 379 std::string managed_user_sync_id = |
380 UserManager::Get()->GetSupervisedUserManager()-> | 380 UserManager::Get()->GetSupervisedUserManager()-> |
381 GetUserSyncId(active_user->email()); | 381 GetUserSyncId(active_user->email()); |
382 profile->GetPrefs()->SetString(prefs::kManagedUserId, managed_user_sync_id); | 382 profile->GetPrefs()->SetString(prefs::kSupervisedUserId, |
| 383 managed_user_sync_id); |
383 } else if (UserManager::Get()->IsLoggedInAsRegularUser()) { | 384 } else if (UserManager::Get()->IsLoggedInAsRegularUser()) { |
384 // Make sure that the google service username is properly set (we do this | 385 // Make sure that the google service username is properly set (we do this |
385 // on every sign in, not just the first login, to deal with existing | 386 // on every sign in, not just the first login, to deal with existing |
386 // profiles that might not have it set yet). | 387 // profiles that might not have it set yet). |
387 SigninManagerBase* signin_manager = | 388 SigninManagerBase* signin_manager = |
388 SigninManagerFactory::GetForProfile(profile); | 389 SigninManagerFactory::GetForProfile(profile); |
389 signin_manager->SetAuthenticatedUsername(user_id); | 390 signin_manager->SetAuthenticatedUsername(user_id); |
390 } | 391 } |
391 } | 392 } |
392 | 393 |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 // recorded. | 569 // recorded. |
569 RLZTracker::InitRlzFromProfileDelayed( | 570 RLZTracker::InitRlzFromProfileDelayed( |
570 profile, UserManager::Get()->IsCurrentUserNew(), | 571 profile, UserManager::Get()->IsCurrentUserNew(), |
571 ping_delay < 0, base::TimeDelta::FromMilliseconds(abs(ping_delay))); | 572 ping_delay < 0, base::TimeDelta::FromMilliseconds(abs(ping_delay))); |
572 if (delegate_) | 573 if (delegate_) |
573 delegate_->OnRlzInitialized(); | 574 delegate_->OnRlzInitialized(); |
574 #endif | 575 #endif |
575 } | 576 } |
576 | 577 |
577 } // namespace chromeos | 578 } // namespace chromeos |
OLD | NEW |