Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2582)

Unified Diff: chrome/browser/chromeos/login/owner_manager.cc

Issue 6538098: [Chrome OS] Owner keys are generated outside Chrome now; handle appropriately (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/owner_manager.cc
diff --git a/chrome/browser/chromeos/login/owner_manager.cc b/chrome/browser/chromeos/login/owner_manager.cc
index 389d0a82698fc6512fdb7c0f19566322ce5088f1..6be926442fcac83973efe10b3bf4760da4287dcd 100644
--- a/chrome/browser/chromeos/login/owner_manager.cc
+++ b/chrome/browser/chromeos/login/owner_manager.cc
@@ -49,74 +49,6 @@ void OwnerManager::LoadOwnerKey() {
NotificationService::NoDetails()));
}
-void OwnerManager::GenerateKeysAndExportPublic() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
- VLOG(1) << "Generating key pair";
-
- private_key_.reset(utils_->GenerateKeyPair());
-
- if (private_key_.get() && private_key_->ExportPublicKey(&public_key_)) {
- // If we generated the keys successfully, export them.
- BrowserThread::PostTask(
- BrowserThread::UI, FROM_HERE,
- NewRunnableMethod(this, &OwnerManager::ExportKey));
- } else {
- private_key_.reset(NULL);
- // If we didn't generate the key, send along a notification of failure.
- BrowserThread::PostTask(
- BrowserThread::UI, FROM_HERE,
- NewRunnableMethod(this,
- &OwnerManager::SendNotification,
- NotificationType::OWNER_KEY_FETCH_ATTEMPT_FAILED,
- NotificationService::NoDetails()));
- }
-}
-
-void OwnerManager::ExportKey() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- VLOG(1) << "Exporting public key";
- if (utils_->ExportPublicKeyViaDbus(private_key_.get(), this)) {
- BrowserThread::PostTask(
- BrowserThread::UI, FROM_HERE,
- NewRunnableMethod(this,
- &OwnerManager::SendNotification,
- NotificationType::OWNERSHIP_TAKEN,
- NotificationService::NoDetails()));
- } else {
- private_key_.reset(NULL);
- BrowserThread::PostTask(
- BrowserThread::UI, FROM_HERE,
- NewRunnableMethod(this,
- &OwnerManager::SendNotification,
- NotificationType::OWNER_KEY_FETCH_ATTEMPT_FAILED,
- NotificationService::NoDetails()));
- }
- BootTimesLoader::Get()->AddLoginTimeMarker("ExportKeyEnd", false);
-}
-
-void OwnerManager::OnComplete(bool value) {
- VLOG(1) << "Export public key attempt: " << (value ? "success" : "fail");
- NotificationType result = NotificationType::OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED;
- if (!value)
- result = NotificationType::OWNER_KEY_FETCH_ATTEMPT_FAILED;
-
- // Whether we exported the public key or not, send a notification indicating
- // that we're done with this attempt.
- BrowserThread::PostTask(
- BrowserThread::UI, FROM_HERE,
- NewRunnableMethod(this,
- &OwnerManager::SendNotification,
- result,
- NotificationService::NoDetails()));
- // We've stored some settings in transient storage
- // before owner has been assigned.
- // Now owner is assigned and key is generated and we should persist
- // those settings into signed storage.
- if (g_browser_process && g_browser_process->local_state()) {
- SignedSettingsTempStorage::Finalize(g_browser_process->local_state());
- }
-}
-
bool OwnerManager::EnsurePublicKey() {
if (public_key_.empty())
LoadOwnerKey();
« no previous file with comments | « chrome/browser/chromeos/login/owner_manager.h ('k') | chrome/browser/chromeos/login/owner_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698