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

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

Issue 5701003: Intorduce a separate preference for 'proxy server mode' (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix indentation nit Created 10 years 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 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() {
Pam (message me for reviews) 2010/12/18 08:29:55 Naming again. If the pref is kProxyServerMode, thi
battre (please use the other) 2010/12/20 12:57:23 This remains ApplyProxyMode after renaming kProxyS
+ 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) ||
Mattias Nissler (ping if slow) 2010/12/20 13:34:03 can we align these with the opening parentheses? (
battre (please use the other) 2010/12/21 14:18:18 Yes we can. Done.
+ command_line_->HasSwitch(switches::kProxyBypassList)) {
+ SetValue(prefs::kProxyServerMode,
+ Value::CreateIntegerValue(ProxyPrefs::MANUAL));
+ }
+ // Mode defaults to system.
Mattias Nissler (ping if slow) 2010/12/20 13:34:03 What's that comment good for? Could also be overri
battre (please use the other) 2010/12/21 14:18:18 I deleted it.
+}

Powered by Google App Engine
This is Rietveld 408576698