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

Unified Diff: chrome/renderer/autofill/autofill_agent.cc

Issue 12188020: Adding the page and DPI scale adjustment for Autofill Popups. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/autofill/autofill_agent.cc
diff --git a/chrome/renderer/autofill/autofill_agent.cc b/chrome/renderer/autofill/autofill_agent.cc
index f5c3bc8c016d66de409ef106d9acf7c13875fa75..ed6b5d87d2cd5742d5d0a6d336a6de683c0f3949 100644
--- a/chrome/renderer/autofill/autofill_agent.cc
+++ b/chrome/renderer/autofill/autofill_agent.cc
@@ -135,6 +135,7 @@ AutofillAgent::AutofillAgent(
autofill_query_id_(0),
autofill_action_(AUTOFILL_NONE),
topmost_frame_(NULL),
+ web_view_(render_view->GetWebView()),
display_warning_if_disabled_(false),
was_query_node_autofilled_(false),
has_shown_autofill_popup_for_current_edit_(false),
@@ -766,6 +767,12 @@ void AutofillAgent::QueryAutofillSuggestions(const WebInputElement& element,
gfx::Rect bounding_box(element_.boundsInViewportSpace());
+ float scale = web_view_->pageScaleFactor();
+ gfx::RectF bounding_box_scaled(bounding_box.x() * scale,
+ bounding_box.y() * scale,
+ bounding_box.width() * scale,
+ bounding_box.height() * scale);
+
// Find the datalist values and send them to the browser process.
std::vector<string16> data_list_values;
std::vector<string16> data_list_labels;
@@ -796,7 +803,7 @@ void AutofillAgent::QueryAutofillSuggestions(const WebInputElement& element,
autofill_query_id_,
form,
field,
- bounding_box,
+ bounding_box_scaled,
display_warning_if_disabled));
}

Powered by Google App Engine
This is Rietveld 408576698