Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: chrome/browser/prefs/command_line_pref_store.cc

Issue 104493005: Update some uses of Value in chrome/browser to use the base:: namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 << switches::kNoProxyServer << " was also specified."; 104 << switches::kNoProxyServer << " was also specified.";
105 return false; 105 return false;
106 } 106 }
107 return true; 107 return true;
108 } 108 }
109 109
110 void CommandLinePrefStore::ApplySimpleSwitches() { 110 void CommandLinePrefStore::ApplySimpleSwitches() {
111 // Look for each switch we know about and set its preference accordingly. 111 // Look for each switch we know about and set its preference accordingly.
112 for (size_t i = 0; i < arraysize(string_switch_map_); ++i) { 112 for (size_t i = 0; i < arraysize(string_switch_map_); ++i) {
113 if (command_line_->HasSwitch(string_switch_map_[i].switch_name)) { 113 if (command_line_->HasSwitch(string_switch_map_[i].switch_name)) {
114 Value* value = Value::CreateStringValue(command_line_-> 114 base::Value* value = base::Value::CreateStringValue(command_line_->
115 GetSwitchValueASCII(string_switch_map_[i].switch_name)); 115 GetSwitchValueASCII(string_switch_map_[i].switch_name));
116 SetValue(string_switch_map_[i].preference_path, value); 116 SetValue(string_switch_map_[i].preference_path, value);
117 } 117 }
118 } 118 }
119 119
120 for (size_t i = 0; i < arraysize(integer_switch_map_); ++i) { 120 for (size_t i = 0; i < arraysize(integer_switch_map_); ++i) {
121 if (command_line_->HasSwitch(integer_switch_map_[i].switch_name)) { 121 if (command_line_->HasSwitch(integer_switch_map_[i].switch_name)) {
122 std::string str_value = command_line_->GetSwitchValueASCII( 122 std::string str_value = command_line_->GetSwitchValueASCII(
123 integer_switch_map_[i].switch_name); 123 integer_switch_map_[i].switch_name);
124 int int_value = 0; 124 int int_value = 0;
125 if (!base::StringToInt(str_value, &int_value)) { 125 if (!base::StringToInt(str_value, &int_value)) {
126 LOG(ERROR) << "The value " << str_value << " of " 126 LOG(ERROR) << "The value " << str_value << " of "
127 << integer_switch_map_[i].switch_name 127 << integer_switch_map_[i].switch_name
128 << " can not be converted to integer, ignoring!"; 128 << " can not be converted to integer, ignoring!";
129 continue; 129 continue;
130 } 130 }
131 Value* value = Value::CreateIntegerValue(int_value); 131 base::Value* value = base::Value::CreateIntegerValue(int_value);
132 SetValue(integer_switch_map_[i].preference_path, value); 132 SetValue(integer_switch_map_[i].preference_path, value);
133 } 133 }
134 } 134 }
135 135
136 for (size_t i = 0; i < arraysize(boolean_switch_map_); ++i) { 136 for (size_t i = 0; i < arraysize(boolean_switch_map_); ++i) {
137 if (command_line_->HasSwitch(boolean_switch_map_[i].switch_name)) { 137 if (command_line_->HasSwitch(boolean_switch_map_[i].switch_name)) {
138 Value* value = Value::CreateBooleanValue( 138 base::Value* value = base::Value::CreateBooleanValue(
139 boolean_switch_map_[i].set_value); 139 boolean_switch_map_[i].set_value);
140 SetValue(boolean_switch_map_[i].preference_path, value); 140 SetValue(boolean_switch_map_[i].preference_path, value);
141 } 141 }
142 } 142 }
143 } 143 }
144 144
145 void CommandLinePrefStore::ApplyProxyMode() { 145 void CommandLinePrefStore::ApplyProxyMode() {
146 if (command_line_->HasSwitch(switches::kNoProxyServer)) { 146 if (command_line_->HasSwitch(switches::kNoProxyServer)) {
147 SetValue(prefs::kProxy, 147 SetValue(prefs::kProxy,
148 ProxyConfigDictionary::CreateDirect()); 148 ProxyConfigDictionary::CreateDirect());
(...skipping 27 matching lines...) Expand all
176 it != cipher_strings.end(); ++it) { 176 it != cipher_strings.end(); ++it) {
177 list_value->Append(base::Value::CreateStringValue(*it)); 177 list_value->Append(base::Value::CreateStringValue(*it));
178 } 178 }
179 SetValue(prefs::kCipherSuiteBlacklist, list_value); 179 SetValue(prefs::kCipherSuiteBlacklist, list_value);
180 } 180 }
181 } 181 }
182 182
183 void CommandLinePrefStore::ApplyBackgroundModeSwitches() { 183 void CommandLinePrefStore::ApplyBackgroundModeSwitches() {
184 if (command_line_->HasSwitch(switches::kDisableBackgroundMode) || 184 if (command_line_->HasSwitch(switches::kDisableBackgroundMode) ||
185 command_line_->HasSwitch(switches::kDisableExtensions)) { 185 command_line_->HasSwitch(switches::kDisableExtensions)) {
186 Value* value = Value::CreateBooleanValue(false); 186 base::Value* value = base::Value::CreateBooleanValue(false);
187 SetValue(prefs::kBackgroundModeEnabled, value); 187 SetValue(prefs::kBackgroundModeEnabled, value);
188 } 188 }
189 } 189 }
OLDNEW
« no previous file with comments | « chrome/browser/prefs/chrome_pref_service_unittest.cc ('k') | chrome/browser/prefs/command_line_pref_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698