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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 url_fetcher_->SetLoadFlags( | 93 url_fetcher_->SetLoadFlags( |
94 net::LOAD_BYPASS_CACHE | net::LOAD_DISABLE_CACHE | | 94 net::LOAD_BYPASS_CACHE | net::LOAD_DISABLE_CACHE | |
95 net::LOAD_DO_NOT_SAVE_COOKIES | net::LOAD_DO_NOT_SEND_COOKIES | | 95 net::LOAD_DO_NOT_SAVE_COOKIES | net::LOAD_DO_NOT_SEND_COOKIES | |
96 net::LOAD_DO_NOT_SEND_AUTH_DATA); | 96 net::LOAD_DO_NOT_SEND_AUTH_DATA); |
97 | 97 |
98 url_fetcher_->Start(); | 98 url_fetcher_->Start(); |
99 return true; | 99 return true; |
100 } | 100 } |
101 | 101 |
102 void NetworkLocationRequest::OnURLFetchComplete( | 102 void NetworkLocationRequest::OnURLFetchComplete( |
103 const content::URLFetcher* source) { | 103 const net::URLFetcher* source) { |
104 DCHECK_EQ(url_fetcher_.get(), source); | 104 DCHECK_EQ(url_fetcher_.get(), source); |
105 | 105 |
106 net::URLRequestStatus status = source->GetStatus(); | 106 net::URLRequestStatus status = source->GetStatus(); |
107 int response_code = source->GetResponseCode(); | 107 int response_code = source->GetResponseCode(); |
108 | 108 |
109 content::Geoposition position; | 109 content::Geoposition position; |
110 string16 access_token; | 110 string16 access_token; |
111 std::string data; | 111 std::string data; |
112 source->GetResponseAsString(&data); | 112 source->GetResponseAsString(&data); |
113 GetLocationFromResponse(status.is_success(), | 113 GetLocationFromResponse(status.is_success(), |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 position->longitude = longitude; | 408 position->longitude = longitude; |
409 position->timestamp = timestamp; | 409 position->timestamp = timestamp; |
410 | 410 |
411 // Other fields are optional. | 411 // Other fields are optional. |
412 GetAsDouble(*response_object, kAccuracyString, &position->accuracy); | 412 GetAsDouble(*response_object, kAccuracyString, &position->accuracy); |
413 | 413 |
414 return true; | 414 return true; |
415 } | 415 } |
416 | 416 |
417 } // namespace | 417 } // namespace |
OLD | NEW |