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

Unified Diff: chrome/browser/chromeos/settings/device_settings_service.cc

Issue 270663002: Implemented profile-aware owner key loading. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes. Created 6 years, 7 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/settings/device_settings_service.cc
diff --git a/chrome/browser/chromeos/settings/device_settings_service.cc b/chrome/browser/chromeos/settings/device_settings_service.cc
index 0895080c4f5b53dc585217054962ec7d632475bd..4a1b21c55b7270ea64437a764c9283ee84173a37 100644
--- a/chrome/browser/chromeos/settings/device_settings_service.cc
+++ b/chrome/browser/chromeos/settings/device_settings_service.cc
@@ -232,8 +232,13 @@ void DeviceSettingsService::IsCurrentUserOwnerAsync(
}
}
-void DeviceSettingsService::SetUsername(const std::string& username) {
+void DeviceSettingsService::InitOwner(const std::string& username,
+ crypto::ScopedPK11Slot slot) {
+ if (owner_key_.get() && owner_key_->public_key() && owner_key_->private_key())
Mattias Nissler (ping if slow) 2014/05/14 16:00:36 Ah, here you test whether you already have a loade
ygorshenin1 2014/05/15 08:39:56 I propose to use old SetUsername() approach, but t
+ return;
+
username_ = username;
+ slot_ = slot.Pass();
// The private key may have become available, so force a key reload.
owner_key_ = NULL;
@@ -292,14 +297,19 @@ void DeviceSettingsService::EnqueueLoad(bool force_key_load) {
weak_factory_.GetWeakPtr(),
base::Closure()));
operation->set_force_key_load(force_key_load);
+ operation->set_username(username_);
+ operation->set_slot(slot_.get());
Enqueue(operation);
}
void DeviceSettingsService::EnsureReload(bool force_key_load) {
- if (!pending_operations_.empty())
+ if (!pending_operations_.empty()) {
+ pending_operations_.front()->set_username(username_);
+ pending_operations_.front()->set_slot(slot_.get());
pending_operations_.front()->RestartLoad(force_key_load);
- else
+ } else {
EnqueueLoad(force_key_load);
+ }
}
void DeviceSettingsService::StartNextOperation() {

Powered by Google App Engine
This is Rietveld 408576698