| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ownership_service.h" | 5 #include "chrome/browser/chromeos/login/ownership_service.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 const content::NotificationSource& source, | 136 const content::NotificationSource& source, |
| 137 const content::NotificationDetails& details) { | 137 const content::NotificationDetails& details) { |
| 138 if (type == chrome::NOTIFICATION_OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED) { | 138 if (type == chrome::NOTIFICATION_OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED) { |
| 139 SetStatus(OWNERSHIP_TAKEN); | 139 SetStatus(OWNERSHIP_TAKEN); |
| 140 notification_registrar_.RemoveAll(); | 140 notification_registrar_.RemoveAll(); |
| 141 } else { | 141 } else { |
| 142 NOTREACHED(); | 142 NOTREACHED(); |
| 143 } | 143 } |
| 144 } | 144 } |
| 145 | 145 |
| 146 bool OwnershipService::CurrentUserIsOwner() { | 146 bool OwnershipService::IsCurrentUserOwner() { |
| 147 if (force_ownership_) | 147 if (force_ownership_) |
| 148 return true; | 148 return true; |
| 149 // If this user has the private key associated with the owner's | 149 // If this user has the private key associated with the owner's |
| 150 // public key, this user is the owner. | 150 // public key, this user is the owner. |
| 151 return IsAlreadyOwned() && manager_->EnsurePrivateKey(); | 151 return IsAlreadyOwned() && manager_->EnsurePrivateKey(); |
| 152 } | 152 } |
| 153 | 153 |
| 154 // static | 154 // static |
| 155 void OwnershipService::UpdateOwnerKey(OwnershipService* service, | 155 void OwnershipService::UpdateOwnerKey(OwnershipService* service, |
| 156 const BrowserThread::ID thread_id, | 156 const BrowserThread::ID thread_id, |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 SetStatus(status); | 214 SetStatus(status); |
| 215 } | 215 } |
| 216 | 216 |
| 217 void OwnershipService::SetStatus(Status new_status) { | 217 void OwnershipService::SetStatus(Status new_status) { |
| 218 DCHECK(new_status == OWNERSHIP_TAKEN || new_status == OWNERSHIP_NONE); | 218 DCHECK(new_status == OWNERSHIP_TAKEN || new_status == OWNERSHIP_NONE); |
| 219 base::AutoLock lk(ownership_status_lock_); | 219 base::AutoLock lk(ownership_status_lock_); |
| 220 ownership_status_ = new_status; | 220 ownership_status_ = new_status; |
| 221 } | 221 } |
| 222 | 222 |
| 223 } // namespace chromeos | 223 } // namespace chromeos |
| OLD | NEW |