diff options
author | battre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-09 15:06:39 +0000 |
---|---|---|
committer | battre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-09 15:06:39 +0000 |
commit | b3633612e1a7861cdb2118aa2efd45a59e13d1ba (patch) | |
tree | 101fe2a7cad28aca7c2627d2ddfcf157241e4c95 /chrome | |
parent | ab2a2cf367a6356aad6bcd0477425322e4e04591 (diff) | |
download | chromium_src-b3633612e1a7861cdb2118aa2efd45a59e13d1ba.zip chromium_src-b3633612e1a7861cdb2118aa2efd45a59e13d1ba.tar.gz chromium_src-b3633612e1a7861cdb2118aa2efd45a59e13d1ba.tar.bz2 |
Consider --proxy-server= as 'use direct connections'
BUG=72104
TEST=unit test / pass --proxy-server= on command line
Review URL: http://codereview.chromium.org/6463020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74287 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/prefs/command_line_pref_store_unittest.cc | 6 | ||||
-rw-r--r-- | chrome/browser/prefs/proxy_config_dictionary.cc | 8 |
2 files changed, 12 insertions, 2 deletions
diff --git a/chrome/browser/prefs/command_line_pref_store_unittest.cc b/chrome/browser/prefs/command_line_pref_store_unittest.cc index b0e2d79..edc88d9 100644 --- a/chrome/browser/prefs/command_line_pref_store_unittest.cc +++ b/chrome/browser/prefs/command_line_pref_store_unittest.cc @@ -153,4 +153,10 @@ TEST(CommandLinePrefStoreTest, ManualProxyModeInference) { scoped_refptr<TestCommandLinePrefStore> store2 = new TestCommandLinePrefStore(&cl2); store2->VerifyProxyMode(ProxyPrefs::MODE_PAC_SCRIPT); + + CommandLine cl3(CommandLine::NO_PROGRAM); + cl3.AppendSwitchASCII(switches::kProxyServer, ""); + scoped_refptr<TestCommandLinePrefStore> store3 = + new TestCommandLinePrefStore(&cl3); + store3->VerifyProxyMode(ProxyPrefs::MODE_DIRECT); } diff --git a/chrome/browser/prefs/proxy_config_dictionary.cc b/chrome/browser/prefs/proxy_config_dictionary.cc index f19877c..f0e1e6f 100644 --- a/chrome/browser/prefs/proxy_config_dictionary.cc +++ b/chrome/browser/prefs/proxy_config_dictionary.cc @@ -67,8 +67,12 @@ DictionaryValue* ProxyConfigDictionary::CreatePacScript( DictionaryValue* ProxyConfigDictionary::CreateFixedServers( const std::string& proxy_server, const std::string& bypass_list) { - return CreateDictionary( - ProxyPrefs::MODE_FIXED_SERVERS, "", proxy_server, bypass_list); + if (!proxy_server.empty()) { + return CreateDictionary( + ProxyPrefs::MODE_FIXED_SERVERS, "", proxy_server, bypass_list); + } else { + return CreateDirect(); + } } // static |