Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1344)

Side by Side Diff: chrome/renderer/autofill/autofill_agent.h

Issue 11270018: [autofill] Adding new API to request an interactive autocomplete UI flow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: do a barrel roll! Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_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 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 // RenderView::Observer: 54 // RenderView::Observer:
55 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 55 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
56 virtual void DidFinishDocumentLoad(WebKit::WebFrame* frame) OVERRIDE; 56 virtual void DidFinishDocumentLoad(WebKit::WebFrame* frame) OVERRIDE;
57 virtual void FrameDetached(WebKit::WebFrame* frame) OVERRIDE; 57 virtual void FrameDetached(WebKit::WebFrame* frame) OVERRIDE;
58 virtual void FrameWillClose(WebKit::WebFrame* frame) OVERRIDE; 58 virtual void FrameWillClose(WebKit::WebFrame* frame) OVERRIDE;
59 virtual void WillSubmitForm(WebKit::WebFrame* frame, 59 virtual void WillSubmitForm(WebKit::WebFrame* frame,
60 const WebKit::WebFormElement& form) OVERRIDE; 60 const WebKit::WebFormElement& form) OVERRIDE;
61 virtual void ZoomLevelChanged() OVERRIDE; 61 virtual void ZoomLevelChanged() OVERRIDE;
62 virtual void DidChangeScrollOffset(WebKit::WebFrame* frame) OVERRIDE; 62 virtual void DidChangeScrollOffset(WebKit::WebFrame* frame) OVERRIDE;
63 virtual void RequestAutocomplete(WebKit::WebFrame* frame,
64 const WebKit::WebFormElement& form) OVERRIDE;
63 65
64 // PageClickListener: 66 // PageClickListener:
65 virtual bool InputElementClicked(const WebKit::WebInputElement& element, 67 virtual bool InputElementClicked(const WebKit::WebInputElement& element,
66 bool was_focused, 68 bool was_focused,
67 bool is_focused) OVERRIDE; 69 bool is_focused) OVERRIDE;
68 virtual bool InputElementLostFocus() OVERRIDE; 70 virtual bool InputElementLostFocus() OVERRIDE;
69 71
70 // WebKit::WebAutofillClient: 72 // WebKit::WebAutofillClient:
71 virtual void didAcceptAutofillSuggestion(const WebKit::WebNode& node, 73 virtual void didAcceptAutofillSuggestion(const WebKit::WebNode& node,
72 const WebKit::WebString& value, 74 const WebKit::WebString& value,
(...skipping 28 matching lines...) Expand all
101 // For external Autofill selection. 103 // For external Autofill selection.
102 void OnSelectAutofillSuggestionAtIndex(int listIndex); 104 void OnSelectAutofillSuggestionAtIndex(int listIndex);
103 void OnSetAutofillActionFill(); 105 void OnSetAutofillActionFill();
104 void OnClearForm(); 106 void OnClearForm();
105 void OnSetAutofillActionPreview(); 107 void OnSetAutofillActionPreview();
106 void OnClearPreviewedForm(); 108 void OnClearPreviewedForm();
107 void OnSetNodeText(const string16& value); 109 void OnSetNodeText(const string16& value);
108 void OnAcceptDataListSuggestion(const string16& value); 110 void OnAcceptDataListSuggestion(const string16& value);
109 void OnAcceptPasswordAutofillSuggestion(const string16& value); 111 void OnAcceptPasswordAutofillSuggestion(const string16& value);
110 112
113 // For interactive autocomplete.
114 void OnRequestAutocompleteFinished(bool success);
115
111 // Called in a posted task by textFieldDidChange() to work-around a WebKit bug 116 // Called in a posted task by textFieldDidChange() to work-around a WebKit bug
112 // http://bugs.webkit.org/show_bug.cgi?id=16976 117 // http://bugs.webkit.org/show_bug.cgi?id=16976
113 void TextFieldDidChangeImpl(const WebKit::WebInputElement& element); 118 void TextFieldDidChangeImpl(const WebKit::WebInputElement& element);
114 119
115 // Shows the autofill suggestions for |element|. 120 // Shows the autofill suggestions for |element|.
116 // This call is asynchronous and may or may not lead to the showing of a 121 // This call is asynchronous and may or may not lead to the showing of a
117 // suggestion popup (no popup is shown if there are no available suggestions). 122 // suggestion popup (no popup is shown if there are no available suggestions).
118 // |autofill_on_empty_values| specifies whether suggestions should be shown 123 // |autofill_on_empty_values| specifies whether suggestions should be shown
119 // when |element| contains no text. 124 // when |element| contains no text.
120 // |requires_caret_at_end| specifies whether suggestions should be shown when 125 // |requires_caret_at_end| specifies whether suggestions should be shown when
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 172
168 PasswordAutofillManager* password_autofill_manager_; // WEAK reference. 173 PasswordAutofillManager* password_autofill_manager_; // WEAK reference.
169 174
170 // The ID of the last request sent for form field Autofill. Used to ignore 175 // The ID of the last request sent for form field Autofill. Used to ignore
171 // out of date responses. 176 // out of date responses.
172 int autofill_query_id_; 177 int autofill_query_id_;
173 178
174 // The element corresponding to the last request sent for form field Autofill. 179 // The element corresponding to the last request sent for form field Autofill.
175 WebKit::WebInputElement element_; 180 WebKit::WebInputElement element_;
176 181
182 // The element corresponding to the last request sent for an interactive
183 // autocomplete.
184 WebKit::WebFormElement form_;
185
177 // The action to take when receiving Autofill data from the AutofillManager. 186 // The action to take when receiving Autofill data from the AutofillManager.
178 AutofillAction autofill_action_; 187 AutofillAction autofill_action_;
179 188
180 // Should we display a warning if autofill is disabled? 189 // Should we display a warning if autofill is disabled?
181 bool display_warning_if_disabled_; 190 bool display_warning_if_disabled_;
182 191
183 // Was the query node autofilled prior to previewing the form? 192 // Was the query node autofilled prior to previewing the form?
184 bool was_query_node_autofilled_; 193 bool was_query_node_autofilled_;
185 194
186 // Have we already shown Autofill suggestions for the field the user is 195 // Have we already shown Autofill suggestions for the field the user is
(...skipping 11 matching lines...) Expand all
198 FRIEND_TEST_ALL_PREFIXES(PasswordAutofillManagerTest, WaitUsername); 207 FRIEND_TEST_ALL_PREFIXES(PasswordAutofillManagerTest, WaitUsername);
199 FRIEND_TEST_ALL_PREFIXES(PasswordAutofillManagerTest, SuggestionAccept); 208 FRIEND_TEST_ALL_PREFIXES(PasswordAutofillManagerTest, SuggestionAccept);
200 FRIEND_TEST_ALL_PREFIXES(PasswordAutofillManagerTest, SuggestionSelect); 209 FRIEND_TEST_ALL_PREFIXES(PasswordAutofillManagerTest, SuggestionSelect);
201 210
202 DISALLOW_COPY_AND_ASSIGN(AutofillAgent); 211 DISALLOW_COPY_AND_ASSIGN(AutofillAgent);
203 }; 212 };
204 213
205 } // namespace autofill 214 } // namespace autofill
206 215
207 #endif // CHROME_RENDERER_AUTOFILL_AUTOFILL_AGENT_H_ 216 #endif // CHROME_RENDERER_AUTOFILL_AUTOFILL_AGENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698