diff options
author | isherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-28 02:55:19 +0000 |
---|---|---|
committer | isherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-28 02:55:19 +0000 |
commit | cc97e48a8bfc2fdb5c3c2c8dc7204b33ff86b56d (patch) | |
tree | 2716a67db68f6004009effb120a592e774c9c683 /chrome/browser/autofill/autofill_manager.h | |
parent | f39d61d9d80c536dcb4bb74915c20058bae0fd3d (diff) | |
download | chromium_src-cc97e48a8bfc2fdb5c3c2c8dc7204b33ff86b56d.zip chromium_src-cc97e48a8bfc2fdb5c3c2c8dc7204b33ff86b56d.tar.gz chromium_src-cc97e48a8bfc2fdb5c3c2c8dc7204b33ff86b56d.tar.bz2 |
Reduce visibility of methods in AutofillManager and AutofillDownload.
Also remove some obsolete code and simplify some of the code's expectations.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/8351027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107680 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill/autofill_manager.h')
-rw-r--r-- | chrome/browser/autofill/autofill_manager.h | 59 |
1 files changed, 26 insertions, 33 deletions
diff --git a/chrome/browser/autofill/autofill_manager.h b/chrome/browser/autofill/autofill_manager.h index 80c4ce0..e4fd014 100644 --- a/chrome/browser/autofill/autofill_manager.h +++ b/chrome/browser/autofill/autofill_manager.h @@ -54,51 +54,26 @@ class AutofillManager : public TabContentsObserver, // Registers our Enable/Disable Autofill pref. static void RegisterUserPrefs(PrefService* prefs); - // TabContentsObserver implementation. - virtual void DidNavigateMainFramePostCommit( - const content::LoadCommittedDetails& details, - const ViewHostMsg_FrameNavigate_Params& params); - virtual bool OnMessageReceived(const IPC::Message& message); - - // AutofillDownloadManager::Observer implementation: - virtual void OnLoadedServerPredictions(const std::string& response_xml); - virtual void OnUploadedPossibleFieldTypes(); - virtual void OnServerRequestError( - const std::string& form_signature, - AutofillDownloadManager::AutofillRequestType request_type, - int http_error); - - // Returns the value of the AutofillEnabled pref. - virtual bool IsAutofillEnabled() const; - - // Imports the form data, submitted by the user, into |personal_data_|. - void ImportFormData(const FormStructure& submitted_form); - - // Uploads the form data to the Autofill server. - virtual void UploadFormData(const FormStructure& submitted_form); - - // Reset cache. - void Reset(); - protected: - // For tests: + // Only test code should subclass AutofillManager. // The string/int pair is composed of the guid string and variant index // respectively. The variant index is an index into the multi-valued item // (where applicable). typedef std::pair<std::string, size_t> GUIDPair; + // Test code should prefer to use this constructor. AutofillManager(TabContentsWrapper* tab_contents, PersonalDataManager* personal_data); - void set_personal_data_manager(PersonalDataManager* personal_data) { - personal_data_ = personal_data; - } + // Returns the value of the AutofillEnabled pref. + virtual bool IsAutofillEnabled() const; - const AutofillMetrics* metric_logger() const { return metric_logger_.get(); } - void set_metric_logger(const AutofillMetrics* metric_logger); + // Uploads the form data to the Autofill server. + virtual void UploadFormData(const FormStructure& submitted_form); - ScopedVector<FormStructure>* form_structures() { return &form_structures_; } + // Reset cache. + void Reset(); // Maps GUIDs to and from IDs that are used to identify profiles and credit // cards sent to and from the renderer process. @@ -110,7 +85,22 @@ class AutofillManager : public TabContentsObserver, int PackGUIDs(const GUIDPair& cc_guid, const GUIDPair& profile_guid) const; void UnpackGUIDs(int id, GUIDPair* cc_guid, GUIDPair* profile_guid) const; + const AutofillMetrics* metric_logger() const { return metric_logger_.get(); } + void set_metric_logger(const AutofillMetrics* metric_logger); + + ScopedVector<FormStructure>* form_structures() { return &form_structures_; } + private: + // TabContentsObserver: + virtual void DidNavigateMainFramePostCommit( + const content::LoadCommittedDetails& details, + const ViewHostMsg_FrameNavigate_Params& params) OVERRIDE; + virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; + + // AutofillDownloadManager::Observer: + virtual void OnLoadedServerPredictions( + const std::string& response_xml) OVERRIDE; + void OnFormSubmitted(const webkit_glue::FormData& form, const base::TimeTicks& timestamp); void OnFormsSeen(const std::vector<webkit_glue::FormData>& forms, @@ -217,6 +207,9 @@ class AutofillManager : public TabContentsObserver, // |submitted_form|. void DeterminePossibleFieldTypesForUpload(FormStructure* submitted_form); + // Imports the form data, submitted by the user, into |personal_data_|. + void ImportFormData(const FormStructure& submitted_form); + // If |initial_interaction_timestamp_| is unset or is set to a later time than // |interaction_timestamp|, updates the cached timestamp. The latter check is // needed because IPC messages can arrive out of order. |