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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 IPC_MESSAGE_HANDLER(AutofillMsg_ClearPreviewedForm, OnClearPreviewedForm) | 166 IPC_MESSAGE_HANDLER(AutofillMsg_ClearPreviewedForm, OnClearPreviewedForm) |
167 IPC_MESSAGE_HANDLER(AutofillMsg_FillFieldWithValue, OnFillFieldWithValue) | 167 IPC_MESSAGE_HANDLER(AutofillMsg_FillFieldWithValue, OnFillFieldWithValue) |
168 IPC_MESSAGE_HANDLER(AutofillMsg_PreviewFieldWithValue, | 168 IPC_MESSAGE_HANDLER(AutofillMsg_PreviewFieldWithValue, |
169 OnPreviewFieldWithValue) | 169 OnPreviewFieldWithValue) |
170 IPC_MESSAGE_HANDLER(AutofillMsg_AcceptDataListSuggestion, | 170 IPC_MESSAGE_HANDLER(AutofillMsg_AcceptDataListSuggestion, |
171 OnAcceptDataListSuggestion) | 171 OnAcceptDataListSuggestion) |
172 IPC_MESSAGE_HANDLER(AutofillMsg_FillPasswordSuggestion, | 172 IPC_MESSAGE_HANDLER(AutofillMsg_FillPasswordSuggestion, |
173 OnFillPasswordSuggestion) | 173 OnFillPasswordSuggestion) |
174 IPC_MESSAGE_HANDLER(AutofillMsg_PreviewPasswordSuggestion, | 174 IPC_MESSAGE_HANDLER(AutofillMsg_PreviewPasswordSuggestion, |
175 OnPreviewPasswordSuggestion) | 175 OnPreviewPasswordSuggestion) |
176 IPC_MESSAGE_HANDLER(AutofillMsg_PopupHidden, OnPopupHidden) | |
177 IPC_MESSAGE_HANDLER(AutofillMsg_RequestAutocompleteResult, | 176 IPC_MESSAGE_HANDLER(AutofillMsg_RequestAutocompleteResult, |
178 OnRequestAutocompleteResult) | 177 OnRequestAutocompleteResult) |
179 IPC_MESSAGE_UNHANDLED(handled = false) | 178 IPC_MESSAGE_UNHANDLED(handled = false) |
180 IPC_END_MESSAGE_MAP() | 179 IPC_END_MESSAGE_MAP() |
181 return handled; | 180 return handled; |
182 } | 181 } |
183 | 182 |
184 void AutofillAgent::DidCommitProvisionalLoad(bool is_new_navigation) { | 183 void AutofillAgent::DidCommitProvisionalLoad(bool is_new_navigation) { |
185 form_cache_.Reset(); | 184 form_cache_.Reset(); |
186 } | 185 } |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 void AutofillAgent::OnPreviewPasswordSuggestion( | 551 void AutofillAgent::OnPreviewPasswordSuggestion( |
553 const base::string16& username, | 552 const base::string16& username, |
554 const base::string16& password) { | 553 const base::string16& password) { |
555 bool handled = password_autofill_agent_->PreviewSuggestion( | 554 bool handled = password_autofill_agent_->PreviewSuggestion( |
556 element_, | 555 element_, |
557 username, | 556 username, |
558 password); | 557 password); |
559 DCHECK(handled); | 558 DCHECK(handled); |
560 } | 559 } |
561 | 560 |
562 void AutofillAgent::OnPopupHidden() { | |
563 if (!element_.isNull()) | |
564 OnClearPreviewedForm(); | |
565 } | |
566 | |
567 void AutofillAgent::OnRequestAutocompleteResult( | 561 void AutofillAgent::OnRequestAutocompleteResult( |
568 WebFormElement::AutocompleteResult result, | 562 WebFormElement::AutocompleteResult result, |
569 const base::string16& message, | 563 const base::string16& message, |
570 const FormData& form_data) { | 564 const FormData& form_data) { |
571 if (in_flight_request_form_.isNull()) | 565 if (in_flight_request_form_.isNull()) |
572 return; | 566 return; |
573 | 567 |
574 if (result == WebFormElement::AutocompleteResultSuccess) { | 568 if (result == WebFormElement::AutocompleteResultSuccess) { |
575 FillFormIncludingNonFocusableElements(form_data, in_flight_request_form_); | 569 FillFormIncludingNonFocusableElements(form_data, in_flight_request_form_); |
576 if (!in_flight_request_form_.checkValidity()) | 570 if (!in_flight_request_form_.checkValidity()) |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 | 782 |
789 void AutofillAgent::LegacyAutofillAgent::OnDestruct() { | 783 void AutofillAgent::LegacyAutofillAgent::OnDestruct() { |
790 // No-op. Don't delete |this|. | 784 // No-op. Don't delete |this|. |
791 } | 785 } |
792 | 786 |
793 void AutofillAgent::LegacyAutofillAgent::FocusChangeComplete() { | 787 void AutofillAgent::LegacyAutofillAgent::FocusChangeComplete() { |
794 agent_->FocusChangeComplete(); | 788 agent_->FocusChangeComplete(); |
795 } | 789 } |
796 | 790 |
797 } // namespace autofill | 791 } // namespace autofill |
OLD | NEW |