summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete_history_manager.h
diff options
context:
space:
mode:
authorjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-29 00:51:04 +0000
committerjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-29 00:51:04 +0000
commit3fd040071e5049e06953031ab98644ac26734a86 (patch)
treecd4bf7a48cbfaebe2e70b469c350ff9981f2ba01 /chrome/browser/autocomplete_history_manager.h
parente8cdf3530e9b892f63a25e6366af15e146260dcd (diff)
downloadchromium_src-3fd040071e5049e06953031ab98644ac26734a86.zip
chromium_src-3fd040071e5049e06953031ab98644ac26734a86.tar.gz
chromium_src-3fd040071e5049e06953031ab98644ac26734a86.tar.bz2
External autofill delegates.
BUG= TEST= Review URL: http://codereview.chromium.org/8353025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107839 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete_history_manager.h')
-rw-r--r--chrome/browser/autocomplete_history_manager.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/chrome/browser/autocomplete_history_manager.h b/chrome/browser/autocomplete_history_manager.h
index 4f8b8f3..f3923d2 100644
--- a/chrome/browser/autocomplete_history_manager.h
+++ b/chrome/browser/autocomplete_history_manager.h
@@ -8,6 +8,7 @@
#include <vector>
+#include "base/gtest_prod_util.h"
#include "chrome/browser/prefs/pref_member.h"
#include "chrome/browser/webdata/web_data_service.h"
#include "content/browser/tab_contents/tab_contents_observer.h"
@@ -16,6 +17,7 @@ namespace webkit_glue {
struct FormData;
} // namespace webkit_glue
+class AutofillExternalDelegate;
class Profile;
class TabContents;
@@ -46,9 +48,16 @@ class AutocompleteHistoryManager : public TabContentsObserver,
const std::vector<int>& autofill_unique_ids);
void OnFormSubmitted(const webkit_glue::FormData& form);
+ // Sets our external delegate.
+ void SetExternalDelegate(AutofillExternalDelegate* delegate) {
+ external_delegate_ = delegate;
+ }
+
protected:
friend class AutocompleteHistoryManagerTest;
friend class AutofillManagerTest;
+ FRIEND_TEST_ALL_PREFIXES(AutocompleteHistoryManagerTest, ExternalDelegate);
+ FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, TestTabContents);
// For tests.
AutocompleteHistoryManager(TabContents* tab_contents,
@@ -58,6 +67,11 @@ class AutocompleteHistoryManager : public TabContentsObserver,
void SendSuggestions(const std::vector<string16>* suggestions);
void CancelPendingQuery();
+ // Exposed for testing.
+ AutofillExternalDelegate* external_delegate() {
+ return external_delegate_;
+ }
+
private:
void OnRemoveAutocompleteEntry(const string16& name, const string16& value);
@@ -76,6 +90,10 @@ class AutocompleteHistoryManager : public TabContentsObserver,
std::vector<string16> autofill_icons_;
std::vector<int> autofill_unique_ids_;
+ // Delegate to perform external processing (display, selection) on
+ // our behalf. Weak.
+ AutofillExternalDelegate* external_delegate_;
+
DISALLOW_COPY_AND_ASSIGN(AutocompleteHistoryManager);
};