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

Side by Side Diff: chrome/browser/geolocation/network_location_request.cc

Issue 3033050: Rename DictionaryValue's SetStringFromUTF16() to SetString() (and overload). (Closed)
Patch Set: There shouldn't be wstrings in platform-ind. code. Created 10 years, 4 months 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
« no previous file with comments | « chrome/browser/extensions/extension_history_api.cc ('k') | chrome/browser/plugin_updater.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/geolocation/network_location_request.h" 5 #include "chrome/browser/geolocation/network_location_request.h"
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 LOG(DFATAL) << "Bad RadioType"; 237 LOG(DFATAL) << "Bad RadioType";
238 } 238 }
239 return "unknown"; 239 return "unknown";
240 } 240 }
241 241
242 void AddString(const std::wstring& property_name, 242 void AddString(const std::wstring& property_name,
243 const string16& value, 243 const string16& value,
244 DictionaryValue* object) { 244 DictionaryValue* object) {
245 DCHECK(object); 245 DCHECK(object);
246 if (!value.empty()) { 246 if (!value.empty()) {
247 object->SetStringFromUTF16(property_name, value); 247 object->SetString(property_name, value);
248 } 248 }
249 } 249 }
250 250
251 void AddInteger(const std::wstring& property_name, 251 void AddInteger(const std::wstring& property_name,
252 int value, 252 int value,
253 DictionaryValue* object) { 253 DictionaryValue* object) {
254 DCHECK(object); 254 DCHECK(object);
255 if (kint32min != value) { 255 if (kint32min != value) {
256 object->SetInteger(property_name, value); 256 object->SetInteger(property_name, value);
257 } 257 }
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 AddInteger(L"signal_strength", iter->radio_signal_strength, wifi_tower); 415 AddInteger(L"signal_strength", iter->radio_signal_strength, wifi_tower);
416 AddInteger(L"age", age_milliseconds, wifi_tower); 416 AddInteger(L"age", age_milliseconds, wifi_tower);
417 AddInteger(L"channel", iter->channel, wifi_tower); 417 AddInteger(L"channel", iter->channel, wifi_tower);
418 AddInteger(L"signal_to_noise", iter->signal_to_noise, wifi_tower); 418 AddInteger(L"signal_to_noise", iter->signal_to_noise, wifi_tower);
419 AddString(L"ssid", iter->ssid, wifi_tower); 419 AddString(L"ssid", iter->ssid, wifi_tower);
420 wifi_towers->Append(wifi_tower); 420 wifi_towers->Append(wifi_tower);
421 } 421 }
422 body_object->Set(L"wifi_towers", wifi_towers); 422 body_object->Set(L"wifi_towers", wifi_towers);
423 } 423 }
424 } // namespace 424 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_history_api.cc ('k') | chrome/browser/plugin_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698