Chromium Code Reviews| 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 8fffb9c39d5dd3a5ab8c2f32fdb10e3b41d9690d..17e23917404fe22c3e67df09b876dcd5f6cb016f 100644 |
| --- a/chrome/browser/prefs/command_line_pref_store.cc |
| +++ b/chrome/browser/prefs/command_line_pref_store.cc |
| @@ -7,6 +7,7 @@ |
| #include "app/app_switches.h" |
| #include "base/logging.h" |
| #include "base/values.h" |
| +#include "chrome/browser/net/pref_proxy_config_service.h" |
| #include "chrome/common/chrome_switches.h" |
| #include "chrome/common/pref_names.h" |
| @@ -25,8 +26,6 @@ const CommandLinePrefStore::StringSwitchToPreferenceMapEntry |
| const CommandLinePrefStore::BooleanSwitchToPreferenceMapEntry |
| CommandLinePrefStore::boolean_switch_map_[] = { |
| - { switches::kNoProxyServer, prefs::kNoProxyServer, true }, |
| - { switches::kProxyAutoDetect, prefs::kProxyAutoDetect, true }, |
| { switches::kDisableAuthNegotiateCnameLookup, |
| prefs::kDisableAuthNegotiateCnameLookup, true }, |
| { switches::kEnableAuthNegotiatePort, prefs::kEnableAuthNegotiatePort, |
| @@ -36,6 +35,7 @@ const CommandLinePrefStore::BooleanSwitchToPreferenceMapEntry |
| CommandLinePrefStore::CommandLinePrefStore(const CommandLine* command_line) |
| : command_line_(command_line) { |
| ApplySimpleSwitches(); |
| + ApplyProxySwitches(); |
| ValidateProxySwitches(); |
| } |
| @@ -72,3 +72,17 @@ bool CommandLinePrefStore::ValidateProxySwitches() { |
| } |
| return true; |
| } |
| +void CommandLinePrefStore::ApplyProxySwitches() { |
| + if (command_line_->HasSwitch(switches::kNoProxyServer)) { |
| + SetValue(prefs::kProxyServerMode, |
| + Value::CreateIntegerValue(PrefProxyConfigService::DISABLED)); |
| + } else if (command_line_->HasSwitch(switches::kProxyAutoDetect)) { |
| + SetValue(prefs::kProxyServerMode, |
| + Value::CreateIntegerValue(PrefProxyConfigService::AUTO_DETECT)); |
| + } else if (command_line_->HasSwitch(switches::kProxyServer) || |
| + command_line_->HasSwitch(switches::kProxyPacUrl) || |
| + command_line_->HasSwitch(switches::kProxyBypassList)) { |
| + SetValue(prefs::kProxyServerMode, |
| + Value::CreateIntegerValue(PrefProxyConfigService::MANUAL)); |
| + } |
|
danno
2010/12/14 12:48:17
validation and warning of conflicting switches sin
gfeher
2010/12/16 10:42:04
This happens in ValidateProxySwitches. It looks to
|
| +} |