| 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 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 return active_user_; | 552 return active_user_; |
| 553 } | 553 } |
| 554 | 554 |
| 555 const User* UserManagerImpl::GetPrimaryUser() const { | 555 const User* UserManagerImpl::GetPrimaryUser() const { |
| 556 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 556 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 557 return primary_user_; | 557 return primary_user_; |
| 558 } | 558 } |
| 559 | 559 |
| 560 User* UserManagerImpl::GetUserByProfile(Profile* profile) const { | 560 User* UserManagerImpl::GetUserByProfile(Profile* profile) const { |
| 561 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 561 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 562 if (ProfileHelper::IsSigninProfile(profile)) | 562 if (profile->IsLoginProfile()) |
| 563 return NULL; | 563 return NULL; |
| 564 | 564 |
| 565 if (IsMultipleProfilesAllowed()) { | 565 if (IsMultipleProfilesAllowed()) { |
| 566 const std::string username_hash = | 566 const std::string username_hash = |
| 567 ProfileHelper::GetUserIdHashFromProfile(profile); | 567 ProfileHelper::GetUserIdHashFromProfile(profile); |
| 568 const UserList& users = GetUsers(); | 568 const UserList& users = GetUsers(); |
| 569 const UserList::const_iterator pos = std::find_if( | 569 const UserList::const_iterator pos = std::find_if( |
| 570 users.begin(), users.end(), UserHashMatcher(username_hash)); | 570 users.begin(), users.end(), UserHashMatcher(username_hash)); |
| 571 return (pos != users.end()) ? *pos : NULL; | 571 return (pos != users.end()) ? *pos : NULL; |
| 572 } | 572 } |
| (...skipping 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1804 } | 1804 } |
| 1805 } | 1805 } |
| 1806 | 1806 |
| 1807 void UserManagerImpl::OnUserNotAllowed() { | 1807 void UserManagerImpl::OnUserNotAllowed() { |
| 1808 LOG(ERROR) << "Shutdown session because a user is not allowed to be in the " | 1808 LOG(ERROR) << "Shutdown session because a user is not allowed to be in the " |
| 1809 "current session"; | 1809 "current session"; |
| 1810 chrome::AttemptUserExit(); | 1810 chrome::AttemptUserExit(); |
| 1811 } | 1811 } |
| 1812 | 1812 |
| 1813 } // namespace chromeos | 1813 } // namespace chromeos |
| OLD | NEW |