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

Unified Diff: chrome/browser/chromeos/user_cros_settings_provider.cc

Issue 5671003: [Chrome OS] Plumb new error codes from SignedSettings to consumers of the API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove untoward log statement Created 10 years 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
« no previous file with comments | « chrome/browser/chromeos/proxy_config_service_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/user_cros_settings_provider.cc
diff --git a/chrome/browser/chromeos/user_cros_settings_provider.cc b/chrome/browser/chromeos/user_cros_settings_provider.cc
index 9aee01b9a9d053a160fd76c9ee70df35ce249f56..4c15e01b7b61022704012e9f3330a40a79575494 100644
--- a/chrome/browser/chromeos/user_cros_settings_provider.cc
+++ b/chrome/browser/chromeos/user_cros_settings_provider.cc
@@ -305,7 +305,7 @@ class UserCrosSettingsTrust : public SignedSettingsHelper::Callback,
}
// Implementation of SignedSettingsHelper::Callback.
- virtual void OnRetrievePropertyCompleted(bool success,
+ virtual void OnRetrievePropertyCompleted(SignedSettings::ReturnCode code,
const std::string& name,
const std::string& value) {
if (!IsControlledBooleanSetting(name) && !IsControlledStringSetting(name)) {
@@ -314,6 +314,7 @@ class UserCrosSettingsTrust : public SignedSettingsHelper::Callback,
}
DCHECK(GetOwnershipStatus() != OWNERSHIP_UNKNOWN);
+ bool success = code == SignedSettings::SUCCESS;
PrefService* prefs = g_browser_process->local_state();
if (!success && GetOwnershipStatus() == OWNERSHIP_TAKEN) {
LOG(ERROR) << "On owned device: failed to retrieve cros "
@@ -366,32 +367,34 @@ class UserCrosSettingsTrust : public SignedSettingsHelper::Callback,
}
// Implementation of SignedSettingsHelper::Callback.
- virtual void OnStorePropertyCompleted(bool success,
+ virtual void OnStorePropertyCompleted(SignedSettings::ReturnCode code,
const std::string& name,
const std::string& value) {
- VLOG(1) << "Store cros setting " << name << "=" << value << ", success="
- << success;
+ VLOG(1) << "Store cros setting " << name << "=" << value << ", code="
+ << code;
// Reload the setting if store op fails.
- if (!success)
+ if (code != SignedSettings::SUCCESS)
SignedSettingsHelper::Get()->StartRetrieveProperty(name, this);
}
// Implementation of SignedSettingsHelper::Callback.
- virtual void OnWhitelistCompleted(bool success, const std::string& email) {
- VLOG(1) << "Add " << email << " to whitelist, success=" << success;
+ virtual void OnWhitelistCompleted(SignedSettings::ReturnCode code,
+ const std::string& email) {
+ VLOG(1) << "Add " << email << " to whitelist, code=" << code;
// Reload the whitelist on settings op failure.
- if (!success)
+ if (code != SignedSettings::SUCCESS)
CrosSettings::Get()->FireObservers(kAccountsPrefUsers);
}
// Implementation of SignedSettingsHelper::Callback.
- virtual void OnUnwhitelistCompleted(bool success, const std::string& email) {
- VLOG(1) << "Remove " << email << " from whitelist, success=" << success;
+ virtual void OnUnwhitelistCompleted(SignedSettings::ReturnCode code,
+ const std::string& email) {
+ VLOG(1) << "Remove " << email << " from whitelist, code=" << code;
// Reload the whitelist on settings op failure.
- if (!success)
+ if (code != SignedSettings::SUCCESS)
CrosSettings::Get()->FireObservers(kAccountsPrefUsers);
}
@@ -559,7 +562,6 @@ bool UserCrosSettingsProvider::HandlesSetting(const std::string& path) {
void UserCrosSettingsProvider::WhitelistUser(const std::string& email) {
SignedSettingsHelper::Get()->StartWhitelistOp(
email, true, UserCrosSettingsTrust::GetSharedInstance());
-
PrefService* prefs = g_browser_process->local_state();
ListValue* cached_whitelist = prefs->GetMutableList(kAccountsPrefUsers);
cached_whitelist->Append(Value::CreateStringValue(email));
« no previous file with comments | « chrome/browser/chromeos/proxy_config_service_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698