| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 } | 77 } |
| 78 | 78 |
| 79 void CommandLinePrefStore::ApplyProxyMode() { | 79 void CommandLinePrefStore::ApplyProxyMode() { |
| 80 if (command_line_->HasSwitch(switches::kNoProxyServer)) { | 80 if (command_line_->HasSwitch(switches::kNoProxyServer)) { |
| 81 SetValue(prefs::kProxy, | 81 SetValue(prefs::kProxy, |
| 82 ProxyConfigDictionary::CreateDirect()); | 82 ProxyConfigDictionary::CreateDirect()); |
| 83 } else if (command_line_->HasSwitch(switches::kProxyPacUrl)) { | 83 } else if (command_line_->HasSwitch(switches::kProxyPacUrl)) { |
| 84 std::string pac_script_url = | 84 std::string pac_script_url = |
| 85 command_line_->GetSwitchValueASCII(switches::kProxyPacUrl); | 85 command_line_->GetSwitchValueASCII(switches::kProxyPacUrl); |
| 86 SetValue(prefs::kProxy, | 86 SetValue(prefs::kProxy, |
| 87 ProxyConfigDictionary::CreatePacScript(pac_script_url)); | 87 ProxyConfigDictionary::CreatePacScript(pac_script_url, false)); |
| 88 } else if (command_line_->HasSwitch(switches::kProxyAutoDetect)) { | 88 } else if (command_line_->HasSwitch(switches::kProxyAutoDetect)) { |
| 89 SetValue(prefs::kProxy, | 89 SetValue(prefs::kProxy, |
| 90 ProxyConfigDictionary::CreateAutoDetect()); | 90 ProxyConfigDictionary::CreateAutoDetect()); |
| 91 } else if (command_line_->HasSwitch(switches::kProxyServer)) { | 91 } else if (command_line_->HasSwitch(switches::kProxyServer)) { |
| 92 std::string proxy_server = | 92 std::string proxy_server = |
| 93 command_line_->GetSwitchValueASCII(switches::kProxyServer); | 93 command_line_->GetSwitchValueASCII(switches::kProxyServer); |
| 94 std::string bypass_list = | 94 std::string bypass_list = |
| 95 command_line_->GetSwitchValueASCII(switches::kProxyBypassList); | 95 command_line_->GetSwitchValueASCII(switches::kProxyBypassList); |
| 96 SetValue(prefs::kProxy, | 96 SetValue(prefs::kProxy, |
| 97 ProxyConfigDictionary::CreateFixedServers(proxy_server, | 97 ProxyConfigDictionary::CreateFixedServers(proxy_server, |
| 98 bypass_list)); | 98 bypass_list)); |
| 99 } | 99 } |
| 100 } | 100 } |
| OLD | NEW |