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

Unified Diff: chrome/browser/autocomplete_history_manager.h

Issue 8353025: External autofill delegates. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase against TOT 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
« no previous file with comments | « no previous file | chrome/browser/autocomplete_history_manager.cc » ('j') | content/content_common.gypi » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete_history_manager.h
diff --git a/chrome/browser/autocomplete_history_manager.h b/chrome/browser/autocomplete_history_manager.h
index 4f8b8f3c7b35fb7de92d8201e45fc99e63c33686..f3923d249e231fb04856d923582fbc70dffb50e5 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);
};
« no previous file with comments | « no previous file | chrome/browser/autocomplete_history_manager.cc » ('j') | content/content_common.gypi » ('J')

Powered by Google App Engine
This is Rietveld 408576698