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

Side by Side Diff: components/autofill/content/renderer/autofill_agent.h

Issue 166043006: Add password manager autocomplete suggestion when a username element in clicked. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase on ToT Created 6 years, 5 months 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 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_CONTENT_RENDERER_AUTOFILL_AGENT_H_ 5 #ifndef COMPONENTS_AUTOFILL_CONTENT_RENDERER_AUTOFILL_AGENT_H_
6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_AUTOFILL_AGENT_H_ 6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_AUTOFILL_AGENT_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 // when |element| contains no text. 134 // when |element| contains no text.
135 // |requires_caret_at_end| specifies whether suggestions should be shown when 135 // |requires_caret_at_end| specifies whether suggestions should be shown when
136 // the caret is not after the last character in |element|. 136 // the caret is not after the last character in |element|.
137 // |display_warning_if_disabled| specifies whether a warning should be 137 // |display_warning_if_disabled| specifies whether a warning should be
138 // displayed to the user if Autofill has suggestions available, but cannot 138 // displayed to the user if Autofill has suggestions available, but cannot
139 // fill them because it is disabled (e.g. when trying to fill a credit card 139 // fill them because it is disabled (e.g. when trying to fill a credit card
140 // form on a non-secure website). 140 // form on a non-secure website).
141 // |datalist_only| specifies whether all of <datalist> suggestions and no 141 // |datalist_only| specifies whether all of <datalist> suggestions and no
142 // autofill suggestions are shown. |autofill_on_empty_values| and 142 // autofill suggestions are shown. |autofill_on_empty_values| and
143 // |requires_caret_at_end| are ignored if |datalist_only| is true. 143 // |requires_caret_at_end| are ignored if |datalist_only| is true.
144 // |show_full_suggestion_list| specifies that all autofill suggestions should
145 // be shown and none should be elided because of the current value of
146 // |element| (relevant for inline autocomplete).
147 // |show_password_suggestions_only| specifies that only show a suggestions box
148 // if |element| is part of a password form, otherwise show no suggestions.
144 void ShowSuggestions(const blink::WebFormControlElement& element, 149 void ShowSuggestions(const blink::WebFormControlElement& element,
145 bool autofill_on_empty_values, 150 bool autofill_on_empty_values,
146 bool requires_caret_at_end, 151 bool requires_caret_at_end,
147 bool display_warning_if_disabled, 152 bool display_warning_if_disabled,
148 bool datalist_only); 153 bool datalist_only,
154 bool show_full_suggestion_list,
155 bool show_password_suggestions_only);
149 156
150 // Queries the browser for Autocomplete and Autofill suggestions for the given 157 // Queries the browser for Autocomplete and Autofill suggestions for the given
151 // |element|. 158 // |element|.
152 void QueryAutofillSuggestions(const blink::WebFormControlElement& element, 159 void QueryAutofillSuggestions(const blink::WebFormControlElement& element,
153 bool display_warning_if_disabled, 160 bool display_warning_if_disabled,
154 bool datalist_only); 161 bool datalist_only);
155 162
156 // Sets the element value to reflect the selected |suggested_value|. 163 // Sets the element value to reflect the selected |suggested_value|.
157 void AcceptDataListSuggestion(const base::string16& suggested_value); 164 void AcceptDataListSuggestion(const base::string16& suggested_value);
158 165
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 friend class RequestAutocompleteRendererTest; 245 friend class RequestAutocompleteRendererTest;
239 FRIEND_TEST_ALL_PREFIXES(AutofillRendererTest, FillFormElement); 246 FRIEND_TEST_ALL_PREFIXES(AutofillRendererTest, FillFormElement);
240 FRIEND_TEST_ALL_PREFIXES(AutofillRendererTest, SendDynamicForms); 247 FRIEND_TEST_ALL_PREFIXES(AutofillRendererTest, SendDynamicForms);
241 FRIEND_TEST_ALL_PREFIXES(AutofillRendererTest, ShowAutofillWarning); 248 FRIEND_TEST_ALL_PREFIXES(AutofillRendererTest, ShowAutofillWarning);
242 FRIEND_TEST_ALL_PREFIXES(PasswordAutofillAgentTest, WaitUsername); 249 FRIEND_TEST_ALL_PREFIXES(PasswordAutofillAgentTest, WaitUsername);
243 FRIEND_TEST_ALL_PREFIXES(PasswordAutofillAgentTest, SuggestionAccept); 250 FRIEND_TEST_ALL_PREFIXES(PasswordAutofillAgentTest, SuggestionAccept);
244 FRIEND_TEST_ALL_PREFIXES(PasswordAutofillAgentTest, SuggestionSelect); 251 FRIEND_TEST_ALL_PREFIXES(PasswordAutofillAgentTest, SuggestionSelect);
245 FRIEND_TEST_ALL_PREFIXES( 252 FRIEND_TEST_ALL_PREFIXES(
246 PasswordAutofillAgentTest, 253 PasswordAutofillAgentTest,
247 PasswordAutofillTriggersOnChangeEventsWaitForUsername); 254 PasswordAutofillTriggersOnChangeEventsWaitForUsername);
255 FRIEND_TEST_ALL_PREFIXES(PasswordAutofillAgentTest, CredentialsOnClick);
248 FRIEND_TEST_ALL_PREFIXES(RequestAutocompleteRendererTest, 256 FRIEND_TEST_ALL_PREFIXES(RequestAutocompleteRendererTest,
249 NoCancelOnMainFrameNavigateAfterDone); 257 NoCancelOnMainFrameNavigateAfterDone);
250 FRIEND_TEST_ALL_PREFIXES(RequestAutocompleteRendererTest, 258 FRIEND_TEST_ALL_PREFIXES(RequestAutocompleteRendererTest,
251 NoCancelOnSubframeNavigateAfterDone); 259 NoCancelOnSubframeNavigateAfterDone);
252 FRIEND_TEST_ALL_PREFIXES(RequestAutocompleteRendererTest, 260 FRIEND_TEST_ALL_PREFIXES(RequestAutocompleteRendererTest,
253 InvokingTwiceOnlyShowsOnce); 261 InvokingTwiceOnlyShowsOnce);
254 262
255 DISALLOW_COPY_AND_ASSIGN(AutofillAgent); 263 DISALLOW_COPY_AND_ASSIGN(AutofillAgent);
256 }; 264 };
257 265
258 } // namespace autofill 266 } // namespace autofill
259 267
260 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_AUTOFILL_AGENT_H_ 268 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_AUTOFILL_AGENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698