| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/autofill/autofill_download.h" | 5 #include "chrome/browser/autofill/autofill_download.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <ostream> | 8 #include <ostream> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 DCHECK_LE(rate, 1.0); | 179 DCHECK_LE(rate, 1.0); |
| 180 DCHECK(profile_); | 180 DCHECK(profile_); |
| 181 PrefService* preferences = profile_->GetPrefs(); | 181 PrefService* preferences = profile_->GetPrefs(); |
| 182 preferences->SetDouble(prefs::kAutofillNegativeUploadRate, rate); | 182 preferences->SetDouble(prefs::kAutofillNegativeUploadRate, rate); |
| 183 } | 183 } |
| 184 | 184 |
| 185 bool AutofillDownloadManager::StartRequest( | 185 bool AutofillDownloadManager::StartRequest( |
| 186 const std::string& form_xml, | 186 const std::string& form_xml, |
| 187 const FormRequestData& request_data) { | 187 const FormRequestData& request_data) { |
| 188 net::URLRequestContextGetter* request_context = | 188 net::URLRequestContextGetter* request_context = |
| 189 Profile::GetDefaultRequestContext(); | 189 Profile::Deprecated::GetDefaultRequestContext(); |
| 190 // Check if default request context is NULL: this very rarely happens, | 190 // Check if default request context is NULL: this very rarely happens, |
| 191 // I think, this could happen only if user opens chrome with some pages | 191 // I think, this could happen only if user opens chrome with some pages |
| 192 // loading the forms immediately; I cannot reproduce this even in that | 192 // loading the forms immediately; I cannot reproduce this even in that |
| 193 // scenario, but bug 74492 shows it happened at least once. In that case bail | 193 // scenario, but bug 74492 shows it happened at least once. In that case bail |
| 194 // out and fall back on our own heuristics. | 194 // out and fall back on our own heuristics. |
| 195 if (!request_context) | 195 if (!request_context) |
| 196 return false; | 196 return false; |
| 197 std::string request_url; | 197 std::string request_url; |
| 198 if (request_data.request_type == AutofillDownloadManager::REQUEST_QUERY) | 198 if (request_data.request_type == AutofillDownloadManager::REQUEST_QUERY) |
| 199 request_url = kAutofillQueryServerRequestUrl; | 199 request_url = kAutofillQueryServerRequestUrl; |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 SetNegativeUploadRate(new_negative_upload_rate); | 345 SetNegativeUploadRate(new_negative_upload_rate); |
| 346 } | 346 } |
| 347 | 347 |
| 348 if (observer_) | 348 if (observer_) |
| 349 observer_->OnUploadedPossibleFieldTypes(); | 349 observer_->OnUploadedPossibleFieldTypes(); |
| 350 } | 350 } |
| 351 } | 351 } |
| 352 delete it->first; | 352 delete it->first; |
| 353 url_fetchers_.erase(it); | 353 url_fetchers_.erase(it); |
| 354 } | 354 } |
| OLD | NEW |