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

Unified Diff: chrome/browser/automation/testing_automation_provider_chromeos.cc

Issue 10834109: Consistently decorate pref values sent to the settings UI code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments addressed. Created 8 years, 4 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/automation/testing_automation_provider_chromeos.cc
diff --git a/chrome/browser/automation/testing_automation_provider_chromeos.cc b/chrome/browser/automation/testing_automation_provider_chromeos.cc
index 926170b0fb663d37413baef4c8eccac150070d34..e8094204da5981d23a8b5b95754d40acf3ccb620 100644
--- a/chrome/browser/automation/testing_automation_provider_chromeos.cc
+++ b/chrome/browser/automation/testing_automation_provider_chromeos.cc
@@ -87,24 +87,17 @@ base::Value* GetProxySetting(Browser* browser,
std::string setting_path = "cros.session.proxy.";
setting_path.append(setting_name);
- if (setting_name == "ignorelist") {
+ base::Value* setting;
+ if (chromeos::proxy_cros_settings_parser::GetProxyPrefValue(
+ browser->profile(), setting_path, &setting)) {
+ scoped_ptr<DictionaryValue> setting_dict(
+ static_cast<DictionaryValue*>(setting));
+ DictionaryValue* setting_dict = static_cast<DictionaryValue*>(setting);
base::Value* value;
- if (chromeos::proxy_cros_settings_parser::GetProxyPrefValue(
- browser->profile(), setting_path, &value)) {
- return value;
- }
- } else {
- base::Value* setting;
- if (chromeos::proxy_cros_settings_parser::GetProxyPrefValue(
- browser->profile(), setting_path, &setting)) {
- DictionaryValue* setting_dict = static_cast<DictionaryValue*>(setting);
- base::Value* value;
- bool found = setting_dict->Remove("value", &value);
- delete setting;
- if (found)
- return value;
- }
+ if (setting_dict->Remove("value", &value))
+ return value;
}
+
return NULL;
}

Powered by Google App Engine
This is Rietveld 408576698