| 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" | 22 #include "components/ssl_config/ssl_config_prefs.h" |
| 23 #include "components/ssl_config/ssl_config_switches.h" | 23 #include "components/ssl_config/ssl_config_switches.h" |
| 24 #include "content/public/common/content_switches.h" | 24 #include "content/public/common/content_switches.h" |
| 25 #include "net/base/net_pref_names.h" |
| 25 #include "ui/base/ui_base_switches.h" | 26 #include "ui/base/ui_base_switches.h" |
| 26 | 27 |
| 27 #if defined(OS_CHROMEOS) | 28 #if defined(OS_CHROMEOS) |
| 28 #include "chromeos/chromeos_switches.h" | 29 #include "chromeos/chromeos_switches.h" |
| 29 #endif | 30 #endif |
| 30 | 31 |
| 31 const CommandLinePrefStore::StringSwitchToPreferenceMapEntry | 32 const CommandLinePrefStore::StringSwitchToPreferenceMapEntry |
| 32 CommandLinePrefStore::string_switch_map_[] = { | 33 CommandLinePrefStore::string_switch_map_[] = { |
| 33 { switches::kLang, prefs::kApplicationLocale }, | 34 { switches::kLang, prefs::kApplicationLocale }, |
| 34 { data_reduction_proxy::switches::kDataReductionProxy, | 35 { data_reduction_proxy::switches::kDataReductionProxy, |
| 35 data_reduction_proxy::prefs::kDataReductionProxy }, | 36 data_reduction_proxy::prefs::kDataReductionProxy }, |
| 36 { switches::kAuthServerWhitelist, prefs::kAuthServerWhitelist }, | 37 { switches::kAuthServerWhitelist, net::prefs::kAuthServerWhitelist }, |
| 37 { switches::kSSLVersionMin, ssl_config::prefs::kSSLVersionMin }, | 38 { switches::kSSLVersionMin, ssl_config::prefs::kSSLVersionMin }, |
| 38 { switches::kSSLVersionMax, ssl_config::prefs::kSSLVersionMax }, | 39 { switches::kSSLVersionMax, ssl_config::prefs::kSSLVersionMax }, |
| 39 { switches::kSSLVersionFallbackMin, | 40 { switches::kSSLVersionFallbackMin, |
| 40 ssl_config::prefs::kSSLVersionFallbackMin }, | 41 ssl_config::prefs::kSSLVersionFallbackMin }, |
| 41 #if defined(OS_ANDROID) | 42 #if defined(OS_ANDROID) |
| 42 { switches::kAuthAndroidNegotiateAccountType, | 43 { switches::kAuthAndroidNegotiateAccountType, |
| 43 prefs::kAuthAndroidNegotiateAccountType }, | 44 net::prefs::kAuthAndroidNegotiateAccountType }, |
| 44 #endif | 45 #endif |
| 45 }; | 46 }; |
| 46 | 47 |
| 47 const CommandLinePrefStore::PathSwitchToPreferenceMapEntry | 48 const CommandLinePrefStore::PathSwitchToPreferenceMapEntry |
| 48 CommandLinePrefStore::path_switch_map_[] = { | 49 CommandLinePrefStore::path_switch_map_[] = { |
| 49 { switches::kDiskCacheDir, prefs::kDiskCacheDir }, | 50 { switches::kDiskCacheDir, prefs::kDiskCacheDir }, |
| 50 }; | 51 }; |
| 51 | 52 |
| 52 const CommandLinePrefStore::BooleanSwitchToPreferenceMapEntry | 53 const CommandLinePrefStore::BooleanSwitchToPreferenceMapEntry |
| 53 CommandLinePrefStore::boolean_switch_map_[] = { | 54 CommandLinePrefStore::boolean_switch_map_[] = { |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 } | 196 } |
| 196 } | 197 } |
| 197 | 198 |
| 198 void CommandLinePrefStore::ApplyBackgroundModeSwitches() { | 199 void CommandLinePrefStore::ApplyBackgroundModeSwitches() { |
| 199 if (command_line_->HasSwitch(switches::kDisableExtensions)) { | 200 if (command_line_->HasSwitch(switches::kDisableExtensions)) { |
| 200 SetValue(prefs::kBackgroundModeEnabled, | 201 SetValue(prefs::kBackgroundModeEnabled, |
| 201 make_scoped_ptr(new base::FundamentalValue(false)), | 202 make_scoped_ptr(new base::FundamentalValue(false)), |
| 202 WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); | 203 WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); |
| 203 } | 204 } |
| 204 } | 205 } |
| OLD | NEW |