| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
| 12 #include "chrome/browser/prefs/pref_member.h" | 12 #include "chrome/browser/prefs/pref_member.h" |
| 13 #include "chrome/browser/webdata/web_data_service.h" | 13 #include "chrome/browser/webdata/web_data_service.h" |
| 14 #include "content/browser/tab_contents/tab_contents_observer.h" | 14 #include "content/browser/tab_contents/tab_contents_observer.h" |
| 15 | 15 |
| 16 namespace webkit_glue { | 16 namespace webkit { |
| 17 namespace forms { |
| 17 struct FormData; | 18 struct FormData; |
| 18 } // namespace webkit_glue | 19 } |
| 20 } |
| 19 | 21 |
| 20 class AutofillExternalDelegate; | 22 class AutofillExternalDelegate; |
| 21 class Profile; | 23 class Profile; |
| 22 class TabContents; | 24 class TabContents; |
| 23 | 25 |
| 24 // Per-tab Autocomplete history manager. Handles receiving form data from the | 26 // Per-tab Autocomplete history manager. Handles receiving form data from the |
| 25 // renderer and the storing and retrieving of form data through WebDataService. | 27 // renderer and the storing and retrieving of form data through WebDataService. |
| 26 class AutocompleteHistoryManager : public TabContentsObserver, | 28 class AutocompleteHistoryManager : public TabContentsObserver, |
| 27 public WebDataServiceConsumer { | 29 public WebDataServiceConsumer { |
| 28 public: | 30 public: |
| (...skipping 11 matching lines...) Expand all Loading... |
| 40 // Pass-through functions that are called by AutofillManager, after it has | 42 // Pass-through functions that are called by AutofillManager, after it has |
| 41 // dispatched a message. | 43 // dispatched a message. |
| 42 void OnGetAutocompleteSuggestions( | 44 void OnGetAutocompleteSuggestions( |
| 43 int query_id, | 45 int query_id, |
| 44 const string16& name, | 46 const string16& name, |
| 45 const string16& prefix, | 47 const string16& prefix, |
| 46 const std::vector<string16>& autofill_values, | 48 const std::vector<string16>& autofill_values, |
| 47 const std::vector<string16>& autofill_labels, | 49 const std::vector<string16>& autofill_labels, |
| 48 const std::vector<string16>& autofill_icons, | 50 const std::vector<string16>& autofill_icons, |
| 49 const std::vector<int>& autofill_unique_ids); | 51 const std::vector<int>& autofill_unique_ids); |
| 50 void OnFormSubmitted(const webkit_glue::FormData& form); | 52 void OnFormSubmitted(const webkit::forms::FormData& form); |
| 51 | 53 |
| 52 // Sets our external delegate. | 54 // Sets our external delegate. |
| 53 void SetExternalDelegate(AutofillExternalDelegate* delegate); | 55 void SetExternalDelegate(AutofillExternalDelegate* delegate); |
| 54 | 56 |
| 55 protected: | 57 protected: |
| 56 friend class AutocompleteHistoryManagerTest; | 58 friend class AutocompleteHistoryManagerTest; |
| 57 friend class AutofillManagerTest; | 59 friend class AutofillManagerTest; |
| 58 FRIEND_TEST_ALL_PREFIXES(AutocompleteHistoryManagerTest, ExternalDelegate); | 60 FRIEND_TEST_ALL_PREFIXES(AutocompleteHistoryManagerTest, ExternalDelegate); |
| 59 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, TestTabContents); | 61 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, TestTabContents); |
| 60 | 62 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 90 std::vector<int> autofill_unique_ids_; | 92 std::vector<int> autofill_unique_ids_; |
| 91 | 93 |
| 92 // Delegate to perform external processing (display, selection) on | 94 // Delegate to perform external processing (display, selection) on |
| 93 // our behalf. Weak. | 95 // our behalf. Weak. |
| 94 AutofillExternalDelegate* external_delegate_; | 96 AutofillExternalDelegate* external_delegate_; |
| 95 | 97 |
| 96 DISALLOW_COPY_AND_ASSIGN(AutocompleteHistoryManager); | 98 DISALLOW_COPY_AND_ASSIGN(AutocompleteHistoryManager); |
| 97 }; | 99 }; |
| 98 | 100 |
| 99 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_MANAGER_H_ | 101 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_MANAGER_H_ |
| OLD | NEW |