| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "chrome/common/chrome_switches.h" | 22 #include "chrome/common/chrome_switches.h" |
| 23 #include "chrome/common/pref_names.h" | 23 #include "chrome/common/pref_names.h" |
| 24 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_
names.h" | 24 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_
names.h" |
| 25 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_switc
hes.h" | 25 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_switc
hes.h" |
| 26 #include "components/proxy_config/proxy_config_dictionary.h" | 26 #include "components/proxy_config/proxy_config_dictionary.h" |
| 27 #include "components/proxy_config/proxy_config_pref_names.h" | 27 #include "components/proxy_config/proxy_config_pref_names.h" |
| 28 #include "components/ssl_config/ssl_config_prefs.h" | 28 #include "components/ssl_config/ssl_config_prefs.h" |
| 29 #include "components/ssl_config/ssl_config_switches.h" | 29 #include "components/ssl_config/ssl_config_switches.h" |
| 30 #include "content/public/common/content_switches.h" | 30 #include "content/public/common/content_switches.h" |
| 31 #include "ui/base/ui_base_switches.h" | 31 #include "ui/base/ui_base_switches.h" |
| 32 #include "ui/display/display_switches.h" |
| 32 | 33 |
| 33 #if defined(OS_CHROMEOS) | 34 #if defined(OS_CHROMEOS) |
| 34 #include "chromeos/chromeos_switches.h" | 35 #include "chromeos/chromeos_switches.h" |
| 35 #endif | 36 #endif |
| 36 | 37 |
| 37 const CommandLinePrefStore::StringSwitchToPreferenceMapEntry | 38 const CommandLinePrefStore::StringSwitchToPreferenceMapEntry |
| 38 CommandLinePrefStore::string_switch_map_[] = { | 39 CommandLinePrefStore::string_switch_map_[] = { |
| 39 { switches::kLang, prefs::kApplicationLocale }, | 40 { switches::kLang, prefs::kApplicationLocale }, |
| 40 { data_reduction_proxy::switches::kDataReductionProxy, | 41 { data_reduction_proxy::switches::kDataReductionProxy, |
| 41 data_reduction_proxy::prefs::kDataReductionProxy }, | 42 data_reduction_proxy::prefs::kDataReductionProxy }, |
| 42 { switches::kAuthServerWhitelist, prefs::kAuthServerWhitelist }, | 43 { switches::kAuthServerWhitelist, prefs::kAuthServerWhitelist }, |
| 43 { switches::kSSLVersionMin, ssl_config::prefs::kSSLVersionMin }, | 44 { switches::kSSLVersionMin, ssl_config::prefs::kSSLVersionMin }, |
| 44 { switches::kSSLVersionMax, ssl_config::prefs::kSSLVersionMax }, | 45 { switches::kSSLVersionMax, ssl_config::prefs::kSSLVersionMax }, |
| 45 #if defined(OS_ANDROID) | 46 #if defined(OS_ANDROID) |
| 46 { switches::kAuthAndroidNegotiateAccountType, | 47 { switches::kAuthAndroidNegotiateAccountType, |
| 47 prefs::kAuthAndroidNegotiateAccountType }, | 48 prefs::kAuthAndroidNegotiateAccountType }, |
| 48 #endif | 49 #endif |
| 49 }; | 50 }; |
| 50 | 51 |
| 51 const CommandLinePrefStore::PathSwitchToPreferenceMapEntry | 52 const CommandLinePrefStore::PathSwitchToPreferenceMapEntry |
| 52 CommandLinePrefStore::path_switch_map_[] = { | 53 CommandLinePrefStore::path_switch_map_[] = { |
| 53 { switches::kDiskCacheDir, prefs::kDiskCacheDir }, | 54 { switches::kDiskCacheDir, prefs::kDiskCacheDir }, |
| 54 }; | 55 }; |
| 55 | 56 |
| 56 const CommandLinePrefStore::BooleanSwitchToPreferenceMapEntry | 57 const CommandLinePrefStore::BooleanSwitchToPreferenceMapEntry |
| 57 CommandLinePrefStore::boolean_switch_map_[] = { | 58 CommandLinePrefStore::boolean_switch_map_[] = { |
| 58 { switches::kDisable3DAPIs, prefs::kDisable3DAPIs, true }, | 59 {switches::kDisable3DAPIs, prefs::kDisable3DAPIs, true}, |
| 59 { switches::kEnableCloudPrintProxy, prefs::kCloudPrintProxyEnabled, | 60 {switches::kEnableCloudPrintProxy, prefs::kCloudPrintProxyEnabled, |
| 60 true }, | 61 true}, |
| 61 { switches::kAllowOutdatedPlugins, prefs::kPluginsAllowOutdated, true }, | 62 {switches::kAllowOutdatedPlugins, prefs::kPluginsAllowOutdated, true}, |
| 62 { switches::kAlwaysAuthorizePlugins, prefs::kPluginsAlwaysAuthorize, | 63 {switches::kAlwaysAuthorizePlugins, prefs::kPluginsAlwaysAuthorize, |
| 63 true }, | 64 true}, |
| 64 { switches::kNoPings, prefs::kEnableHyperlinkAuditing, false }, | 65 {switches::kNoPings, prefs::kEnableHyperlinkAuditing, false}, |
| 65 { switches::kNoReferrers, prefs::kEnableReferrers, false }, | 66 {switches::kNoReferrers, prefs::kEnableReferrers, false}, |
| 66 { switches::kAllowRunningInsecureContent, | 67 {switches::kAllowRunningInsecureContent, |
| 67 prefs::kWebKitAllowRunningInsecureContent, true }, | 68 prefs::kWebKitAllowRunningInsecureContent, true}, |
| 68 { switches::kAllowCrossOriginAuthPrompt, | 69 {switches::kAllowCrossOriginAuthPrompt, |
| 69 prefs::kAllowCrossOriginAuthPrompt, true }, | 70 prefs::kAllowCrossOriginAuthPrompt, true}, |
| 70 { switches::kDisablePrintPreview, prefs::kPrintPreviewDisabled, true }, | 71 {switches::kDisablePrintPreview, prefs::kPrintPreviewDisabled, true}, |
| 71 #if defined(OS_CHROMEOS) | 72 #if defined(OS_CHROMEOS) |
| 72 { chromeos::switches::kEnableTouchpadThreeFingerClick, | 73 {chromeos::switches::kEnableTouchpadThreeFingerClick, |
| 73 prefs::kEnableTouchpadThreeFingerClick, true }, | 74 prefs::kEnableTouchpadThreeFingerClick, true}, |
| 74 { ash::switches::kAshEnableUnifiedDesktop, | 75 {switches::kEnableUnifiedDesktop, |
| 75 prefs::kUnifiedDesktopEnabledByDefault, true }, | 76 prefs::kUnifiedDesktopEnabledByDefault, true}, |
| 76 #endif | 77 #endif |
| 77 { switches::kDisableAsyncDns, prefs::kBuiltInDnsClientEnabled, false }, | 78 {switches::kDisableAsyncDns, prefs::kBuiltInDnsClientEnabled, false}, |
| 78 { switches::kUnsafePacUrl, prefs::kPacHttpsUrlStrippingEnabled, false }, | 79 {switches::kUnsafePacUrl, prefs::kPacHttpsUrlStrippingEnabled, false}, |
| 79 }; | 80 }; |
| 80 | 81 |
| 81 const CommandLinePrefStore::IntegerSwitchToPreferenceMapEntry | 82 const CommandLinePrefStore::IntegerSwitchToPreferenceMapEntry |
| 82 CommandLinePrefStore::integer_switch_map_[] = { | 83 CommandLinePrefStore::integer_switch_map_[] = { |
| 83 { switches::kDiskCacheSize, prefs::kDiskCacheSize }, | 84 { switches::kDiskCacheSize, prefs::kDiskCacheSize }, |
| 84 { switches::kMediaCacheSize, prefs::kMediaCacheSize }, | 85 { switches::kMediaCacheSize, prefs::kMediaCacheSize }, |
| 85 }; | 86 }; |
| 86 | 87 |
| 87 CommandLinePrefStore::CommandLinePrefStore( | 88 CommandLinePrefStore::CommandLinePrefStore( |
| 88 const base::CommandLine* command_line) | 89 const base::CommandLine* command_line) |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 } | 199 } |
| 199 } | 200 } |
| 200 | 201 |
| 201 void CommandLinePrefStore::ApplyBackgroundModeSwitches() { | 202 void CommandLinePrefStore::ApplyBackgroundModeSwitches() { |
| 202 if (command_line_->HasSwitch(switches::kDisableExtensions)) { | 203 if (command_line_->HasSwitch(switches::kDisableExtensions)) { |
| 203 SetValue(prefs::kBackgroundModeEnabled, | 204 SetValue(prefs::kBackgroundModeEnabled, |
| 204 base::WrapUnique(new base::FundamentalValue(false)), | 205 base::WrapUnique(new base::FundamentalValue(false)), |
| 205 WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); | 206 WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); |
| 206 } | 207 } |
| 207 } | 208 } |
| OLD | NEW |