OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |