OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 command_line_->GetSwitchValueASCII(switches::kProxyBypassList); | 169 command_line_->GetSwitchValueASCII(switches::kProxyBypassList); |
170 SetValue(prefs::kProxy, | 170 SetValue(prefs::kProxy, |
171 make_scoped_ptr(ProxyConfigDictionary::CreateFixedServers( | 171 make_scoped_ptr(ProxyConfigDictionary::CreateFixedServers( |
172 proxy_server, bypass_list)), | 172 proxy_server, bypass_list)), |
173 WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); | 173 WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); |
174 } | 174 } |
175 } | 175 } |
176 | 176 |
177 void CommandLinePrefStore::ApplySSLSwitches() { | 177 void CommandLinePrefStore::ApplySSLSwitches() { |
178 if (command_line_->HasSwitch(switches::kCipherSuiteBlacklist)) { | 178 if (command_line_->HasSwitch(switches::kCipherSuiteBlacklist)) { |
179 std::string cipher_suites = | |
180 command_line_->GetSwitchValueASCII(switches::kCipherSuiteBlacklist); | |
181 std::vector<std::string> cipher_strings; | |
182 base::SplitString(cipher_suites, ',', &cipher_strings); | |
183 scoped_ptr<base::ListValue> list_value(new base::ListValue()); | 179 scoped_ptr<base::ListValue> list_value(new base::ListValue()); |
184 for (std::vector<std::string>::const_iterator it = cipher_strings.begin(); | 180 list_value->AppendStrings(base::SplitString( |
185 it != cipher_strings.end(); ++it) { | 181 command_line_->GetSwitchValueASCII(switches::kCipherSuiteBlacklist), |
186 list_value->AppendString(*it); | 182 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)); |
187 } | |
188 SetValue(prefs::kCipherSuiteBlacklist, list_value.Pass(), | 183 SetValue(prefs::kCipherSuiteBlacklist, list_value.Pass(), |
189 WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); | 184 WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); |
190 } | 185 } |
191 } | 186 } |
192 | 187 |
193 void CommandLinePrefStore::ApplyBackgroundModeSwitches() { | 188 void CommandLinePrefStore::ApplyBackgroundModeSwitches() { |
194 if (command_line_->HasSwitch(switches::kDisableExtensions)) | 189 if (command_line_->HasSwitch(switches::kDisableExtensions)) { |
195 SetValue(prefs::kBackgroundModeEnabled, | 190 SetValue(prefs::kBackgroundModeEnabled, |
196 make_scoped_ptr(new base::FundamentalValue(false)), | 191 make_scoped_ptr(new base::FundamentalValue(false)), |
197 WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); | 192 WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); |
| 193 } |
198 } | 194 } |
OLD | NEW |