OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOCOMPLETE_HISTORY_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOCOMPLETE_HISTORY_MANAGER_H_ |
6 #define CHROME_BROWSER_AUTOFILL_AUTOCOMPLETE_HISTORY_MANAGER_H_ | 6 #define CHROME_BROWSER_AUTOFILL_AUTOCOMPLETE_HISTORY_MANAGER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
11 #include "chrome/browser/api/prefs/pref_member.h" | 11 #include "chrome/browser/api/prefs/pref_member.h" |
12 #include "chrome/browser/api/webdata/autofill_web_data_service.h" | 12 #include "chrome/browser/api/webdata/autofill_web_data_service.h" |
13 #include "chrome/browser/api/webdata/web_data_service_consumer.h" | 13 #include "chrome/browser/api/webdata/web_data_service_consumer.h" |
14 #include "content/public/browser/web_contents_observer.h" | 14 #include "content/public/browser/web_contents_observer.h" |
15 | 15 |
16 namespace content { | 16 namespace content { |
17 class BrowserContext; | 17 class BrowserContext; |
18 } | |
19 | |
20 namespace webkit { | |
21 namespace forms { | |
22 struct FormData; | 18 struct FormData; |
23 } | 19 } |
24 } | |
25 | 20 |
26 class AutofillExternalDelegate; | 21 class AutofillExternalDelegate; |
27 | 22 |
28 // Per-tab Autocomplete history manager. Handles receiving form data | 23 // Per-tab Autocomplete history manager. Handles receiving form data |
29 // from the renderer and the storing and retrieving of form data | 24 // from the renderer and the storing and retrieving of form data |
30 // through WebDataServiceBase. | 25 // through WebDataServiceBase. |
31 class AutocompleteHistoryManager : public content::WebContentsObserver, | 26 class AutocompleteHistoryManager : public content::WebContentsObserver, |
32 public WebDataServiceConsumer { | 27 public WebDataServiceConsumer { |
33 public: | 28 public: |
34 explicit AutocompleteHistoryManager(content::WebContents* web_contents); | 29 explicit AutocompleteHistoryManager(content::WebContents* web_contents); |
(...skipping 10 matching lines...) Expand all Loading... |
45 // Pass-through functions that are called by AutofillManager, after it has | 40 // Pass-through functions that are called by AutofillManager, after it has |
46 // dispatched a message. | 41 // dispatched a message. |
47 void OnGetAutocompleteSuggestions( | 42 void OnGetAutocompleteSuggestions( |
48 int query_id, | 43 int query_id, |
49 const string16& name, | 44 const string16& name, |
50 const string16& prefix, | 45 const string16& prefix, |
51 const std::vector<string16>& autofill_values, | 46 const std::vector<string16>& autofill_values, |
52 const std::vector<string16>& autofill_labels, | 47 const std::vector<string16>& autofill_labels, |
53 const std::vector<string16>& autofill_icons, | 48 const std::vector<string16>& autofill_icons, |
54 const std::vector<int>& autofill_unique_ids); | 49 const std::vector<int>& autofill_unique_ids); |
55 void OnFormSubmitted(const webkit::forms::FormData& form); | 50 void OnFormSubmitted(const content::FormData& form); |
56 | 51 |
57 // Must be public for the external delegate to use. | 52 // Must be public for the external delegate to use. |
58 void OnRemoveAutocompleteEntry(const string16& name, const string16& value); | 53 void OnRemoveAutocompleteEntry(const string16& name, const string16& value); |
59 | 54 |
60 // Sets our external delegate. | 55 // Sets our external delegate. |
61 void SetExternalDelegate(AutofillExternalDelegate* delegate); | 56 void SetExternalDelegate(AutofillExternalDelegate* delegate); |
62 | 57 |
63 protected: | 58 protected: |
64 friend class AutocompleteHistoryManagerTest; | 59 friend class AutocompleteHistoryManagerTest; |
65 friend class AutofillManagerTest; | 60 friend class AutofillManagerTest; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 std::vector<int> autofill_unique_ids_; | 92 std::vector<int> autofill_unique_ids_; |
98 | 93 |
99 // Delegate to perform external processing (display, selection) on | 94 // Delegate to perform external processing (display, selection) on |
100 // our behalf. Weak. | 95 // our behalf. Weak. |
101 AutofillExternalDelegate* external_delegate_; | 96 AutofillExternalDelegate* external_delegate_; |
102 | 97 |
103 DISALLOW_COPY_AND_ASSIGN(AutocompleteHistoryManager); | 98 DISALLOW_COPY_AND_ASSIGN(AutocompleteHistoryManager); |
104 }; | 99 }; |
105 | 100 |
106 #endif // CHROME_BROWSER_AUTOFILL_AUTOCOMPLETE_HISTORY_MANAGER_H_ | 101 #endif // CHROME_BROWSER_AUTOFILL_AUTOCOMPLETE_HISTORY_MANAGER_H_ |
OLD | NEW |