| 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/autofill_agent.h" | 5 #include "components/autofill/content/renderer/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/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 | 435 |
| 436 void AutofillAgent::OnSetNodeText(const base::string16& value) { | 436 void AutofillAgent::OnSetNodeText(const base::string16& value) { |
| 437 SetNodeText(value, &element_); | 437 SetNodeText(value, &element_); |
| 438 } | 438 } |
| 439 | 439 |
| 440 void AutofillAgent::OnAcceptDataListSuggestion(const base::string16& value) { | 440 void AutofillAgent::OnAcceptDataListSuggestion(const base::string16& value) { |
| 441 AcceptDataListSuggestion(value); | 441 AcceptDataListSuggestion(value); |
| 442 } | 442 } |
| 443 | 443 |
| 444 void AutofillAgent::OnAcceptPasswordAutofillSuggestion( | 444 void AutofillAgent::OnAcceptPasswordAutofillSuggestion( |
| 445 const base::string16& username) { | 445 const base::string16& username, |
| 446 // We need to make sure this is handled here because the browser process | 446 const base::string16& password) { |
| 447 // skipped it handling because it believed it would be handled here. If it | 447 bool handled = password_autofill_agent_->AcceptAutofillSuggestionWithPassword( |
| 448 // isn't handled here then the browser logic needs to be updated. | |
| 449 bool handled = password_autofill_agent_->DidAcceptAutofillSuggestion( | |
| 450 element_, | 448 element_, |
| 451 username); | 449 username, |
| 450 password); |
| 452 DCHECK(handled); | 451 DCHECK(handled); |
| 453 } | 452 } |
| 454 | 453 |
| 455 void AutofillAgent::OnRequestAutocompleteResult( | 454 void AutofillAgent::OnRequestAutocompleteResult( |
| 456 WebFormElement::AutocompleteResult result, const FormData& form_data) { | 455 WebFormElement::AutocompleteResult result, const FormData& form_data) { |
| 457 if (in_flight_request_form_.isNull()) | 456 if (in_flight_request_form_.isNull()) |
| 458 return; | 457 return; |
| 459 | 458 |
| 460 if (result == WebFormElement::AutocompleteResultSuccess) { | 459 if (result == WebFormElement::AutocompleteResultSuccess) { |
| 461 FillFormIncludingNonFocusableElements(form_data, in_flight_request_form_); | 460 FillFormIncludingNonFocusableElements(form_data, in_flight_request_form_); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 // Only monitors dynamic forms created in the top frame. Dynamic forms | 591 // Only monitors dynamic forms created in the top frame. Dynamic forms |
| 593 // inserted in iframes are not captured yet. | 592 // inserted in iframes are not captured yet. |
| 594 if (frame && !frame->parent()) { | 593 if (frame && !frame->parent()) { |
| 595 password_autofill_agent_->OnDynamicFormsSeen(frame); | 594 password_autofill_agent_->OnDynamicFormsSeen(frame); |
| 596 return; | 595 return; |
| 597 } | 596 } |
| 598 } | 597 } |
| 599 } | 598 } |
| 600 | 599 |
| 601 } // namespace autofill | 600 } // namespace autofill |
| OLD | NEW |