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

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: Fixed Lint comment Created 9 years, 10 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 e457f2f147a2b50bf52ca44adb507c623c15e6a0..97e0d39b8abc570e58d880a3dd900a30b86230ed 100644
--- a/chrome/browser/prefs/command_line_pref_store.cc
+++ b/chrome/browser/prefs/command_line_pref_store.cc
@@ -7,7 +7,7 @@
#include "app/app_switches.h"
#include "base/logging.h"
#include "base/values.h"
-#include "chrome/browser/prefs/proxy_prefs.h"
+#include "chrome/browser/prefs/proxy_config_dictionary.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "ui/base/ui_base_switches.h"
@@ -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,
@@ -79,16 +76,23 @@ bool CommandLinePrefStore::ValidateProxySwitches() {
void CommandLinePrefStore::ApplyProxyMode() {
if (command_line_->HasSwitch(switches::kNoProxyServer)) {
- SetValue(prefs::kProxyMode,
- Value::CreateIntegerValue(ProxyPrefs::MODE_DIRECT));
+ SetValue(prefs::kProxy,
+ ProxyConfigDictionary::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,
+ ProxyConfigDictionary::CreatePacScript(pac_script_url));
} else if (command_line_->HasSwitch(switches::kProxyAutoDetect)) {
- SetValue(prefs::kProxyMode,
- Value::CreateIntegerValue(ProxyPrefs::MODE_AUTO_DETECT));
+ SetValue(prefs::kProxy,
+ ProxyConfigDictionary::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,
+ ProxyConfigDictionary::CreateFixedServers(proxy_server,
+ bypass_list));
}
}
« no previous file with comments | « chrome/browser/policy/managed_prefs_banner_base.cc ('k') | chrome/browser/prefs/command_line_pref_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698