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

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

Issue 6705031: Send policy blobs to session_manager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 9 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/signed_settings_helper.cc
diff --git a/chrome/browser/chromeos/login/signed_settings_helper.cc b/chrome/browser/chromeos/login/signed_settings_helper.cc
index 49a55732b6d60db62a76063f0ffcf82d30d34402..68e2ec899077670c61f693387d36c6c6b6a46b2b 100644
--- a/chrome/browser/chromeos/login/signed_settings_helper.cc
+++ b/chrome/browser/chromeos/login/signed_settings_helper.cc
@@ -54,7 +54,7 @@ class OpContext {
void Cancel() {
CancelCallback();
- if (!executing_)
+ if (!executing_)
OnOpCompleted();
}
@@ -229,6 +229,62 @@ class RetrievePropertyOpContext
DISALLOW_COPY_AND_ASSIGN(RetrievePropertyOpContext);
};
+class StorePolicyOpContext : public SignedSettings::Delegate<bool>,
+ public OpContext {
+ public:
+ StorePolicyOpContext(const std::string& value,
+ SignedSettingsHelper::Callback* callback,
+ Delegate* delegate)
+ : OpContext(callback, delegate),
+ value_(value) {
+ }
+
+ // chromeos::SignedSettings::Delegate implementation
+ virtual void OnSettingsCompleted(SignedSettings::ReturnCode code,
Chris Masone 2011/03/23 23:03:53 On SettingsOpCompleted, no?
Mattias Nissler (ping if slow) 2011/03/24 18:55:57 Maybe this could use an OVERRIDE declaration then
Jakob Kummerow 2011/03/28 13:53:53 Most definitely. Good catch. Done.
Jakob Kummerow 2011/03/28 13:53:53 Done.
+ bool unused) {
+ VLOG(2) << "OnSettingsOpCompleted, code = " << code;
+ if (callback_)
+ callback_->OnStorePolicyCompleted(code);
+ OnOpCompleted();
+ }
+
+ protected:
+ // OpContext implementation
+ virtual void CreateOp() {
+ op_ = SignedSettings::CreateStorePolicyOp(value_, this);
+ }
+
+ private:
+ std::string value_;
+ DISALLOW_COPY_AND_ASSIGN(StorePolicyOpContext);
+};
+
+class RetrievePolicyOpContext : public SignedSettings::Delegate<std::string>,
+ public OpContext {
+ public:
+ RetrievePolicyOpContext(SignedSettingsHelper::Callback* callback,
+ Delegate* delegate)
+ : OpContext(callback, delegate) {
+ }
+
+ // chromeos::SignedSettings::Delegate implementation
+ virtual void OnSettingsCompleted(SignedSettings::ReturnCode code,
Chris Masone 2011/03/23 23:03:53 Again
Jakob Kummerow 2011/03/28 13:53:53 Done.
+ std::string value) {
+ if (callback_)
+ callback_->OnRetrievePolicyCompleted(code, value);
+ OnOpCompleted();
+ }
+
+ protected:
+ // OpContext implementation
+ virtual void CreateOp() {
+ op_ = SignedSettings::CreateRetrievePolicyOp(this);
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RetrievePolicyOpContext);
+};
+
} // namespace
@@ -246,6 +302,9 @@ class SignedSettingsHelperImpl : public SignedSettingsHelper,
Callback* callback);
virtual void StartRetrieveProperty(const std::string& name,
Callback* callback);
+ virtual void StartStorePolicyOp(const std::string& value,
+ Callback* callback);
+ virtual void StartRetrievePolicyOp(Callback* callback);
virtual void CancelCallback(Callback* callback);
// OpContext::Delegate implementation
@@ -304,7 +363,7 @@ void SignedSettingsHelperImpl::StartWhitelistOp(
void SignedSettingsHelperImpl::StartStorePropertyOp(
const std::string& name,
const std::string& value,
- SignedSettingsHelper::SignedSettingsHelper::Callback* callback) {
+ SignedSettingsHelper::Callback* callback) {
AddOpContext(new StorePropertyOpContext(
name,
value,
@@ -321,6 +380,17 @@ void SignedSettingsHelperImpl::StartRetrieveProperty(
this));
}
+void SignedSettingsHelperImpl::StartStorePolicyOp(
+ const std::string& value,
+ SignedSettingsHelper::Callback* callback) {
+ AddOpContext(new StorePolicyOpContext(value, callback, this));
+}
+
+void SignedSettingsHelperImpl::StartRetrievePolicyOp(
+ SignedSettingsHelper::Callback* callback) {
+ AddOpContext(new RetrievePolicyOpContext(callback, this));
+}
+
void SignedSettingsHelperImpl::CancelCallback(
SignedSettingsHelper::Callback* callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));

Powered by Google App Engine
This is Rietveld 408576698