| 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..79bf0e1d9fc15249d37a311e33e5e4cccc3b29a6 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/prefs/proxy_prefs.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();
|
| + ApplyProxyMode();
|
| ValidateProxySwitches();
|
| }
|
|
|
| @@ -72,3 +72,19 @@ bool CommandLinePrefStore::ValidateProxySwitches() {
|
| }
|
| return true;
|
| }
|
| +
|
| +void CommandLinePrefStore::ApplyProxyMode() {
|
| + if (command_line_->HasSwitch(switches::kNoProxyServer)) {
|
| + SetValue(prefs::kProxyServerMode,
|
| + Value::CreateIntegerValue(ProxyPrefs::DISABLED));
|
| + } else if (command_line_->HasSwitch(switches::kProxyAutoDetect)) {
|
| + SetValue(prefs::kProxyServerMode,
|
| + Value::CreateIntegerValue(ProxyPrefs::AUTO_DETECT));
|
| + } else if (command_line_->HasSwitch(switches::kProxyServer) ||
|
| + command_line_->HasSwitch(switches::kProxyPacUrl) ||
|
| + command_line_->HasSwitch(switches::kProxyBypassList)) {
|
| + SetValue(prefs::kProxyServerMode,
|
| + Value::CreateIntegerValue(ProxyPrefs::MANUAL));
|
| + }
|
| + // Mode defaults to system.
|
| +}
|
|
|