| 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/ownership_service.h" | 5 #include "chrome/browser/chromeos/login/ownership_service.h" |
| 6 | 6 |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "chrome/browser/browser_thread.h" | 9 #include "chrome/browser/browser_thread.h" |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 return false; | 33 return false; |
| 34 } | 34 } |
| 35 BrowserThread::PostTask( | 35 BrowserThread::PostTask( |
| 36 BrowserThread::FILE, FROM_HERE, | 36 BrowserThread::FILE, FROM_HERE, |
| 37 NewRunnableMethod(manager_.get(), &OwnerManager::LoadOwnerKey)); | 37 NewRunnableMethod(manager_.get(), &OwnerManager::LoadOwnerKey)); |
| 38 return true; | 38 return true; |
| 39 } | 39 } |
| 40 | 40 |
| 41 bool OwnershipService::StartTakeOwnershipAttempt(const std::string& owner) { | 41 bool OwnershipService::StartTakeOwnershipAttempt(const std::string& owner) { |
| 42 if (IsAlreadyOwned()) { | 42 if (IsAlreadyOwned()) { |
| 43 LOG(INFO) << "Device is already owned"; | 43 VLOG(1) << "Device is already owned"; |
| 44 return false; | 44 return false; |
| 45 } | 45 } |
| 46 BrowserThread::PostTask( | 46 BrowserThread::PostTask( |
| 47 BrowserThread::FILE, FROM_HERE, | 47 BrowserThread::FILE, FROM_HERE, |
| 48 NewRunnableMethod(manager_.get(), | 48 NewRunnableMethod(manager_.get(), |
| 49 &OwnerManager::GenerateKeysAndExportPublic)); | 49 &OwnerManager::GenerateKeysAndExportPublic)); |
| 50 return true; | 50 return true; |
| 51 } | 51 } |
| 52 | 52 |
| 53 void OwnershipService::StartSigningAttempt(const std::string& data, | 53 void OwnershipService::StartSigningAttempt(const std::string& data, |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 return; | 91 return; |
| 92 } | 92 } |
| 93 | 93 |
| 94 bool OwnershipService::CurrentUserIsOwner() { | 94 bool OwnershipService::CurrentUserIsOwner() { |
| 95 // If this user has the private key associated with the owner's | 95 // If this user has the private key associated with the owner's |
| 96 // public key, this user is the owner. | 96 // public key, this user is the owner. |
| 97 return IsAlreadyOwned() && manager_->EnsurePrivateKey(); | 97 return IsAlreadyOwned() && manager_->EnsurePrivateKey(); |
| 98 } | 98 } |
| 99 | 99 |
| 100 } // namespace chromeos | 100 } // namespace chromeos |
| OLD | NEW |