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 #include "components/autofill/content/renderer/password_autofill_agent.h" | 5 #include "components/autofill/content/renderer/password_autofill_agent.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 bool form_contains_username_field = FillDataContainsUsername(fill_data); | 418 bool form_contains_username_field = FillDataContainsUsername(fill_data); |
419 // If the form contains a username field, try to set the username to the | 419 // If the form contains a username field, try to set the username to the |
420 // preferred name, but only if: | 420 // preferred name, but only if: |
421 // (a) The username element is autocompletable, and | 421 // (a) The username element is autocompletable, and |
422 // (b) The fill-on-account-select flag is not set, and | 422 // (b) The fill-on-account-select flag is not set, and |
423 // (c) The username element isn't prefilled | 423 // (c) The username element isn't prefilled |
424 // | 424 // |
425 // If (a) is true but (b) is false, then just mark the username element as | 425 // If (a) is true but (b) is false, then just mark the username element as |
426 // autofilled and return so the fill step is skipped. | 426 // autofilled and return so the fill step is skipped. |
427 // | 427 // |
428 // If (a) is false but (b) is true, then the username element should not be | 428 // If (a) and (b) are false, then the username element should not be |
429 // autofilled, but the user should still be able to select to fill the | 429 // autofilled, but the user should still be able to select to fill the |
430 // password element, so the password element must be marked as autofilled and | 430 // password element, so the password element must be marked as autofilled and |
431 // the fill step should also be skipped. | 431 // the fill step should also be skipped. |
432 // | 432 // |
433 // In all other cases, do nothing. | 433 // In all other cases, do nothing. |
434 if (form_contains_username_field) { | 434 if (form_contains_username_field) { |
435 if (IsElementAutocompletable(username_element)) { | 435 if (IsElementAutocompletable(username_element)) { |
436 if (ShouldFillOnAccountSelect()) { | 436 if (ShouldFillOnAccountSelect()) { |
437 username_element.setAutofilled(true); | 437 username_element.setAutofilled(true); |
438 return false; | 438 return false; |
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1300 agent_->WillSendSubmitEvent(frame, form); | 1300 agent_->WillSendSubmitEvent(frame, form); |
1301 } | 1301 } |
1302 | 1302 |
1303 void PasswordAutofillAgent::LegacyPasswordAutofillAgent::WillSubmitForm( | 1303 void PasswordAutofillAgent::LegacyPasswordAutofillAgent::WillSubmitForm( |
1304 blink::WebLocalFrame* frame, | 1304 blink::WebLocalFrame* frame, |
1305 const blink::WebFormElement& form) { | 1305 const blink::WebFormElement& form) { |
1306 agent_->WillSubmitForm(frame, form); | 1306 agent_->WillSubmitForm(frame, form); |
1307 } | 1307 } |
1308 | 1308 |
1309 } // namespace autofill | 1309 } // namespace autofill |
OLD | NEW |