Chromium Code Reviews| 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 b2075f726347adc8b728277eba737405d756f780..e36876a753131562091fe99b87c59c593fcea849 100644 |
| --- a/chrome/browser/chromeos/login/signed_settings_helper.cc |
| +++ b/chrome/browser/chromeos/login/signed_settings_helper.cc |
| @@ -90,11 +90,6 @@ class OpContext { |
| delete this; |
| } |
| - // Callback on op failure. |
| - virtual void OnOpFailed() { |
| - OnOpCompleted(); |
| - } |
| - |
| bool executing_; |
| Delegate* delegate_; |
| @@ -121,31 +116,29 @@ class WhitelistOpContext : public SignedSettings::Delegate<bool>, |
| } |
| // chromeos::SignedSettings::Delegate implementation |
| - virtual void OnSettingsOpSucceeded(bool value) { |
| + virtual void OnSettingsOpCompleted(SignedSettings::ReturnCode code, |
| + bool value) { |
| if (callback_) { |
| switch (type_) { |
| case CHECK: |
| - callback_->OnCheckWhiteListCompleted(value, email_); |
| + if (code != SignedSettings::SUCCESS) |
| + value = false; // Should be true already, but just to be sure. |
|
Denis Lagno
2010/12/09 11:54:12
for my eye comment disagrees with the code
Chris Masone
2010/12/09 16:33:42
again, you are right!
|
| + callback_->OnCheckWhitelistCompleted(code, value, email_); |
| break; |
| case ADD: |
| - callback_->OnWhitelistCompleted(value, email_); |
| + callback_->OnWhitelistCompleted(code, email_); |
| break; |
| case REMOVE: |
| - callback_->OnUnwhitelistCompleted(value, email_); |
| + callback_->OnUnwhitelistCompleted(code, email_); |
| break; |
| default: |
| LOG(ERROR) << "Unknown WhitelistOpContext type " << type_; |
| break; |
| } |
| } |
| - |
| OnOpCompleted(); |
| } |
| - virtual void OnSettingsOpFailed(SignedSettings::FailureCode code) { |
| - OnOpFailed(); |
| - } |
| - |
| protected: |
| // OpContext implemenetation |
| virtual void CreateOp() { |
| @@ -165,27 +158,6 @@ class WhitelistOpContext : public SignedSettings::Delegate<bool>, |
| } |
| } |
| - virtual void OnOpFailed() { |
| - if (callback_) { |
| - switch (type_) { |
| - case CHECK: |
| - callback_->OnCheckWhiteListCompleted(false, email_); |
| - break; |
| - case ADD: |
| - callback_->OnWhitelistCompleted(false, email_); |
| - break; |
| - case REMOVE: |
| - callback_->OnUnwhitelistCompleted(false, email_); |
| - break; |
| - default: |
| - LOG(ERROR) << "Unknown WhitelistOpContext type " << type_; |
| - break; |
| - } |
| - } |
| - |
| - OnOpCompleted(); |
| - } |
| - |
| private: |
| Type type_; |
| std::string email_; |
| @@ -206,28 +178,19 @@ class StorePropertyOpContext : public SignedSettings::Delegate<bool>, |
| } |
| // chromeos::SignedSettings::Delegate implementation |
| - virtual void OnSettingsOpSucceeded(bool value) { |
| + virtual void OnSettingsOpCompleted(SignedSettings::ReturnCode code, |
| + bool unused) { |
| if (callback_) |
| - callback_->OnStorePropertyCompleted(true, name_, value_); |
| + callback_->OnStorePropertyCompleted(code, name_, value_); |
| OnOpCompleted(); |
| } |
| - virtual void OnSettingsOpFailed(SignedSettings::FailureCode code) { |
| - OnOpFailed(); |
| - } |
| - |
| protected: |
| // OpContext implemenetation |
| virtual void CreateOp() { |
| op_ = SignedSettings::CreateStorePropertyOp(name_, value_, this); |
| } |
| - virtual void OnOpFailed() { |
| - if (callback_) |
| - callback_->OnStorePropertyCompleted(false, name_, value_); |
| - OnOpCompleted(); |
| - } |
| - |
| private: |
| std::string name_; |
| std::string value_; |
| @@ -247,29 +210,20 @@ class RetrievePropertyOpContext |
| } |
| // chromeos::SignedSettings::Delegate implementation |
| - virtual void OnSettingsOpSucceeded(std::string value) { |
| + virtual void OnSettingsOpCompleted(SignedSettings::ReturnCode code, |
| + std::string value) { |
| if (callback_) |
| - callback_->OnRetrievePropertyCompleted(true, name_, value); |
| + callback_->OnRetrievePropertyCompleted(code, name_, value); |
| OnOpCompleted(); |
| } |
| - virtual void OnSettingsOpFailed(SignedSettings::FailureCode code) { |
| - OnOpFailed(); |
| - } |
| - |
| protected: |
| // OpContext implemenetation |
| virtual void CreateOp() { |
| op_ = SignedSettings::CreateRetrievePropertyOp(name_, this); |
| } |
| - virtual void OnOpFailed() { |
| - if (callback_) |
| - callback_->OnRetrievePropertyCompleted(false, name_, std::string()); |
| - OnOpCompleted(); |
| - } |
| - |
| private: |
| std::string name_; |