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 "content/browser/geolocation/network_location_request.h" | 5 #include "content/browser/geolocation/network_location_request.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 ++iter) { | 255 ++iter) { |
256 access_points_by_signal_strength.insert(&(*iter)); | 256 access_points_by_signal_strength.insert(&(*iter)); |
257 } | 257 } |
258 | 258 |
259 base::ListValue* wifi_access_point_list = new base::ListValue(); | 259 base::ListValue* wifi_access_point_list = new base::ListValue(); |
260 for (AccessPointSet::iterator iter = | 260 for (AccessPointSet::iterator iter = |
261 access_points_by_signal_strength.begin(); | 261 access_points_by_signal_strength.begin(); |
262 iter != access_points_by_signal_strength.end(); | 262 iter != access_points_by_signal_strength.end(); |
263 ++iter) { | 263 ++iter) { |
264 base::DictionaryValue* wifi_dict = new base::DictionaryValue(); | 264 base::DictionaryValue* wifi_dict = new base::DictionaryValue(); |
265 AddString("macAddress", UTF16ToUTF8((*iter)->mac_address), wifi_dict); | 265 AddString("macAddress", base::UTF16ToUTF8((*iter)->mac_address), wifi_dict); |
266 AddInteger("signalStrength", (*iter)->radio_signal_strength, wifi_dict); | 266 AddInteger("signalStrength", (*iter)->radio_signal_strength, wifi_dict); |
267 AddInteger("age", age_milliseconds, wifi_dict); | 267 AddInteger("age", age_milliseconds, wifi_dict); |
268 AddInteger("channel", (*iter)->channel, wifi_dict); | 268 AddInteger("channel", (*iter)->channel, wifi_dict); |
269 AddInteger("signalToNoiseRatio", (*iter)->signal_to_noise, wifi_dict); | 269 AddInteger("signalToNoiseRatio", (*iter)->signal_to_noise, wifi_dict); |
270 wifi_access_point_list->Append(wifi_dict); | 270 wifi_access_point_list->Append(wifi_dict); |
271 } | 271 } |
272 request->Set("wifiAccessPoints", wifi_access_point_list); | 272 request->Set("wifiAccessPoints", wifi_access_point_list); |
273 } | 273 } |
274 | 274 |
275 void FormatPositionError(const GURL& server_url, | 275 void FormatPositionError(const GURL& server_url, |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 | 422 |
423 // Other fields are optional. | 423 // Other fields are optional. |
424 GetAsDouble(*response_object, kAccuracyString, &position->accuracy); | 424 GetAsDouble(*response_object, kAccuracyString, &position->accuracy); |
425 | 425 |
426 return true; | 426 return true; |
427 } | 427 } |
428 | 428 |
429 } // namespace | 429 } // namespace |
430 | 430 |
431 } // namespace content | 431 } // namespace content |
OLD | NEW |