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 <tuple> | 7 #include <tuple> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "components/autofill/core/common/form_data.h" | 29 #include "components/autofill/core/common/form_data.h" |
30 #include "components/autofill/core/common/form_data_predictions.h" | 30 #include "components/autofill/core/common/form_data_predictions.h" |
31 #include "components/autofill/core/common/form_field_data.h" | 31 #include "components/autofill/core/common/form_field_data.h" |
32 #include "components/autofill/core/common/password_form.h" | 32 #include "components/autofill/core/common/password_form.h" |
33 #include "content/public/common/content_switches.h" | 33 #include "content/public/common/content_switches.h" |
34 #include "content/public/common/ssl_status.h" | 34 #include "content/public/common/ssl_status.h" |
35 #include "content/public/common/url_constants.h" | 35 #include "content/public/common/url_constants.h" |
36 #include "content/public/renderer/render_frame.h" | 36 #include "content/public/renderer/render_frame.h" |
37 #include "content/public/renderer/render_view.h" | 37 #include "content/public/renderer/render_view.h" |
38 #include "net/cert/cert_status_flags.h" | 38 #include "net/cert/cert_status_flags.h" |
39 #include "third_party/WebKit/public/platform/WebRect.h" | 39 #include "third_party/WebKit/public/platform/WebFloatRect.h" |
40 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 40 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
41 #include "third_party/WebKit/public/web/WebConsoleMessage.h" | 41 #include "third_party/WebKit/public/web/WebConsoleMessage.h" |
42 #include "third_party/WebKit/public/web/WebDataSource.h" | 42 #include "third_party/WebKit/public/web/WebDataSource.h" |
43 #include "third_party/WebKit/public/web/WebDocument.h" | 43 #include "third_party/WebKit/public/web/WebDocument.h" |
44 #include "third_party/WebKit/public/web/WebElementCollection.h" | 44 #include "third_party/WebKit/public/web/WebElementCollection.h" |
45 #include "third_party/WebKit/public/web/WebFormControlElement.h" | 45 #include "third_party/WebKit/public/web/WebFormControlElement.h" |
46 #include "third_party/WebKit/public/web/WebFormElement.h" | 46 #include "third_party/WebKit/public/web/WebFormElement.h" |
47 #include "third_party/WebKit/public/web/WebInputEvent.h" | 47 #include "third_party/WebKit/public/web/WebInputEvent.h" |
48 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 48 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
49 #include "third_party/WebKit/public/web/WebNode.h" | 49 #include "third_party/WebKit/public/web/WebNode.h" |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
728 &data_list_labels); | 728 &data_list_labels); |
729 TrimStringVectorForIPC(&data_list_values); | 729 TrimStringVectorForIPC(&data_list_values); |
730 TrimStringVectorForIPC(&data_list_labels); | 730 TrimStringVectorForIPC(&data_list_labels); |
731 } | 731 } |
732 | 732 |
733 is_popup_possibly_visible_ = true; | 733 is_popup_possibly_visible_ = true; |
734 Send(new AutofillHostMsg_SetDataList(routing_id(), | 734 Send(new AutofillHostMsg_SetDataList(routing_id(), |
735 data_list_values, | 735 data_list_values, |
736 data_list_labels)); | 736 data_list_labels)); |
737 | 737 |
738 blink::WebRect bounding_box_in_window = element_.boundsInViewport(); | 738 blink::WebFloatRect bounding_box_in_window; |
739 render_frame()->GetRenderView()->convertViewportToWindow( | 739 render_frame()->GetRenderView()->getElementBoundingBoxWindow(&element_, |
740 &bounding_box_in_window); | 740 &bounding_box_in_window); |
741 | |
742 Send(new AutofillHostMsg_QueryFormFieldAutofill( | 741 Send(new AutofillHostMsg_QueryFormFieldAutofill( |
743 routing_id(), autofill_query_id_, form, field, | 742 routing_id(), autofill_query_id_, form, field, |
744 gfx::RectF(bounding_box_in_window))); | 743 gfx::RectF(bounding_box_in_window))); |
745 } | 744 } |
746 | 745 |
747 void AutofillAgent::FillFieldWithValue(const base::string16& value, | 746 void AutofillAgent::FillFieldWithValue(const base::string16& value, |
748 WebInputElement* node) { | 747 WebInputElement* node) { |
749 base::AutoReset<bool> auto_reset(&ignore_text_changes_, true); | 748 base::AutoReset<bool> auto_reset(&ignore_text_changes_, true); |
750 node->setEditingValue(value.substr(0, node->maxLength())); | 749 node->setEditingValue(value.substr(0, node->maxLength())); |
751 } | 750 } |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
820 | 819 |
821 void AutofillAgent::LegacyAutofillAgent::OnDestruct() { | 820 void AutofillAgent::LegacyAutofillAgent::OnDestruct() { |
822 // No-op. Don't delete |this|. | 821 // No-op. Don't delete |this|. |
823 } | 822 } |
824 | 823 |
825 void AutofillAgent::LegacyAutofillAgent::FocusChangeComplete() { | 824 void AutofillAgent::LegacyAutofillAgent::FocusChangeComplete() { |
826 agent_->FocusChangeComplete(); | 825 agent_->FocusChangeComplete(); |
827 } | 826 } |
828 | 827 |
829 } // namespace autofill | 828 } // namespace autofill |
OLD | NEW |