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

Unified Diff: third_party/WebKit/Source/web/DateTimeChooserImpl.cpp

Issue 1603253003: Add dedicated windowToViewport method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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: third_party/WebKit/Source/web/DateTimeChooserImpl.cpp
diff --git a/third_party/WebKit/Source/web/DateTimeChooserImpl.cpp b/third_party/WebKit/Source/web/DateTimeChooserImpl.cpp
index 0818bfc2b1e7ba84d15e4392cfa270ce4c14ecf0..9f0e2a2ecfba706d1a8ae54f1c9cd9e48b0825f5 100644
--- a/third_party/WebKit/Source/web/DateTimeChooserImpl.cpp
+++ b/third_party/WebKit/Source/web/DateTimeChooserImpl.cpp
@@ -128,8 +128,7 @@ void DateTimeChooserImpl::writeDocument(SharedBuffer* data)
addString("</style></head><body><div id=main>Loading...</div><script>\n"
"window.dialogArguments = {\n", data);
addProperty("anchorRectInScreen", m_parameters.anchorRectInScreen, data);
- IntRect inScreen = m_chromeClient->viewportToScreen(IntRect(0, 0, 100, 0));
- float scaleFactor = 100.f / inScreen.width();
+ float scaleFactor = m_chromeClient->windowToViewport(FloatRect(0, 0, 1.0f, 0)).width();
addProperty("zoomFactor", zoomFactor() / scaleFactor, data);
addProperty("min", valueToDateTimeString(m_parameters.minimum, m_parameters.type), data);
addProperty("max", valueToDateTimeString(m_parameters.maximum, m_parameters.type), data);

Powered by Google App Engine
This is Rietveld 408576698