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

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

Issue 8163011: PART3: Removed whitelist special ops. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased on the new PART2. (I think it should be 100% the same but I'd rather upload it) Created 9 years, 2 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 6822e14903ba203227a54908e3e289076fe904e9..acaaae35f2cd0c1b999ad24490fed1146355d35d 100644
--- a/chrome/browser/chromeos/login/signed_settings_helper.cc
+++ b/chrome/browser/chromeos/login/signed_settings_helper.cc
@@ -98,72 +98,6 @@ class OpContext {
SignedSettingsHelper::Callback* callback_;
};
-class WhitelistOpContext : public SignedSettings::Delegate<bool>,
- public OpContext {
- public:
- enum Type {
- CHECK,
- ADD,
- REMOVE,
- };
-
- WhitelistOpContext(Type type,
- const std::string& email,
- SignedSettingsHelper::Callback* callback,
- OpContext::Delegate* delegate)
- : OpContext(callback, delegate),
- type_(type),
- email_(email) {
- }
-
- // chromeos::SignedSettings::Delegate implementation
- virtual void OnSettingsOpCompleted(SignedSettings::ReturnCode code,
- bool value) OVERRIDE {
- if (callback_) {
- switch (type_) {
- case CHECK:
- callback_->OnCheckWhitelistCompleted(code, email_);
- break;
- case ADD:
- callback_->OnWhitelistCompleted(code, email_);
- break;
- case REMOVE:
- callback_->OnUnwhitelistCompleted(code, email_);
- break;
- default:
- LOG(ERROR) << "Unknown WhitelistOpContext type " << type_;
- break;
- }
- }
- OnOpCompleted();
- }
-
- protected:
- // OpContext implemenetation
- virtual void CreateOp() OVERRIDE {
- switch (type_) {
- case CHECK:
- op_ = SignedSettings::CreateCheckWhitelistOp(email_, this);
- break;
- case ADD:
- op_ = SignedSettings::CreateWhitelistOp(email_, true, this);
- break;
- case REMOVE:
- op_ = SignedSettings::CreateWhitelistOp(email_, false, this);
- break;
- default:
- LOG(ERROR) << "Unknown WhitelistOpContext type " << type_;
- break;
- }
- }
-
- private:
- Type type_;
- std::string email_;
-
- DISALLOW_COPY_AND_ASSIGN(WhitelistOpContext);
-};
-
class StorePropertyOpContext : public SignedSettings::Delegate<bool>,
public OpContext {
public:
@@ -295,11 +229,6 @@ class SignedSettingsHelperImpl : public SignedSettingsHelper,
public OpContext::Delegate {
public:
// SignedSettingsHelper implementation
- virtual void StartCheckWhitelistOp(const std::string& email,
- Callback* callback) OVERRIDE;
- virtual void StartWhitelistOp(const std::string& email,
- bool add_to_whitelist,
- Callback* callback) OVERRIDE;
virtual void StartStorePropertyOp(const std::string& name,
const base::Value& value,
Callback* callback) OVERRIDE;
@@ -342,27 +271,6 @@ SignedSettingsHelperImpl::~SignedSettingsHelperImpl() {
}
}
-void SignedSettingsHelperImpl::StartCheckWhitelistOp(
- const std::string&email,
- SignedSettingsHelper::Callback* callback) {
- AddOpContext(new WhitelistOpContext(
- WhitelistOpContext::CHECK,
- email,
- callback,
- this));
-}
-
-void SignedSettingsHelperImpl::StartWhitelistOp(
- const std::string&email,
- bool add_to_whitelist,
- SignedSettingsHelper::Callback* callback) {
- AddOpContext(new WhitelistOpContext(
- add_to_whitelist ? WhitelistOpContext::ADD : WhitelistOpContext::REMOVE,
- email,
- callback,
- this));
-}
-
void SignedSettingsHelperImpl::StartStorePropertyOp(
const std::string& name,
const base::Value& value,

Powered by Google App Engine
This is Rietveld 408576698