| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 if (is_owner) { | 136 if (is_owner) { |
| 137 // Also update cached value. | 137 // Also update cached value. |
| 138 UserCrosSettingsProvider::UpdateCachedOwner( | 138 UserCrosSettingsProvider::UpdateCachedOwner( |
| 139 user_manager->logged_in_user().email()); | 139 user_manager->logged_in_user().email()); |
| 140 } | 140 } |
| 141 } | 141 } |
| 142 | 142 |
| 143 // Checks current user's ownership on file thread. | 143 // Checks current user's ownership on file thread. |
| 144 void CheckOwnership() { | 144 void CheckOwnership() { |
| 145 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 145 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| 146 | |
| 147 bool is_owner = OwnershipService::GetSharedInstance()->CurrentUserIsOwner(); | 146 bool is_owner = OwnershipService::GetSharedInstance()->CurrentUserIsOwner(); |
| 147 VLOG(1) << "Current user " << (is_owner ? "is owner" : "is not owner"); |
| 148 | 148 |
| 149 // UserManager should be accessed only on UI thread. | 149 // UserManager should be accessed only on UI thread. |
| 150 BrowserThread::PostTask( | 150 BrowserThread::PostTask( |
| 151 BrowserThread::UI, | 151 BrowserThread::UI, |
| 152 FROM_HERE, | 152 FROM_HERE, |
| 153 NewRunnableFunction(&UpdateOwnership, is_owner)); | 153 NewRunnableFunction(&UpdateOwnership, is_owner)); |
| 154 } | 154 } |
| 155 | 155 |
| 156 } // namespace | 156 } // namespace |
| 157 | 157 |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 void UserManager::Observe(NotificationType type, | 468 void UserManager::Observe(NotificationType type, |
| 469 const NotificationSource& source, | 469 const NotificationSource& source, |
| 470 const NotificationDetails& details) { | 470 const NotificationDetails& details) { |
| 471 if (type == NotificationType::OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED) { | 471 if (type == NotificationType::OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED) { |
| 472 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 472 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
| 473 NewRunnableFunction(&CheckOwnership)); | 473 NewRunnableFunction(&CheckOwnership)); |
| 474 } | 474 } |
| 475 } | 475 } |
| 476 | 476 |
| 477 } // namespace chromeos | 477 } // namespace chromeos |
| OLD | NEW |