| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/prefs/command_line_pref_store.h" | 5 #include "chrome/browser/prefs/command_line_pref_store.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/browser/prefs/proxy_config_dictionary.h" | 9 #include "chrome/browser/prefs/proxy_config_dictionary.h" |
| 10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 } | 79 } |
| 80 | 80 |
| 81 void CommandLinePrefStore::ApplyProxyMode() { | 81 void CommandLinePrefStore::ApplyProxyMode() { |
| 82 if (command_line_->HasSwitch(switches::kNoProxyServer)) { | 82 if (command_line_->HasSwitch(switches::kNoProxyServer)) { |
| 83 SetValue(prefs::kProxy, | 83 SetValue(prefs::kProxy, |
| 84 ProxyConfigDictionary::CreateDirect()); | 84 ProxyConfigDictionary::CreateDirect()); |
| 85 } else if (command_line_->HasSwitch(switches::kProxyPacUrl)) { | 85 } else if (command_line_->HasSwitch(switches::kProxyPacUrl)) { |
| 86 std::string pac_script_url = | 86 std::string pac_script_url = |
| 87 command_line_->GetSwitchValueASCII(switches::kProxyPacUrl); | 87 command_line_->GetSwitchValueASCII(switches::kProxyPacUrl); |
| 88 SetValue(prefs::kProxy, | 88 SetValue(prefs::kProxy, |
| 89 ProxyConfigDictionary::CreatePacScript(pac_script_url)); | 89 ProxyConfigDictionary::CreatePacScript(pac_script_url, false)); |
| 90 } else if (command_line_->HasSwitch(switches::kProxyAutoDetect)) { | 90 } else if (command_line_->HasSwitch(switches::kProxyAutoDetect)) { |
| 91 SetValue(prefs::kProxy, | 91 SetValue(prefs::kProxy, |
| 92 ProxyConfigDictionary::CreateAutoDetect()); | 92 ProxyConfigDictionary::CreateAutoDetect()); |
| 93 } else if (command_line_->HasSwitch(switches::kProxyServer)) { | 93 } else if (command_line_->HasSwitch(switches::kProxyServer)) { |
| 94 std::string proxy_server = | 94 std::string proxy_server = |
| 95 command_line_->GetSwitchValueASCII(switches::kProxyServer); | 95 command_line_->GetSwitchValueASCII(switches::kProxyServer); |
| 96 std::string bypass_list = | 96 std::string bypass_list = |
| 97 command_line_->GetSwitchValueASCII(switches::kProxyBypassList); | 97 command_line_->GetSwitchValueASCII(switches::kProxyBypassList); |
| 98 SetValue(prefs::kProxy, | 98 SetValue(prefs::kProxy, |
| 99 ProxyConfigDictionary::CreateFixedServers(proxy_server, | 99 ProxyConfigDictionary::CreateFixedServers(proxy_server, |
| 100 bypass_list)); | 100 bypass_list)); |
| 101 } | 101 } |
| 102 } | 102 } |
| OLD | NEW |