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" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
13 #include "base/strings/string_split.h" | 13 #include "base/strings/string_split.h" |
14 #include "base/values.h" | 14 #include "base/values.h" |
15 #include "chrome/common/chrome_switches.h" | 15 #include "chrome/common/chrome_switches.h" |
16 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
17 #include "components/proxy_config/proxy_config_dictionary.h" | 17 #include "components/proxy_config/proxy_config_dictionary.h" |
18 #include "components/proxy_config/proxy_config_pref_names.h" | 18 #include "components/proxy_config/proxy_config_pref_names.h" |
| 19 #include "components/ssl_config/ssl_config_prefs.h" |
| 20 #include "components/ssl_config/ssl_config_switches.h" |
19 #include "ui/base/ui_base_switches.h" | 21 #include "ui/base/ui_base_switches.h" |
20 | 22 |
21 #if defined(OS_CHROMEOS) | 23 #if defined(OS_CHROMEOS) |
22 #include "chromeos/chromeos_switches.h" | 24 #include "chromeos/chromeos_switches.h" |
23 #endif | 25 #endif |
24 | 26 |
25 const CommandLinePrefStore::StringSwitchToPreferenceMapEntry | 27 const CommandLinePrefStore::StringSwitchToPreferenceMapEntry |
26 CommandLinePrefStore::string_switch_map_[] = { | 28 CommandLinePrefStore::string_switch_map_[] = { |
27 { switches::kLang, prefs::kApplicationLocale }, | 29 { switches::kLang, prefs::kApplicationLocale }, |
28 { data_reduction_proxy::switches::kDataReductionProxy, | 30 { data_reduction_proxy::switches::kDataReductionProxy, |
29 data_reduction_proxy::prefs::kDataReductionProxy }, | 31 data_reduction_proxy::prefs::kDataReductionProxy }, |
30 { switches::kAuthServerWhitelist, prefs::kAuthServerWhitelist }, | 32 { switches::kAuthServerWhitelist, prefs::kAuthServerWhitelist }, |
31 { switches::kSSLVersionMin, prefs::kSSLVersionMin }, | 33 { switches::kSSLVersionMin, ssl_config::prefs::kSSLVersionMin }, |
32 { switches::kSSLVersionMax, prefs::kSSLVersionMax }, | 34 { switches::kSSLVersionMax, ssl_config::prefs::kSSLVersionMax }, |
33 { switches::kSSLVersionFallbackMin, prefs::kSSLVersionFallbackMin }, | 35 { switches::kSSLVersionFallbackMin, |
| 36 ssl_config::prefs::kSSLVersionFallbackMin }, |
34 #if defined(OS_ANDROID) | 37 #if defined(OS_ANDROID) |
35 { switches::kAuthAndroidNegotiateAccountType, | 38 { switches::kAuthAndroidNegotiateAccountType, |
36 prefs::kAuthAndroidNegotiateAccountType }, | 39 prefs::kAuthAndroidNegotiateAccountType }, |
37 #endif | 40 #endif |
38 }; | 41 }; |
39 | 42 |
40 const CommandLinePrefStore::PathSwitchToPreferenceMapEntry | 43 const CommandLinePrefStore::PathSwitchToPreferenceMapEntry |
41 CommandLinePrefStore::path_switch_map_[] = { | 44 CommandLinePrefStore::path_switch_map_[] = { |
42 { switches::kDiskCacheDir, prefs::kDiskCacheDir }, | 45 { switches::kDiskCacheDir, prefs::kDiskCacheDir }, |
43 }; | 46 }; |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); | 177 WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); |
175 } | 178 } |
176 } | 179 } |
177 | 180 |
178 void CommandLinePrefStore::ApplySSLSwitches() { | 181 void CommandLinePrefStore::ApplySSLSwitches() { |
179 if (command_line_->HasSwitch(switches::kCipherSuiteBlacklist)) { | 182 if (command_line_->HasSwitch(switches::kCipherSuiteBlacklist)) { |
180 scoped_ptr<base::ListValue> list_value(new base::ListValue()); | 183 scoped_ptr<base::ListValue> list_value(new base::ListValue()); |
181 list_value->AppendStrings(base::SplitString( | 184 list_value->AppendStrings(base::SplitString( |
182 command_line_->GetSwitchValueASCII(switches::kCipherSuiteBlacklist), | 185 command_line_->GetSwitchValueASCII(switches::kCipherSuiteBlacklist), |
183 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)); | 186 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)); |
184 SetValue(prefs::kCipherSuiteBlacklist, list_value.Pass(), | 187 SetValue(ssl_config::prefs::kCipherSuiteBlacklist, list_value.Pass(), |
185 WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); | 188 WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); |
186 } | 189 } |
187 } | 190 } |
188 | 191 |
189 void CommandLinePrefStore::ApplyBackgroundModeSwitches() { | 192 void CommandLinePrefStore::ApplyBackgroundModeSwitches() { |
190 if (command_line_->HasSwitch(switches::kDisableExtensions)) { | 193 if (command_line_->HasSwitch(switches::kDisableExtensions)) { |
191 SetValue(prefs::kBackgroundModeEnabled, | 194 SetValue(prefs::kBackgroundModeEnabled, |
192 make_scoped_ptr(new base::FundamentalValue(false)), | 195 make_scoped_ptr(new base::FundamentalValue(false)), |
193 WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); | 196 WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); |
194 } | 197 } |
195 } | 198 } |
OLD | NEW |