| 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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 void UpdateOwnership(bool is_owner) { | 167 void UpdateOwnership(bool is_owner) { |
| 168 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 168 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 169 | 169 |
| 170 g_user_manager.Get().set_current_user_is_owner(is_owner); | 170 g_user_manager.Get().set_current_user_is_owner(is_owner); |
| 171 NotificationService::current()->Notify( | 171 NotificationService::current()->Notify( |
| 172 chrome::NOTIFICATION_OWNERSHIP_CHECKED, | 172 chrome::NOTIFICATION_OWNERSHIP_CHECKED, |
| 173 NotificationService::AllSources(), | 173 NotificationService::AllSources(), |
| 174 NotificationService::NoDetails()); | 174 NotificationService::NoDetails()); |
| 175 if (is_owner) { | 175 if (is_owner) { |
| 176 // Also update cached value. | 176 // Also update cached value. |
| 177 UserCrosSettingsProvider::UpdateCachedOwner( | 177 CrosSettings::Get()->SetString( |
| 178 g_user_manager.Get().logged_in_user().email()); | 178 kDeviceOwner, |
| 179 g_user_manager.Get().logged_in_user().email()); |
| 179 } | 180 } |
| 180 } | 181 } |
| 181 | 182 |
| 182 // Checks current user's ownership on file thread. | 183 // Checks current user's ownership on file thread. |
| 183 void CheckOwnership() { | 184 void CheckOwnership() { |
| 184 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 185 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| 185 bool is_owner = OwnershipService::GetSharedInstance()->CurrentUserIsOwner(); | 186 bool is_owner = OwnershipService::GetSharedInstance()->CurrentUserIsOwner(); |
| 186 VLOG(1) << "Current user " << (is_owner ? "is owner" : "is not owner"); | 187 VLOG(1) << "Current user " << (is_owner ? "is owner" : "is not owner"); |
| 187 | 188 |
| 188 g_user_manager.Get().set_current_user_is_owner(is_owner); | 189 g_user_manager.Get().set_current_user_is_owner(is_owner); |
| (...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 observer_list_, | 812 observer_list_, |
| 812 LocalStateChanged(this)); | 813 LocalStateChanged(this)); |
| 813 } | 814 } |
| 814 | 815 |
| 815 void UserManager::DownloadProfileImage() { | 816 void UserManager::DownloadProfileImage() { |
| 816 profile_image_downloader_.reset(new ProfileImageDownloader(this)); | 817 profile_image_downloader_.reset(new ProfileImageDownloader(this)); |
| 817 profile_image_downloader_->Start(); | 818 profile_image_downloader_->Start(); |
| 818 } | 819 } |
| 819 | 820 |
| 820 } // namespace chromeos | 821 } // namespace chromeos |
| OLD | NEW |