| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/user_manager_impl.h" | 5 #include "chrome/browser/chromeos/login/user_manager_impl.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 602 return (pos != users.end()) ? *pos : NULL; | 602 return (pos != users.end()) ? *pos : NULL; |
| 603 } | 603 } |
| 604 return active_user_; | 604 return active_user_; |
| 605 } | 605 } |
| 606 | 606 |
| 607 Profile* UserManagerImpl::GetProfileByUser(const User* user) const { | 607 Profile* UserManagerImpl::GetProfileByUser(const User* user) const { |
| 608 Profile* profile = NULL; | 608 Profile* profile = NULL; |
| 609 if (IsMultipleProfilesAllowed() && user->is_profile_created()) | 609 if (IsMultipleProfilesAllowed() && user->is_profile_created()) |
| 610 profile = ProfileHelper::GetProfileByUserIdHash(user->username_hash()); | 610 profile = ProfileHelper::GetProfileByUserIdHash(user->username_hash()); |
| 611 else | 611 else |
| 612 profile = g_browser_process->profile_manager()->GetDefaultProfile(); | 612 profile = ProfileManager::GetActiveUserProfile(); |
| 613 | 613 |
| 614 // GetDefaultProfile() or GetProfileByUserIdHash() returns a new instance of | 614 // GetActiveUserProfile() or GetProfileByUserIdHash() returns a new instance |
| 615 // ProfileImpl(), but actually its OffTheRecordProfile() should be used. | 615 // of ProfileImpl(), but actually its OffTheRecordProfile() should be used. |
| 616 if (profile && IsLoggedInAsGuest()) | 616 if (profile && IsLoggedInAsGuest()) |
| 617 profile = profile->GetOffTheRecordProfile(); | 617 profile = profile->GetOffTheRecordProfile(); |
| 618 return profile; | 618 return profile; |
| 619 } | 619 } |
| 620 | 620 |
| 621 void UserManagerImpl::SaveUserOAuthStatus( | 621 void UserManagerImpl::SaveUserOAuthStatus( |
| 622 const std::string& user_id, | 622 const std::string& user_id, |
| 623 User::OAuthTokenStatus oauth_token_status) { | 623 User::OAuthTokenStatus oauth_token_status) { |
| 624 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 624 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 625 | 625 |
| (...skipping 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1864 | 1864 |
| 1865 void UserManagerImpl::DoUpdateAccountLocale( | 1865 void UserManagerImpl::DoUpdateAccountLocale( |
| 1866 const std::string& user_id, | 1866 const std::string& user_id, |
| 1867 const std::string& resolved_locale) { | 1867 const std::string& resolved_locale) { |
| 1868 if (User* user = FindUserAndModify(user_id)) | 1868 if (User* user = FindUserAndModify(user_id)) |
| 1869 user->SetAccountLocale(resolved_locale); | 1869 user->SetAccountLocale(resolved_locale); |
| 1870 } | 1870 } |
| 1871 | 1871 |
| 1872 | 1872 |
| 1873 } // namespace chromeos | 1873 } // namespace chromeos |
| OLD | NEW |