Chromium Code Reviews| 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_RENDERER_AUTOFILL_AUTOFILL_AGENT_H_ | 5 #ifndef CHROME_RENDERER_AUTOFILL_AUTOFILL_AGENT_H_ |
| 6 #define CHROME_RENDERER_AUTOFILL_AUTOFILL_AGENT_H_ | 6 #define CHROME_RENDERER_AUTOFILL_AUTOFILL_AGENT_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 94 | 94 |
| 95 void OnSuggestionsReturned(int query_id, | 95 void OnSuggestionsReturned(int query_id, |
| 96 const std::vector<string16>& values, | 96 const std::vector<string16>& values, |
| 97 const std::vector<string16>& labels, | 97 const std::vector<string16>& labels, |
| 98 const std::vector<string16>& icons, | 98 const std::vector<string16>& icons, |
| 99 const std::vector<int>& unique_ids); | 99 const std::vector<int>& unique_ids); |
| 100 void OnFormDataFilled(int query_id, const webkit_glue::FormData& form); | 100 void OnFormDataFilled(int query_id, const webkit_glue::FormData& form); |
| 101 void OnFieldTypePredictionsAvailable( | 101 void OnFieldTypePredictionsAvailable( |
| 102 const std::vector<webkit_glue::FormDataPredictions>& forms); | 102 const std::vector<webkit_glue::FormDataPredictions>& forms); |
| 103 | 103 |
| 104 // For external Autofill selection. | 104 // For external Autofill selection. |
| 105 void OnSelectAutofillSuggestionAtIndex(int listIndex); | 105 void OnSelectAutofillSuggestionAtIndex(int listIndex); |
| 106 | 106 |
| 107 // For setting if an external autofill delegate is in use. | |
| 108 void HasExternalDelegate(bool has_external_delegate); | |
|
Ilya Sherman
2011/11/07 21:48:49
nit: OnSetHasExternalDelegate
csharp1
2011/11/08 19:59:00
Done.
| |
| 109 | |
| 107 // Called in a posted task by textFieldDidChange() to work-around a WebKit bug | 110 // Called in a posted task by textFieldDidChange() to work-around a WebKit bug |
| 108 // http://bugs.webkit.org/show_bug.cgi?id=16976 | 111 // http://bugs.webkit.org/show_bug.cgi?id=16976 |
| 109 void TextFieldDidChangeImpl(const WebKit::WebInputElement& element); | 112 void TextFieldDidChangeImpl(const WebKit::WebInputElement& element); |
| 110 | 113 |
| 111 // Shows the autofill suggestions for |element|. | 114 // Shows the autofill suggestions for |element|. |
| 112 // This call is asynchronous and may or may not lead to the showing of a | 115 // This call is asynchronous and may or may not lead to the showing of a |
| 113 // suggestion popup (no popup is shown if there are no available suggestions). | 116 // suggestion popup (no popup is shown if there are no available suggestions). |
| 114 // |autofill_on_empty_values| specifies whether suggestions should be shown | 117 // |autofill_on_empty_values| specifies whether suggestions should be shown |
| 115 // when |element| contains no text. | 118 // when |element| contains no text. |
| 116 // |requires_caret_at_end| specifies whether suggestions should be shown when | 119 // |requires_caret_at_end| specifies whether suggestions should be shown when |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 167 // The menu index of the "Clear" menu item. | 170 // The menu index of the "Clear" menu item. |
| 168 int suggestions_clear_index_; | 171 int suggestions_clear_index_; |
| 169 | 172 |
| 170 // The menu index of the "Autofill options..." menu item. | 173 // The menu index of the "Autofill options..." menu item. |
| 171 int suggestions_options_index_; | 174 int suggestions_options_index_; |
| 172 | 175 |
| 173 // Have we already shown Autofill suggestions for the field the user is | 176 // Have we already shown Autofill suggestions for the field the user is |
| 174 // currently editing? Used to keep track of state for metrics logging. | 177 // currently editing? Used to keep track of state for metrics logging. |
| 175 bool has_shown_autofill_popup_for_current_edit_; | 178 bool has_shown_autofill_popup_for_current_edit_; |
| 176 | 179 |
| 180 // Is an external delegate in the browser handling showing the autofill | |
| 181 // popup. This deciedes if we communicate with the delegate or webkit. | |
|
Ilya Sherman
2011/11/07 21:48:49
nit: "popup. " -> "popup? " (period becomes quest
csharp1
2011/11/08 19:59:00
Done.
| |
| 182 bool has_external_delegate_; | |
| 183 | |
| 177 base::WeakPtrFactory<AutofillAgent> weak_ptr_factory_; | 184 base::WeakPtrFactory<AutofillAgent> weak_ptr_factory_; |
| 178 | 185 |
| 179 friend class PasswordAutofillManagerTest; | 186 friend class PasswordAutofillManagerTest; |
| 180 FRIEND_TEST_ALL_PREFIXES(ChromeRenderViewTest, SendForms); | 187 FRIEND_TEST_ALL_PREFIXES(ChromeRenderViewTest, SendForms); |
| 181 FRIEND_TEST_ALL_PREFIXES(ChromeRenderViewTest, FillFormElement); | 188 FRIEND_TEST_ALL_PREFIXES(ChromeRenderViewTest, FillFormElement); |
| 182 FRIEND_TEST_ALL_PREFIXES(PasswordAutofillManagerTest, WaitUsername); | 189 FRIEND_TEST_ALL_PREFIXES(PasswordAutofillManagerTest, WaitUsername); |
| 183 FRIEND_TEST_ALL_PREFIXES(PasswordAutofillManagerTest, SuggestionAccept); | 190 FRIEND_TEST_ALL_PREFIXES(PasswordAutofillManagerTest, SuggestionAccept); |
| 184 FRIEND_TEST_ALL_PREFIXES(PasswordAutofillManagerTest, SuggestionSelect); | 191 FRIEND_TEST_ALL_PREFIXES(PasswordAutofillManagerTest, SuggestionSelect); |
| 185 | 192 |
| 186 DISALLOW_COPY_AND_ASSIGN(AutofillAgent); | 193 DISALLOW_COPY_AND_ASSIGN(AutofillAgent); |
| 187 }; | 194 }; |
| 188 | 195 |
| 189 } // namespace autofill | 196 } // namespace autofill |
| 190 | 197 |
| 191 #endif // CHROME_RENDERER_AUTOFILL_AUTOFILL_AGENT_H_ | 198 #endif // CHROME_RENDERER_AUTOFILL_AUTOFILL_AGENT_H_ |
| OLD | NEW |