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