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

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: Browser test added. 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..647a35ab6519a309021bc4bf07d093e695a8ff6e 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)) {
+ 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;
- }
+ bool found = setting_dict->Remove("value", &value);
+ delete setting;
James Hawkins 2012/08/07 17:59:05 nit: Wrap the returned value in a scoped_ptr inste
bartfab (slow) 2012/08/07 18:27:05 Done.
+ if (found)
+ return value;
}
+
return NULL;
}

Powered by Google App Engine
This is Rietveld 408576698