OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_AUTOCOMPLETE_HISTORY_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_HISTORY_MANAGER_H_ |
6 #define CHROME_BROWSER_AUTOCOMPLETE_HISTORY_MANAGER_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_HISTORY_MANAGER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "chrome/browser/prefs/pref_member.h" | 11 #include "chrome/browser/prefs/pref_member.h" |
| 12 #include "chrome/browser/tab_contents/web_navigation_observer.h" |
12 #include "chrome/browser/webdata/web_data_service.h" | 13 #include "chrome/browser/webdata/web_data_service.h" |
13 #include "ipc/ipc_channel.h" | |
14 | 14 |
15 namespace webkit_glue { | 15 namespace webkit_glue { |
16 struct FormData; | 16 struct FormData; |
17 } // namespace webkit_glue | 17 } // namespace webkit_glue |
18 | 18 |
19 class Profile; | 19 class Profile; |
20 class TabContents; | 20 class TabContents; |
21 | 21 |
22 // Per-tab Autocomplete history manager. Handles receiving form data from the | 22 // Per-tab Autocomplete history manager. Handles receiving form data from the |
23 // renderer and the storing and retrieving of form data through WebDataService. | 23 // renderer and the storing and retrieving of form data through WebDataService. |
24 class AutocompleteHistoryManager : public IPC::Channel::Listener, | 24 class AutocompleteHistoryManager : public WebNavigationObserver, |
25 public WebDataServiceConsumer { | 25 public WebDataServiceConsumer { |
26 public: | 26 public: |
27 explicit AutocompleteHistoryManager(TabContents* tab_contents); | 27 explicit AutocompleteHistoryManager(TabContents* tab_contents); |
28 virtual ~AutocompleteHistoryManager(); | 28 virtual ~AutocompleteHistoryManager(); |
29 | 29 |
30 // IPC::Channel::Listener implementation. | 30 // WebNavigationObserver implementation. |
31 virtual bool OnMessageReceived(const IPC::Message& message); | 31 virtual bool OnMessageReceived(const IPC::Message& message); |
32 | 32 |
33 // WebDataServiceConsumer implementation. | 33 // WebDataServiceConsumer implementation. |
34 virtual void OnWebDataServiceRequestDone(WebDataService::Handle h, | 34 virtual void OnWebDataServiceRequestDone(WebDataService::Handle h, |
35 const WDTypedResult* result); | 35 const WDTypedResult* result); |
36 | 36 |
37 // Pass-through functions that are called by AutoFillManager, after it has | 37 // Pass-through functions that are called by AutoFillManager, after it has |
38 // dispatched a message. | 38 // dispatched a message. |
39 void OnGetAutocompleteSuggestions( | 39 void OnGetAutocompleteSuggestions( |
40 int query_id, | 40 int query_id, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 int query_id_; | 72 int query_id_; |
73 std::vector<string16> autofill_values_; | 73 std::vector<string16> autofill_values_; |
74 std::vector<string16> autofill_labels_; | 74 std::vector<string16> autofill_labels_; |
75 std::vector<string16> autofill_icons_; | 75 std::vector<string16> autofill_icons_; |
76 std::vector<int> autofill_unique_ids_; | 76 std::vector<int> autofill_unique_ids_; |
77 | 77 |
78 DISALLOW_COPY_AND_ASSIGN(AutocompleteHistoryManager); | 78 DISALLOW_COPY_AND_ASSIGN(AutocompleteHistoryManager); |
79 }; | 79 }; |
80 | 80 |
81 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_MANAGER_H_ | 81 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_MANAGER_H_ |
OLD | NEW |