Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(369)

Side by Side Diff: components/autofill/content/renderer/autofill_agent.cc

Issue 1516723003: [Element / Autofill] Add boundsInViewportFloat() to fix <input> popup misalignment. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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/WebFloatRect.h"
39 #include "third_party/WebKit/public/platform/WebRect.h" 40 #include "third_party/WebKit/public/platform/WebRect.h"
40 #include "third_party/WebKit/public/platform/WebURLRequest.h" 41 #include "third_party/WebKit/public/platform/WebURLRequest.h"
41 #include "third_party/WebKit/public/web/WebConsoleMessage.h" 42 #include "third_party/WebKit/public/web/WebConsoleMessage.h"
42 #include "third_party/WebKit/public/web/WebDataSource.h" 43 #include "third_party/WebKit/public/web/WebDataSource.h"
43 #include "third_party/WebKit/public/web/WebDocument.h" 44 #include "third_party/WebKit/public/web/WebDocument.h"
44 #include "third_party/WebKit/public/web/WebElementCollection.h" 45 #include "third_party/WebKit/public/web/WebElementCollection.h"
45 #include "third_party/WebKit/public/web/WebFormControlElement.h" 46 #include "third_party/WebKit/public/web/WebFormControlElement.h"
46 #include "third_party/WebKit/public/web/WebFormElement.h" 47 #include "third_party/WebKit/public/web/WebFormElement.h"
47 #include "third_party/WebKit/public/web/WebInputEvent.h" 48 #include "third_party/WebKit/public/web/WebInputEvent.h"
48 #include "third_party/WebKit/public/web/WebLocalFrame.h" 49 #include "third_party/WebKit/public/web/WebLocalFrame.h"
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 &data_list_labels); 729 &data_list_labels);
729 TrimStringVectorForIPC(&data_list_values); 730 TrimStringVectorForIPC(&data_list_values);
730 TrimStringVectorForIPC(&data_list_labels); 731 TrimStringVectorForIPC(&data_list_labels);
731 } 732 }
732 733
733 is_popup_possibly_visible_ = true; 734 is_popup_possibly_visible_ = true;
734 Send(new AutofillHostMsg_SetDataList(routing_id(), 735 Send(new AutofillHostMsg_SetDataList(routing_id(),
735 data_list_values, 736 data_list_values,
736 data_list_labels)); 737 data_list_labels));
737 738
738 blink::WebRect bounding_box_in_window = element_.boundsInViewport(); 739 blink::WebFloatRect bounding_box_in_window = element_.boundsInViewportFloat();
740
739 render_frame()->GetRenderView()->convertViewportToWindow( 741 render_frame()->GetRenderView()->convertViewportToWindow(
740 &bounding_box_in_window); 742 &bounding_box_in_window);
741 743
742 Send(new AutofillHostMsg_QueryFormFieldAutofill( 744 Send(new AutofillHostMsg_QueryFormFieldAutofill(
743 routing_id(), autofill_query_id_, form, field, 745 routing_id(), autofill_query_id_, form, field,
744 gfx::RectF(bounding_box_in_window))); 746 gfx::RectF(bounding_box_in_window)));
745 } 747 }
746 748
747 void AutofillAgent::FillFieldWithValue(const base::string16& value, 749 void AutofillAgent::FillFieldWithValue(const base::string16& value,
748 WebInputElement* node) { 750 WebInputElement* node) {
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 822
821 void AutofillAgent::LegacyAutofillAgent::OnDestruct() { 823 void AutofillAgent::LegacyAutofillAgent::OnDestruct() {
822 // No-op. Don't delete |this|. 824 // No-op. Don't delete |this|.
823 } 825 }
824 826
825 void AutofillAgent::LegacyAutofillAgent::FocusChangeComplete() { 827 void AutofillAgent::LegacyAutofillAgent::FocusChangeComplete() {
826 agent_->FocusChangeComplete(); 828 agent_->FocusChangeComplete();
827 } 829 }
828 830
829 } // namespace autofill 831 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698