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 "device/geolocation/network_location_request.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 #include <set> | 10 #include <set> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/json/json_reader.h" | 13 #include "base/json/json_reader.h" |
14 #include "base/json/json_writer.h" | 14 #include "base/json/json_writer.h" |
15 #include "base/metrics/histogram.h" | 15 #include "base/metrics/histogram.h" |
16 #include "base/metrics/sparse_histogram.h" | 16 #include "base/metrics/sparse_histogram.h" |
17 #include "base/strings/string_number_conversions.h" | 17 #include "base/strings/string_number_conversions.h" |
18 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
19 #include "base/values.h" | 19 #include "base/values.h" |
20 #include "content/browser/geolocation/location_arbitrator_impl.h" | 20 #include "device/geolocation/geoposition.h" |
21 #include "content/public/common/geoposition.h" | 21 #include "device/geolocation/location_arbitrator_impl.h" |
22 #include "google_apis/google_api_keys.h" | 22 #include "google_apis/google_api_keys.h" |
23 #include "net/base/escape.h" | 23 #include "net/base/escape.h" |
24 #include "net/base/load_flags.h" | 24 #include "net/base/load_flags.h" |
25 #include "net/url_request/url_fetcher.h" | 25 #include "net/url_request/url_fetcher.h" |
26 #include "net/url_request/url_request_context_getter.h" | 26 #include "net/url_request/url_request_context_getter.h" |
27 #include "net/url_request/url_request_status.h" | 27 #include "net/url_request/url_request_status.h" |
28 | 28 |
29 namespace content { | 29 namespace device { |
30 namespace { | 30 namespace { |
31 | 31 |
32 const char kAccessTokenString[] = "accessToken"; | 32 const char kAccessTokenString[] = "accessToken"; |
33 const char kLocationString[] = "location"; | 33 const char kLocationString[] = "location"; |
34 const char kLatitudeString[] = "lat"; | 34 const char kLatitudeString[] = "lat"; |
35 const char kLongitudeString[] = "lng"; | 35 const char kLongitudeString[] = "lng"; |
36 const char kAccuracyString[] = "accuracy"; | 36 const char kAccuracyString[] = "accuracy"; |
37 | 37 |
38 enum NetworkLocationRequestEvent { | 38 enum NetworkLocationRequestEvent { |
39 // NOTE: Do not renumber these as that would confuse interpretation of | 39 // NOTE: Do not renumber these as that would confuse interpretation of |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 position->timestamp = wifi_timestamp; | 417 position->timestamp = wifi_timestamp; |
418 | 418 |
419 // Other fields are optional. | 419 // Other fields are optional. |
420 GetAsDouble(*response_object, kAccuracyString, &position->accuracy); | 420 GetAsDouble(*response_object, kAccuracyString, &position->accuracy); |
421 | 421 |
422 return true; | 422 return true; |
423 } | 423 } |
424 | 424 |
425 } // namespace | 425 } // namespace |
426 | 426 |
427 } // namespace content | 427 } // namespace device |
OLD | NEW |