| 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/chrome_command_line_pref_store.h" | 5 #include "chrome/browser/prefs/chrome_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 12 matching lines...) Expand all Loading... |
| 23 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_
names.h" | 23 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_
names.h" |
| 24 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_switc
hes.h" | 24 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_switc
hes.h" |
| 25 #include "components/proxy_config/proxy_config_dictionary.h" | 25 #include "components/proxy_config/proxy_config_dictionary.h" |
| 26 #include "components/proxy_config/proxy_config_pref_names.h" | 26 #include "components/proxy_config/proxy_config_pref_names.h" |
| 27 #include "components/ssl_config/ssl_config_prefs.h" | 27 #include "components/ssl_config/ssl_config_prefs.h" |
| 28 #include "components/ssl_config/ssl_config_switches.h" | 28 #include "components/ssl_config/ssl_config_switches.h" |
| 29 #include "content/public/common/content_switches.h" | 29 #include "content/public/common/content_switches.h" |
| 30 #include "ui/base/ui_base_switches.h" | 30 #include "ui/base/ui_base_switches.h" |
| 31 #include "ui/display/display_switches.h" | 31 #include "ui/display/display_switches.h" |
| 32 | 32 |
| 33 #if defined(OS_ANDROID) |
| 34 #include "chrome/browser/android/preferences/command_line_pref_store_android.h" |
| 35 #endif |
| 36 |
| 33 #if defined(OS_CHROMEOS) | 37 #if defined(OS_CHROMEOS) |
| 34 #include "chromeos/chromeos_switches.h" | 38 #include "chromeos/chromeos_switches.h" |
| 35 #endif | 39 #endif |
| 36 | 40 |
| 37 const CommandLinePrefStore::SwitchToPreferenceMapEntry | 41 const CommandLinePrefStore::SwitchToPreferenceMapEntry |
| 38 ChromeCommandLinePrefStore::string_switch_map_[] = { | 42 ChromeCommandLinePrefStore::string_switch_map_[] = { |
| 39 { switches::kLang, prefs::kApplicationLocale }, | 43 { switches::kLang, prefs::kApplicationLocale }, |
| 40 { data_reduction_proxy::switches::kDataReductionProxy, | 44 { data_reduction_proxy::switches::kDataReductionProxy, |
| 41 data_reduction_proxy::prefs::kDataReductionProxy }, | 45 data_reduction_proxy::prefs::kDataReductionProxy }, |
| 42 { switches::kAuthServerWhitelist, prefs::kAuthServerWhitelist }, | 46 { switches::kAuthServerWhitelist, prefs::kAuthServerWhitelist }, |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 } | 111 } |
| 108 return true; | 112 return true; |
| 109 } | 113 } |
| 110 | 114 |
| 111 void ChromeCommandLinePrefStore::ApplySimpleSwitches() { | 115 void ChromeCommandLinePrefStore::ApplySimpleSwitches() { |
| 112 // Look for each switch we know about and set its preference accordingly. | 116 // Look for each switch we know about and set its preference accordingly. |
| 113 ApplyStringSwitches(string_switch_map_, arraysize(string_switch_map_)); | 117 ApplyStringSwitches(string_switch_map_, arraysize(string_switch_map_)); |
| 114 ApplyPathSwitches(path_switch_map_, arraysize(path_switch_map_)); | 118 ApplyPathSwitches(path_switch_map_, arraysize(path_switch_map_)); |
| 115 ApplyIntegerSwitches(integer_switch_map_, arraysize(integer_switch_map_)); | 119 ApplyIntegerSwitches(integer_switch_map_, arraysize(integer_switch_map_)); |
| 116 ApplyBooleanSwitches(boolean_switch_map_, arraysize(boolean_switch_map_)); | 120 ApplyBooleanSwitches(boolean_switch_map_, arraysize(boolean_switch_map_)); |
| 121 #if defined(OS_ANDROID) |
| 122 ::android::ApplyBlimpSwitches(this); |
| 123 #endif |
| 117 } | 124 } |
| 118 | 125 |
| 119 void ChromeCommandLinePrefStore::ApplyProxyMode() { | 126 void ChromeCommandLinePrefStore::ApplyProxyMode() { |
| 120 if (command_line()->HasSwitch(switches::kNoProxyServer)) { | 127 if (command_line()->HasSwitch(switches::kNoProxyServer)) { |
| 121 SetValue(proxy_config::prefs::kProxy, | 128 SetValue(proxy_config::prefs::kProxy, |
| 122 base::WrapUnique(ProxyConfigDictionary::CreateDirect()), | 129 base::WrapUnique(ProxyConfigDictionary::CreateDirect()), |
| 123 WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); | 130 WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); |
| 124 } else if (command_line()->HasSwitch(switches::kProxyPacUrl)) { | 131 } else if (command_line()->HasSwitch(switches::kProxyPacUrl)) { |
| 125 std::string pac_script_url = | 132 std::string pac_script_url = |
| 126 command_line()->GetSwitchValueASCII(switches::kProxyPacUrl); | 133 command_line()->GetSwitchValueASCII(switches::kProxyPacUrl); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 155 } | 162 } |
| 156 } | 163 } |
| 157 | 164 |
| 158 void ChromeCommandLinePrefStore::ApplyBackgroundModeSwitches() { | 165 void ChromeCommandLinePrefStore::ApplyBackgroundModeSwitches() { |
| 159 if (command_line()->HasSwitch(switches::kDisableExtensions)) { | 166 if (command_line()->HasSwitch(switches::kDisableExtensions)) { |
| 160 SetValue(prefs::kBackgroundModeEnabled, | 167 SetValue(prefs::kBackgroundModeEnabled, |
| 161 base::MakeUnique<base::FundamentalValue>(false), | 168 base::MakeUnique<base::FundamentalValue>(false), |
| 162 WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); | 169 WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); |
| 163 } | 170 } |
| 164 } | 171 } |
| OLD | NEW |