| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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.h" | 5 #include "chrome/browser/chromeos/login/user_manager.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 void UserManager::UpdateOwnership(bool is_owner) { | 795 void UserManager::UpdateOwnership(bool is_owner) { |
| 796 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 796 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 797 | 797 |
| 798 set_current_user_is_owner(is_owner); | 798 set_current_user_is_owner(is_owner); |
| 799 content::NotificationService::current()->Notify( | 799 content::NotificationService::current()->Notify( |
| 800 chrome::NOTIFICATION_OWNERSHIP_CHECKED, | 800 chrome::NOTIFICATION_OWNERSHIP_CHECKED, |
| 801 content::NotificationService::AllSources(), | 801 content::NotificationService::AllSources(), |
| 802 content::NotificationService::NoDetails()); | 802 content::NotificationService::NoDetails()); |
| 803 if (is_owner) { | 803 if (is_owner) { |
| 804 // Also update cached value. | 804 // Also update cached value. |
| 805 UserCrosSettingsProvider::UpdateCachedOwner(logged_in_user().email()); | 805 CrosSettings::Get()->SetString( |
| 806 kDeviceOwner, |
| 807 g_user_manager.Get().logged_in_user().email()); |
| 806 } | 808 } |
| 807 } | 809 } |
| 808 | 810 |
| 809 void UserManager::CheckOwnership() { | 811 void UserManager::CheckOwnership() { |
| 810 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 812 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| 811 bool is_owner = OwnershipService::GetSharedInstance()->CurrentUserIsOwner(); | 813 bool is_owner = OwnershipService::GetSharedInstance()->CurrentUserIsOwner(); |
| 812 VLOG(1) << "Current user " << (is_owner ? "is owner" : "is not owner"); | 814 VLOG(1) << "Current user " << (is_owner ? "is owner" : "is not owner"); |
| 813 | 815 |
| 814 set_current_user_is_owner(is_owner); | 816 set_current_user_is_owner(is_owner); |
| 815 | 817 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 897 | 899 |
| 898 User* UserManager::CreateUser(const std::string& email) const { | 900 User* UserManager::CreateUser(const std::string& email) const { |
| 899 User* user = new User(email); | 901 User* user = new User(email); |
| 900 user->set_oauth_token_status(GetUserOAuthStatus(email)); | 902 user->set_oauth_token_status(GetUserOAuthStatus(email)); |
| 901 // Used to determine whether user's display name is unique. | 903 // Used to determine whether user's display name is unique. |
| 902 ++display_name_count_[user->GetDisplayName()]; | 904 ++display_name_count_[user->GetDisplayName()]; |
| 903 return user; | 905 return user; |
| 904 } | 906 } |
| 905 | 907 |
| 906 } // namespace chromeos | 908 } // namespace chromeos |
| OLD | NEW |