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

Side by Side Diff: chrome/browser/prefs/command_line_pref_store.cc

Issue 6871019: Enable (optional) blocking of webrequests in case a PAC script cannot be fetched or is invalid. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 9 years, 8 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698