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

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, 7 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW
« no previous file with comments | « chrome/browser/policy/configuration_policy_pref_store.cc ('k') | chrome/browser/prefs/proxy_config_dictionary.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698