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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 if (command_line_->HasSwitch(integer_switch_map_[i].switch_name)) { | 108 if (command_line_->HasSwitch(integer_switch_map_[i].switch_name)) { |
109 std::string str_value = command_line_->GetSwitchValueASCII( | 109 std::string str_value = command_line_->GetSwitchValueASCII( |
110 integer_switch_map_[i].switch_name); | 110 integer_switch_map_[i].switch_name); |
111 int int_value = 0; | 111 int int_value = 0; |
112 if (!base::StringToInt(str_value, &int_value)) { | 112 if (!base::StringToInt(str_value, &int_value)) { |
113 LOG(ERROR) << "The value " << str_value << " of " | 113 LOG(ERROR) << "The value " << str_value << " of " |
114 << integer_switch_map_[i].switch_name | 114 << integer_switch_map_[i].switch_name |
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 SetValue(integer_switch_map_[i].preference_path, |
119 SetValue(integer_switch_map_[i].preference_path, value); | 119 new base::FundamentalValue(int_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 SetValue(boolean_switch_map_[i].preference_path, | 125 SetValue(boolean_switch_map_[i].preference_path, |
126 new base::FundamentalValue(boolean_switch_map_[i].set_value)); | 126 new base::FundamentalValue(boolean_switch_map_[i].set_value)); |
127 } | 127 } |
128 } | 128 } |
129 } | 129 } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 list_value->Append(new base::StringValue(*it)); | 163 list_value->Append(new base::StringValue(*it)); |
164 } | 164 } |
165 SetValue(prefs::kCipherSuiteBlacklist, list_value); | 165 SetValue(prefs::kCipherSuiteBlacklist, list_value); |
166 } | 166 } |
167 } | 167 } |
168 | 168 |
169 void CommandLinePrefStore::ApplyBackgroundModeSwitches() { | 169 void CommandLinePrefStore::ApplyBackgroundModeSwitches() { |
170 if (command_line_->HasSwitch(switches::kDisableExtensions)) | 170 if (command_line_->HasSwitch(switches::kDisableExtensions)) |
171 SetValue(prefs::kBackgroundModeEnabled, new base::FundamentalValue(false)); | 171 SetValue(prefs::kBackgroundModeEnabled, new base::FundamentalValue(false)); |
172 } | 172 } |
OLD | NEW |