| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOCOMPLETE_HISTORY_MANAGER_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOCOMPLETE_HISTORY_MANAGER_H_ |
| 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOCOMPLETE_HISTORY_MANAGER_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_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" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 int query_id, | 39 int query_id, |
| 40 const base::string16& name, | 40 const base::string16& name, |
| 41 const base::string16& prefix, | 41 const base::string16& prefix, |
| 42 const std::string form_control_type, | 42 const std::string form_control_type, |
| 43 const std::vector<base::string16>& autofill_values, | 43 const std::vector<base::string16>& autofill_values, |
| 44 const std::vector<base::string16>& autofill_labels, | 44 const std::vector<base::string16>& autofill_labels, |
| 45 const std::vector<base::string16>& autofill_icons, | 45 const std::vector<base::string16>& autofill_icons, |
| 46 const std::vector<int>& autofill_unique_ids); | 46 const std::vector<int>& autofill_unique_ids); |
| 47 virtual void OnFormSubmitted(const FormData& form); | 47 virtual void OnFormSubmitted(const FormData& form); |
| 48 | 48 |
| 49 // Cancels the currently pending WebDataService query, if there is one. |
| 50 void CancelPendingQuery(); |
| 51 |
| 49 // Must be public for the external delegate to use. | 52 // Must be public for the external delegate to use. |
| 50 void OnRemoveAutocompleteEntry(const base::string16& name, | 53 void OnRemoveAutocompleteEntry(const base::string16& name, |
| 51 const base::string16& value); | 54 const base::string16& value); |
| 52 | 55 |
| 53 // Sets our external delegate. | 56 // Sets our external delegate. |
| 54 void SetExternalDelegate(AutofillExternalDelegate* delegate); | 57 void SetExternalDelegate(AutofillExternalDelegate* delegate); |
| 55 | 58 |
| 56 protected: | 59 protected: |
| 57 friend class AutofillManagerTest; | 60 friend class AutofillManagerTest; |
| 58 | 61 |
| 59 // Sends the given |suggestions| for display in the Autofill popup. | 62 // Sends the given |suggestions| for display in the Autofill popup. |
| 60 void SendSuggestions(const std::vector<base::string16>* suggestions); | 63 void SendSuggestions(const std::vector<base::string16>* suggestions); |
| 61 | 64 |
| 62 private: | 65 private: |
| 63 // Cancels the currently pending WebDataService query, if there is one. | |
| 64 void CancelPendingQuery(); | |
| 65 | |
| 66 // Provides driver-level context. Must outlive this object. | 66 // Provides driver-level context. Must outlive this object. |
| 67 AutofillDriver* driver_; | 67 AutofillDriver* driver_; |
| 68 scoped_refptr<AutofillWebDataService> database_; | 68 scoped_refptr<AutofillWebDataService> database_; |
| 69 | 69 |
| 70 // When the manager makes a request from WebDataServiceBase, the database is | 70 // When the manager makes a request from WebDataServiceBase, the database is |
| 71 // queried on another thread, we record the query handle until we get called | 71 // queried on another thread, we record the query handle until we get called |
| 72 // back. We also store the autofill results so we can send them together. | 72 // back. We also store the autofill results so we can send them together. |
| 73 WebDataServiceBase::Handle pending_query_handle_; | 73 WebDataServiceBase::Handle pending_query_handle_; |
| 74 int query_id_; | 74 int query_id_; |
| 75 std::vector<base::string16> autofill_values_; | 75 std::vector<base::string16> autofill_values_; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 86 | 86 |
| 87 // Whether IPC is sent. | 87 // Whether IPC is sent. |
| 88 bool send_ipc_; | 88 bool send_ipc_; |
| 89 | 89 |
| 90 DISALLOW_COPY_AND_ASSIGN(AutocompleteHistoryManager); | 90 DISALLOW_COPY_AND_ASSIGN(AutocompleteHistoryManager); |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 } // namespace autofill | 93 } // namespace autofill |
| 94 | 94 |
| 95 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOCOMPLETE_HISTORY_MANAGER_H_ | 95 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOCOMPLETE_HISTORY_MANAGER_H_ |
| OLD | NEW |