Chromium Code Reviews| 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 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 455 | 455 |
| 456 void AutofillAgent::OnSetNodeText(const base::string16& value) { | 456 void AutofillAgent::OnSetNodeText(const base::string16& value) { |
| 457 SetNodeText(value, &element_); | 457 SetNodeText(value, &element_); |
| 458 } | 458 } |
| 459 | 459 |
| 460 void AutofillAgent::OnAcceptDataListSuggestion(const base::string16& value) { | 460 void AutofillAgent::OnAcceptDataListSuggestion(const base::string16& value) { |
| 461 AcceptDataListSuggestion(value); | 461 AcceptDataListSuggestion(value); |
| 462 } | 462 } |
| 463 | 463 |
| 464 void AutofillAgent::OnAcceptPasswordAutofillSuggestion( | 464 void AutofillAgent::OnAcceptPasswordAutofillSuggestion( |
| 465 const base::string16& username) { | 465 const base::string16& username, |
| 466 // We need to make sure this is handled here because the browser process | 466 const base::string16& password) { |
|
Patrick Dubroy
2014/03/05 16:31:50
I delete this comment because I'm not sure that it
| |
| 467 // skipped it handling because it believed it would be handled here. If it | 467 bool handled = password_autofill_agent_->AcceptAutofillSuggestionWithPassword( |
| 468 // isn't handled here then the browser logic needs to be updated. | |
| 469 bool handled = password_autofill_agent_->DidAcceptAutofillSuggestion( | |
| 470 element_, | 468 element_, |
| 471 username); | 469 username, |
| 470 password); | |
| 472 DCHECK(handled); | 471 DCHECK(handled); |
| 473 } | 472 } |
| 474 | 473 |
| 475 void AutofillAgent::OnRequestAutocompleteResult( | 474 void AutofillAgent::OnRequestAutocompleteResult( |
| 476 WebFormElement::AutocompleteResult result, const FormData& form_data) { | 475 WebFormElement::AutocompleteResult result, const FormData& form_data) { |
| 477 if (in_flight_request_form_.isNull()) | 476 if (in_flight_request_form_.isNull()) |
| 478 return; | 477 return; |
| 479 | 478 |
| 480 if (result == WebFormElement::AutocompleteResultSuccess) { | 479 if (result == WebFormElement::AutocompleteResultSuccess) { |
| 481 FillFormIncludingNonFocusableElements(form_data, in_flight_request_form_); | 480 FillFormIncludingNonFocusableElements(form_data, in_flight_request_form_); |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 635 // Only monitors dynamic forms created in the top frame. Dynamic forms | 634 // Only monitors dynamic forms created in the top frame. Dynamic forms |
| 636 // inserted in iframes are not captured yet. | 635 // inserted in iframes are not captured yet. |
| 637 if (!frame->parent()) { | 636 if (!frame->parent()) { |
| 638 password_autofill_agent_->OnDynamicFormsSeen(frame); | 637 password_autofill_agent_->OnDynamicFormsSeen(frame); |
| 639 return; | 638 return; |
| 640 } | 639 } |
| 641 } | 640 } |
| 642 } | 641 } |
| 643 | 642 |
| 644 } // namespace autofill | 643 } // namespace autofill |
| OLD | NEW |