Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9668)

Unified Diff: chrome/browser/autofill/autofill_download.cc

Issue 6931029: Set datapresent string to contain precisely those field types available in stored Autofill data. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Signed and delivered Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/autofill/autofill_download.h ('k') | chrome/browser/autofill/autofill_download_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/autofill_download.cc
diff --git a/chrome/browser/autofill/autofill_download.cc b/chrome/browser/autofill/autofill_download.cc
index a8ce10e3a590cfc7b137c6fa31e89cdb062e4f0a..c481fe30e9d25d39b081b7460fde30043324fb29 100644
--- a/chrome/browser/autofill/autofill_download.cc
+++ b/chrome/browser/autofill/autofill_download.cc
@@ -101,22 +101,27 @@ bool AutofillDownloadManager::StartQueryRequest(
}
bool AutofillDownloadManager::StartUploadRequest(
- const FormStructure& form, bool form_was_matched) {
+ const FormStructure& form,
+ bool form_was_autofilled,
+ const FieldTypeSet& available_field_types) {
if (next_upload_request_ > base::Time::Now()) {
// We are in back-off mode: do not do the request.
+ VLOG(1) << "AutofillDownloadManager: Upload request is throttled.";
return false;
}
- // Check if we need to upload form.
- double upload_rate = form_was_matched ? GetPositiveUploadRate() :
- GetNegativeUploadRate();
+ // Flip a coin to see if we should upload this form.
+ double upload_rate = form_was_autofilled ? GetPositiveUploadRate() :
+ GetNegativeUploadRate();
if (base::RandDouble() > upload_rate) {
- VLOG(1) << "AutofillDownloadManager: Upload request is ignored";
+ VLOG(1) << "AutofillDownloadManager: Upload request is ignored.";
// If we ever need notification that upload was skipped, add it here.
return false;
}
+
std::string form_xml;
- if (!form.EncodeUploadRequest(form_was_matched, &form_xml))
+ if (!form.EncodeUploadRequest(available_field_types, form_was_autofilled,
+ &form_xml))
return false;
FormRequestData request_data;
« no previous file with comments | « chrome/browser/autofill/autofill_download.h ('k') | chrome/browser/autofill/autofill_download_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698