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

Unified Diff: chrome/browser/prefs/command_line_pref_store.cc

Issue 6240013: Make proxy settings one atomic dictionary in the PrefStores such that modifications are atomic. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/out/Debug
Patch Set: Created 9 years, 11 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/prefs/command_line_pref_store.cc
diff --git a/chrome/browser/prefs/command_line_pref_store.cc b/chrome/browser/prefs/command_line_pref_store.cc
index 148616e279d145fc6ff587ee05a6d8963e571be1..18e6ed48f977128810c1f6ad7926072e3f2239b3 100644
--- a/chrome/browser/prefs/command_line_pref_store.cc
+++ b/chrome/browser/prefs/command_line_pref_store.cc
@@ -15,9 +15,6 @@
const CommandLinePrefStore::StringSwitchToPreferenceMapEntry
CommandLinePrefStore::string_switch_map_[] = {
{ switches::kLang, prefs::kApplicationLocale },
- { switches::kProxyServer, prefs::kProxyServer },
- { switches::kProxyPacUrl, prefs::kProxyPacUrl },
- { switches::kProxyBypassList, prefs::kProxyBypassList },
{ switches::kAuthSchemes, prefs::kAuthSchemes },
{ switches::kAuthServerWhitelist, prefs::kAuthServerWhitelist },
{ switches::kAuthNegotiateDelegateWhitelist,
@@ -77,16 +74,23 @@ bool CommandLinePrefStore::ValidateProxySwitches() {
void CommandLinePrefStore::ApplyProxyMode() {
if (command_line_->HasSwitch(switches::kNoProxyServer)) {
- SetValue(prefs::kProxyMode,
- Value::CreateIntegerValue(ProxyPrefs::MODE_DIRECT));
+ SetValue(prefs::kProxy,
+ ProxyPrefsDictionary::CreateDirect());
} else if (command_line_->HasSwitch(switches::kProxyPacUrl)) {
- SetValue(prefs::kProxyMode,
- Value::CreateIntegerValue(ProxyPrefs::MODE_PAC_SCRIPT));
+ std::string pac_script_url =
+ command_line_->GetSwitchValueASCII(switches::kProxyPacUrl);
+ SetValue(prefs::kProxy,
+ ProxyPrefsDictionary::CreatePacScript(pac_script_url));
} else if (command_line_->HasSwitch(switches::kProxyAutoDetect)) {
- SetValue(prefs::kProxyMode,
- Value::CreateIntegerValue(ProxyPrefs::MODE_AUTO_DETECT));
+ SetValue(prefs::kProxy,
+ ProxyPrefsDictionary::CreateAutoDetect());
} else if (command_line_->HasSwitch(switches::kProxyServer)) {
- SetValue(prefs::kProxyMode,
- Value::CreateIntegerValue(ProxyPrefs::MODE_FIXED_SERVERS));
+ std::string proxy_server =
+ command_line_->GetSwitchValueASCII(switches::kProxyServer);
+ std::string bypass_list =
+ command_line_->GetSwitchValueASCII(switches::kProxyBypassList);
+ SetValue(prefs::kProxy,
+ ProxyPrefsDictionary::CreateFixedServers(proxy_server,
+ bypass_list));
}
}

Powered by Google App Engine
This is Rietveld 408576698