summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autofill/autofill_download.h
diff options
context:
space:
mode:
authorisherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-15 07:00:36 +0000
committerisherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-15 07:00:36 +0000
commit76b6d1d53ed9d8e6392b914f7759a5f80daaa9d5 (patch)
tree1858a65bdbfddba9a4a83135899d312fcaf06869 /chrome/browser/autofill/autofill_download.h
parentdc7b094a338c6c521f918f478e993f0f74bbea0d (diff)
downloadchromium_src-76b6d1d53ed9d8e6392b914f7759a5f80daaa9d5.zip
chromium_src-76b6d1d53ed9d8e6392b914f7759a5f80daaa9d5.tar.gz
chromium_src-76b6d1d53ed9d8e6392b914f7759a5f80daaa9d5.tar.bz2
Clean up AutofillDownloadManager; don't use "heuristics" to refer to non-client predictions.
BUG=none TEST=none Review URL: http://codereview.chromium.org/7173002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89143 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill/autofill_download.h')
-rw-r--r--chrome/browser/autofill/autofill_download.h42
1 files changed, 19 insertions, 23 deletions
diff --git a/chrome/browser/autofill/autofill_download.h b/chrome/browser/autofill/autofill_download.h
index f25dc09..fdb18b5 100644
--- a/chrome/browser/autofill/autofill_download.h
+++ b/chrome/browser/autofill/autofill_download.h
@@ -13,6 +13,7 @@
#include <utility>
#include <vector>
+#include "base/gtest_prod_util.h"
#include "base/memory/scoped_vector.h"
#include "base/time.h"
#include "chrome/browser/autofill/autofill_type.h"
@@ -39,22 +40,20 @@ class AutofillDownloadManager : public URLFetcher::Delegate {
// Notifications are *not* guaranteed to be called.
class Observer {
public:
- // Called when field types are successfully received from the server.
- // |heuristic_xml| - server response.
- virtual void OnLoadedAutofillHeuristics(
- const std::string& heuristic_xml) = 0;
+ // Called when field type predictions are successfully received from the
+ // server.
+ // |response_xml| - server response.
+ virtual void OnLoadedServerPredictions(const std::string& response_xml) = 0;
// Called when heuristic either successfully considered for upload and
// not send or uploaded.
- // |form_signature| - the signature of the requesting form.
- virtual void OnUploadedAutofillHeuristics(
- const std::string& form_signature) = 0;
+ virtual void OnUploadedPossibleFieldTypes() = 0;
// Called when there was an error during the request.
// |form_signature| - the signature of the requesting form.
// |request_type| - type of request that failed.
// |http_error| - HTTP error code.
- virtual void OnHeuristicsRequestError(const std::string& form_signature,
- AutofillRequestType request_type,
- int http_error) = 0;
+ virtual void OnServerRequestError(const std::string& form_signature,
+ AutofillRequestType request_type,
+ int http_error) = 0;
protected:
virtual ~Observer() {}
};
@@ -64,7 +63,7 @@ class AutofillDownloadManager : public URLFetcher::Delegate {
virtual ~AutofillDownloadManager();
// |observer| - observer to notify on successful completion or error.
- void SetObserver(AutofillDownloadManager::Observer *observer);
+ void SetObserver(AutofillDownloadManager::Observer* observer);
// Starts a query request to Autofill servers. The observer is called with the
// list of the fields of all requested forms.
@@ -91,20 +90,9 @@ class AutofillDownloadManager : public URLFetcher::Delegate {
bool CancelRequest(const std::string& form_signature,
AutofillRequestType request_type);
- // Probability of the form upload. Between 0 (no upload) and 1 (upload all).
- // GetPositiveUploadRate() is for matched forms,
- // GetNegativeUploadRate() for non matched.
- double GetPositiveUploadRate() const;
- double GetNegativeUploadRate() const;
- // These functions called very rarely outside of the unit-tests. With current
- // percentages, they would be called once per 100 auto-fillable forms filled
- // and submitted by user. The order of magnitude would remain similar in the
- // future.
- void SetPositiveUploadRate(double rate);
- void SetNegativeUploadRate(double rate);
-
private:
friend class AutofillDownloadTestHelper; // unit-test.
+ FRIEND_TEST_ALL_PREFIXES(AutofillDownloadTest, QueryAndUploadTest);
struct FormRequestData;
typedef std::list<std::pair<std::string, std::string> > QueryRequestCache;
@@ -145,6 +133,14 @@ class AutofillDownloadManager : public URLFetcher::Delegate {
const net::ResponseCookies& cookies,
const std::string& data);
+ // Probability of the form upload. Between 0 (no upload) and 1 (upload all).
+ // GetPositiveUploadRate() is for matched forms,
+ // GetNegativeUploadRate() for non-matched.
+ double GetPositiveUploadRate() const;
+ double GetNegativeUploadRate() const;
+ void SetPositiveUploadRate(double rate);
+ void SetNegativeUploadRate(double rate);
+
// Profile for preference storage.
Profile* profile_;