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

Unified Diff: chrome/browser/autofill/autofill_manager.h

Issue 8353025: External autofill delegates. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: feedback Created 9 years, 2 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
Index: chrome/browser/autofill/autofill_manager.h
diff --git a/chrome/browser/autofill/autofill_manager.h b/chrome/browser/autofill/autofill_manager.h
index 80c4ce0434aa040f3848d35e059d47887ff8012f..25532adfc4d3056747165d4c5bb534803c5b36fe 100644
--- a/chrome/browser/autofill/autofill_manager.h
+++ b/chrome/browser/autofill/autofill_manager.h
@@ -23,6 +23,7 @@
#include "chrome/browser/autofill/form_structure.h"
#include "content/browser/tab_contents/tab_contents_observer.h"
+class AutofillExternalDelegate;
class AutofillField;
class AutofillProfile;
class AutofillMetrics;
@@ -80,6 +81,11 @@ class AutofillManager : public TabContentsObserver,
// Reset cache.
void Reset();
+ // Set our external delegate.
+ void SetExternalDelegate(AutofillExternalDelegate* delegate) {
+ external_delegate_ = delegate;
+ }
Ilya Sherman 2011/10/27 11:01:55 nit: Can this be passed into the constructor rathe
John Grabowski 2011/10/27 17:42:21 One platform's likely implementation of the extern
Ilya Sherman 2011/10/27 21:17:24 Sure, let's add a TODO just to keep this in the ba
+
protected:
// For tests:
@@ -110,6 +116,17 @@ 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;
+ // Called from our external delegate so it cannot be private.
+ void OnFillAutoFillFormData(int query_id,
+ const webkit_glue::FormData& form,
+ const webkit_glue::FormField& field,
+ int unique_id);
+
+ // Exposed for testing.
+ AutofillExternalDelegate* external_delegate() {
+ return external_delegate_;
+ }
+
private:
void OnFormSubmitted(const webkit_glue::FormData& form,
const base::TimeTicks& timestamp);
@@ -275,6 +292,10 @@ class AutofillManager : public TabContentsObserver,
mutable std::map<GUIDPair, int> guid_id_map_;
mutable std::map<int, GUIDPair> id_guid_map_;
+ // Delegate to perform external processing (display, selection) on
+ // our behalf. Weak.
+ AutofillExternalDelegate* external_delegate_;
+
friend class AutofillManagerTest;
friend class FormStructureBrowserTest;
FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest,
@@ -289,6 +310,9 @@ class AutofillManager : public TabContentsObserver,
FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, QualityMetricsForFailure);
FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, QualityMetricsWithExperimentId);
FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, SaneMetricsWithCacheMismatch);
+ FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, TestExternalDelegate);
+ FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest,
+ TestTabContentsWithExternalDelegate);
FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest,
UserHappinessFormLoadAndSubmission);
FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, UserHappinessFormInteraction);

Powered by Google App Engine
This is Rietveld 408576698