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

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

Issue 2918543002: Add username field discovery heuristic. (Closed)
Patch Set: Created 3 years, 6 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
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_PASSWORD_AUTOFILL_AGENT_H_ 5 #ifndef COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_AUTOFILL_AGENT_H_
6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_AUTOFILL_AGENT_H_ 6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_AUTOFILL_AGENT_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <vector> 10 #include <vector>
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 // be filled. |show_in_password_field| should indicate whether the pop-up is 222 // be filled. |show_in_password_field| should indicate whether the pop-up is
223 // to be shown on the password field instead of on the username field. If the 223 // to be shown on the password field instead of on the username field. If the
224 // username exists, it should be passed as |user_input|. If there is no 224 // username exists, it should be passed as |user_input|. If there is no
225 // username, pass the password field in |user_input|. In the latter case, no 225 // username, pass the password field in |user_input|. In the latter case, no
226 // username value will be shown in the pop-up. 226 // username value will be shown in the pop-up.
227 bool ShowSuggestionPopup(const PasswordInfo& password_info, 227 bool ShowSuggestionPopup(const PasswordInfo& password_info,
228 const blink::WebInputElement& user_input, 228 const blink::WebInputElement& user_input,
229 bool show_all, 229 bool show_all,
230 bool show_on_password_field); 230 bool show_on_password_field);
231 231
232 // Finds the PasswordInfo, username and password fields that corresponds to 232 // Finds the PasswordInfo, username and password fields corresponding to the
233 // the passed in |element|. |element| can refer either to a username element 233 // passed in |element|, which can refer to either a username or a password
234 // or a password element. If a PasswordInfo was found, returns |true| and also 234 // element. If a PasswordInfo was found, returns |true| and assigns the
235 // assigns the corresponding username, password elements and PasswordInfo into 235 // corresponding username, password elements and PasswordInfo into
236 // |username_element|, |password_element| and |pasword_info|, respectively. 236 // |username_element|, |password_element| and |pasword_info|, respectively.
237 // Note, that |username_element->isNull()| can be true if |element| is a 237 // Note, that |username_element->IsNull()| can be true if |element| is a
238 // password. 238 // password.
239 bool FindPasswordInfoForElement(const blink::WebInputElement& element, 239 bool FindPasswordInfoForElement(const blink::WebInputElement& element,
240 blink::WebInputElement* username_element, 240 blink::WebInputElement* username_element,
241 blink::WebInputElement* password_element, 241 blink::WebInputElement* password_element,
242 PasswordInfo** password_info); 242 PasswordInfo** password_info);
243 243
244 // Invoked when the frame is closing. 244 // Invoked when the frame is closing.
245 void FrameClosing(); 245 void FrameClosing();
246 246
247 // Clears the preview for the username and password fields, restoring both to 247 // Clears the preview for the username and password fields, restoring both to
(...skipping 13 matching lines...) Expand all
261 ProvisionallySaveRestriction restriction); 261 ProvisionallySaveRestriction restriction);
262 262
263 // Helper function called when same-document navigation completed 263 // Helper function called when same-document navigation completed
264 void OnSameDocumentNavigationCompleted( 264 void OnSameDocumentNavigationCompleted(
265 PasswordForm::SubmissionIndicatorEvent event); 265 PasswordForm::SubmissionIndicatorEvent event);
266 266
267 const mojom::AutofillDriverPtr& GetAutofillDriver(); 267 const mojom::AutofillDriverPtr& GetAutofillDriver();
268 268
269 // The logins we have filled so far with their associated info. 269 // The logins we have filled so far with their associated info.
270 WebInputToPasswordInfoMap web_input_to_password_info_; 270 WebInputToPasswordInfoMap web_input_to_password_info_;
271 // A (sort-of) reverse map to |login_to_password_info_|. 271 // A (sort-of) reverse map to |web_input_to_password_info_|.
272 PasswordToLoginMap password_to_username_; 272 PasswordToLoginMap password_to_username_;
273 273
274 // Set if the user might be submitting a password form on the current page, 274 // Set if the user might be submitting a password form on the current page,
275 // but the submit may still fail (i.e. doesn't pass JavaScript validation). 275 // but the submit may still fail (i.e. doesn't pass JavaScript validation).
276 ProvisionallySavedPasswordForm provisionally_saved_form_; 276 ProvisionallySavedPasswordForm provisionally_saved_form_;
277 277
278 // Map WebFormControlElement to the pair of: 278 // Map WebFormControlElement to the pair of:
279 // 1) The most recent text that user typed or PasswordManager autofilled in 279 // 1) The most recent text that user typed or PasswordManager autofilled in
280 // input elements. Used for storing username/password before JavaScript 280 // input elements. Used for storing username/password before JavaScript
281 // changes them. 281 // changes them.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 mojo::Binding<mojom::PasswordAutofillAgent> binding_; 313 mojo::Binding<mojom::PasswordAutofillAgent> binding_;
314 314
315 blink::WebFormElementObserver* form_element_observer_; 315 blink::WebFormElementObserver* form_element_observer_;
316 316
317 DISALLOW_COPY_AND_ASSIGN(PasswordAutofillAgent); 317 DISALLOW_COPY_AND_ASSIGN(PasswordAutofillAgent);
318 }; 318 };
319 319
320 } // namespace autofill 320 } // namespace autofill
321 321
322 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_AUTOFILL_AGENT_H_ 322 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_AUTOFILL_AGENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698