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

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

Issue 7867044: PART1: Initiated the SignedSettings refactoring. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clean up some debug output. Created 9 years, 3 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/user_manager.cc
diff --git a/chrome/browser/chromeos/login/user_manager.cc b/chrome/browser/chromeos/login/user_manager.cc
index 2d8d85bd65dc7498ce1870d9cbb2b7d5c7996347..04de819597ec6c930e2c7628a48d8bfc06d08727 100644
--- a/chrome/browser/chromeos/login/user_manager.cc
+++ b/chrome/browser/chromeos/login/user_manager.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/chromeos/login/user_manager.h"
+#include "base/bind.h"
#include "base/command_line.h"
#include "base/compiler_specific.h"
#include "base/file_path.h"
@@ -20,6 +21,7 @@
#include "base/values.h"
#include "crypto/nss_util.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/chromeos/cros_settings.h"
#include "chrome/browser/chromeos/cros/cros_library.h"
#include "chrome/browser/chromeos/cros/cryptohome_library.h"
#include "chrome/browser/chromeos/input_method/input_method_manager.h"
@@ -194,15 +196,18 @@ class RemoveAttempt : public CryptohomeLibrary::Delegate {
void RemoveUser() {
// Owner is not allowed to be removed from the device.
// Must not proceed without signature verification.
- UserCrosSettingsProvider user_settings;
- bool trusted_owner_available = user_settings.RequestTrustedOwner(
- method_factory_.NewRunnableMethod(&RemoveAttempt::RemoveUser));
+ CrosSettings* cros_settings = CrosSettings::Get();
+ bool trusted_owner_available = cros_settings->GetTrusted(
+ kDeviceOwner,
+ base::Bind(&RemoveAttempt::RemoveUser, base::Unretained(this)));
Denis Lagno 2011/09/20 14:05:22 is it safe to replace ScopedMethodFactory by this?
pastarmovj 2011/09/20 17:11:52 Done.
if (!trusted_owner_available) {
// Value of owner email is still not verified.
// Another attempt will be invoked after verification completion.
return;
}
- if (user_email_ == UserCrosSettingsProvider::cached_owner()) {
+ std::string owner;
+ cros_settings->GetString(kDeviceOwner, &owner);
+ if (user_email_ == owner) {
// Owner is not allowed to be removed from the device. Probably on
// the stack, so deffer the deletion.
MessageLoop::current()->DeleteSoon(FROM_HERE, this);

Powered by Google App Engine
This is Rietveld 408576698