| 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 | 9 |
| 9 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| 10 #include "base/json/json_writer.h" | 11 #include "base/json/json_writer.h" |
| 11 #include "base/string_number_conversions.h" | 12 #include "base/string_number_conversions.h" |
| 12 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
| 13 #include "base/values.h" | 14 #include "base/values.h" |
| 14 #include "content/common/geoposition.h" | 15 #include "content/common/geoposition.h" |
| 15 #include "content/common/net/url_fetcher_impl.h" | 16 #include "content/common/net/url_fetcher_impl.h" |
| 16 #include "net/base/escape.h" | 17 #include "net/base/escape.h" |
| 17 #include "net/base/load_flags.h" | 18 #include "net/base/load_flags.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 const GURL& url, | 66 const GURL& url, |
| 66 ListenerInterface* listener) | 67 ListenerInterface* listener) |
| 67 : url_context_(context), listener_(listener), | 68 : url_context_(context), listener_(listener), |
| 68 url_(url) { | 69 url_(url) { |
| 69 DCHECK(listener); | 70 DCHECK(listener); |
| 70 } | 71 } |
| 71 | 72 |
| 72 NetworkLocationRequest::~NetworkLocationRequest() { | 73 NetworkLocationRequest::~NetworkLocationRequest() { |
| 73 } | 74 } |
| 74 | 75 |
| 75 bool NetworkLocationRequest::MakeRequest(const std::string& host_name, | 76 bool NetworkLocationRequest::MakeRequest(const string16& access_token, |
| 76 const string16& access_token, | |
| 77 const RadioData& radio_data, | 77 const RadioData& radio_data, |
| 78 const WifiData& wifi_data, | 78 const WifiData& wifi_data, |
| 79 const base::Time& timestamp) { | 79 const base::Time& timestamp) { |
| 80 if (url_fetcher_ != NULL) { | 80 if (url_fetcher_ != NULL) { |
| 81 DVLOG(1) << "NetworkLocationRequest : Cancelling pending request"; | 81 DVLOG(1) << "NetworkLocationRequest : Cancelling pending request"; |
| 82 url_fetcher_.reset(); | 82 url_fetcher_.reset(); |
| 83 } | 83 } |
| 84 radio_data_ = radio_data; | 84 radio_data_ = radio_data; |
| 85 wifi_data_ = wifi_data; | 85 wifi_data_ = wifi_data; |
| 86 timestamp_ = timestamp; | 86 timestamp_ = timestamp; |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 position->longitude = longitude; | 406 position->longitude = longitude; |
| 407 position->timestamp = timestamp; | 407 position->timestamp = timestamp; |
| 408 | 408 |
| 409 // Other fields are optional. | 409 // Other fields are optional. |
| 410 GetAsDouble(*response_object, kAccuracyString, &position->accuracy); | 410 GetAsDouble(*response_object, kAccuracyString, &position->accuracy); |
| 411 | 411 |
| 412 return true; | 412 return true; |
| 413 } | 413 } |
| 414 | 414 |
| 415 } // namespace | 415 } // namespace |
| OLD | NEW |