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