diff options
author | isherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-02 23:52:39 +0000 |
---|---|---|
committer | isherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-02 23:52:39 +0000 |
commit | 80742f2ffeb9e90cd85cbee27acb9f924ffebd16 (patch) | |
tree | 42db07c98e10243ef214946d75554b4fa27e09b2 /chrome/browser/autofill/autofill_download.cc | |
parent | 9ca846258555296ddbd0c61277f9e602d1f5393f (diff) | |
download | chromium_src-80742f2ffeb9e90cd85cbee27acb9f924ffebd16.zip chromium_src-80742f2ffeb9e90cd85cbee27acb9f924ffebd16.tar.gz chromium_src-80742f2ffeb9e90cd85cbee27acb9f924ffebd16.tar.bz2 |
Add support for the "uploadrequired" attribute for Autofill query responses
BUG=84693
TEST=unit_tests --gtest_filter=AutofillDownloadTest.QueryAndUploadTest
Review URL: http://codereview.chromium.org/6969090
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87729 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill/autofill_download.cc')
-rw-r--r-- | chrome/browser/autofill/autofill_download.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/chrome/browser/autofill/autofill_download.cc b/chrome/browser/autofill/autofill_download.cc index 5d1699a..546379e5 100644 --- a/chrome/browser/autofill/autofill_download.cc +++ b/chrome/browser/autofill/autofill_download.cc @@ -113,7 +113,9 @@ bool AutofillDownloadManager::StartUploadRequest( // Flip a coin to see if we should upload this form. double upload_rate = form_was_autofilled ? GetPositiveUploadRate() : GetNegativeUploadRate(); - if (base::RandDouble() > upload_rate) { + if (form.upload_required() == UPLOAD_NOT_REQUIRED || + (form.upload_required() == USE_UPLOAD_RATES && + base::RandDouble() > upload_rate)) { VLOG(1) << "AutofillDownloadManager: Upload request is ignored."; // If we ever need notification that upload was skipped, add it here. return false; |