Index: chrome/browser/autofill/autofill_manager.h |
diff --git a/chrome/browser/autofill/autofill_manager.h b/chrome/browser/autofill/autofill_manager.h |
index 791d171f8ff799672349dc59381ae7978b2a03bb..61ed52b30019729fd19f2d16f4d3d9a54e910b1f 100644 |
--- a/chrome/browser/autofill/autofill_manager.h |
+++ b/chrome/browser/autofill/autofill_manager.h |
@@ -20,6 +20,8 @@ |
class AutoFillCCInfoBarDelegate; |
class AutoFillProfile; |
+class AutoFillServerQueryMetricLogger; |
+class AutoFillQualityMetricLogger; |
class CreditCard; |
class FormStructure; |
class PrefService; |
@@ -76,10 +78,6 @@ class AutoFillManager : public RenderViewHostDelegate::AutoFill, |
// Returns the value of the AutoFillEnabled pref. |
virtual bool IsAutoFillEnabled() const; |
- // Uses heuristics and existing personal data to determine the possible field |
- // types. |
- void DeterminePossibleFieldTypes(FormStructure* form_structure); |
- |
// Handles the form data submitted by the user. |
void HandleSubmit(); |
@@ -96,6 +94,18 @@ class AutoFillManager : public RenderViewHostDelegate::AutoFill, |
personal_data_ = personal_data; |
} |
+ const AutoFillServerQueryMetricLogger* server_query_metric_logger() const { |
+ return server_query_metric_logger_.get(); |
+ } |
+ void set_server_query_metric_logger( |
+ const AutoFillServerQueryMetricLogger* server_query_metric_logger); |
+ |
+ const AutoFillQualityMetricLogger* quality_metric_logger() const { |
+ return quality_metric_logger_.get(); |
+ } |
+ void set_quality_metric_logger( |
+ const AutoFillQualityMetricLogger* quality_metric_logger); |
+ |
// Maps GUIDs to and from IDs that are used to identify profiles and credit |
// cards sent to and from the renderer process. |
virtual int GUIDToID(const std::string& guid); |
@@ -162,10 +172,9 @@ class AutoFillManager : public RenderViewHostDelegate::AutoFill, |
// Parses the forms using heuristic matching and querying the AutoFill server. |
void ParseForms(const std::vector<webkit_glue::FormData>& forms); |
- // The following function is meant to be called from unit-test only. |
- void set_disable_download_manager_requests(bool value) { |
- disable_download_manager_requests_ = value; |
- } |
+ // Uses existing personal data to determine possible field types for the |
+ // |upload_form_structure_|. |
+ void DeterminePossibleFieldTypesForUpload(); |
// The TabContents hosting this AutoFillManager. |
// Weak reference. |
@@ -184,9 +193,14 @@ class AutoFillManager : public RenderViewHostDelegate::AutoFill, |
// Should be set to true in AutoFillManagerTest and other tests, false in |
// AutoFillDownloadManagerTest and in non-test environment. Is false by |
- // default. |
+ // default for the public constructor, and true by default for the test-only |
+ // constructors. |
bool disable_download_manager_requests_; |
+ // For logging UMA metrics. Overridden by metrics tests. |
+ scoped_ptr<const AutoFillServerQueryMetricLogger> server_query_metric_logger_; |
+ scoped_ptr<const AutoFillQualityMetricLogger> quality_metric_logger_; |
+ |
// Our copy of the form data. |
ScopedVector<FormStructure> form_structures_; |
@@ -202,7 +216,6 @@ class AutoFillManager : public RenderViewHostDelegate::AutoFill, |
std::map<int, std::string> id_guid_map_; |
friend class FormStructureBrowserTest; |
- friend class TestAutoFillManager; |
FRIEND_TEST_ALL_PREFIXES(AutoFillManagerTest, FillCreditCardForm); |
FRIEND_TEST_ALL_PREFIXES(AutoFillManagerTest, FillAddressForm); |
FRIEND_TEST_ALL_PREFIXES(AutoFillManagerTest, FillAddressAndCreditCardForm); |