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 "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 << " can not be converted to integer, ignoring!"; | 115 << " can not be converted to integer, ignoring!"; |
116 continue; | 116 continue; |
117 } | 117 } |
118 base::Value* value = base::Value::CreateIntegerValue(int_value); | 118 base::Value* value = base::Value::CreateIntegerValue(int_value); |
119 SetValue(integer_switch_map_[i].preference_path, value); | 119 SetValue(integer_switch_map_[i].preference_path, value); |
120 } | 120 } |
121 } | 121 } |
122 | 122 |
123 for (size_t i = 0; i < arraysize(boolean_switch_map_); ++i) { | 123 for (size_t i = 0; i < arraysize(boolean_switch_map_); ++i) { |
124 if (command_line_->HasSwitch(boolean_switch_map_[i].switch_name)) { | 124 if (command_line_->HasSwitch(boolean_switch_map_[i].switch_name)) { |
125 base::Value* value = base::Value::CreateBooleanValue( | 125 SetValue(boolean_switch_map_[i].preference_path, |
126 boolean_switch_map_[i].set_value); | 126 new base::FundamentalValue(boolean_switch_map_[i].set_value)); |
127 SetValue(boolean_switch_map_[i].preference_path, value); | |
128 } | 127 } |
129 } | 128 } |
130 } | 129 } |
131 | 130 |
132 void CommandLinePrefStore::ApplyProxyMode() { | 131 void CommandLinePrefStore::ApplyProxyMode() { |
133 if (command_line_->HasSwitch(switches::kNoProxyServer)) { | 132 if (command_line_->HasSwitch(switches::kNoProxyServer)) { |
134 SetValue(prefs::kProxy, | 133 SetValue(prefs::kProxy, |
135 ProxyConfigDictionary::CreateDirect()); | 134 ProxyConfigDictionary::CreateDirect()); |
136 } else if (command_line_->HasSwitch(switches::kProxyPacUrl)) { | 135 } else if (command_line_->HasSwitch(switches::kProxyPacUrl)) { |
137 std::string pac_script_url = | 136 std::string pac_script_url = |
(...skipping 23 matching lines...) Expand all Loading... |
161 base::ListValue* list_value = new base::ListValue(); | 160 base::ListValue* list_value = new base::ListValue(); |
162 for (std::vector<std::string>::const_iterator it = cipher_strings.begin(); | 161 for (std::vector<std::string>::const_iterator it = cipher_strings.begin(); |
163 it != cipher_strings.end(); ++it) { | 162 it != cipher_strings.end(); ++it) { |
164 list_value->Append(new base::StringValue(*it)); | 163 list_value->Append(new base::StringValue(*it)); |
165 } | 164 } |
166 SetValue(prefs::kCipherSuiteBlacklist, list_value); | 165 SetValue(prefs::kCipherSuiteBlacklist, list_value); |
167 } | 166 } |
168 } | 167 } |
169 | 168 |
170 void CommandLinePrefStore::ApplyBackgroundModeSwitches() { | 169 void CommandLinePrefStore::ApplyBackgroundModeSwitches() { |
171 if (command_line_->HasSwitch(switches::kDisableExtensions)) { | 170 if (command_line_->HasSwitch(switches::kDisableExtensions)) |
172 base::Value* value = base::Value::CreateBooleanValue(false); | 171 SetValue(prefs::kBackgroundModeEnabled, new base::FundamentalValue(false)); |
173 SetValue(prefs::kBackgroundModeEnabled, value); | |
174 } | |
175 } | 172 } |
OLD | NEW |