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

Unified Diff: third_party/WebKit/Source/web/ChromeClientImpl.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/ChromeClientImpl.cpp
diff --git a/third_party/WebKit/Source/web/ChromeClientImpl.cpp b/third_party/WebKit/Source/web/ChromeClientImpl.cpp
index e728623d5c978578683a6067ec101d77ecff7e96..abd6d27d618af17f98af1063f4d90741030be7da 100644
--- a/third_party/WebKit/Source/web/ChromeClientImpl.cpp
+++ b/third_party/WebKit/Source/web/ChromeClientImpl.cpp
@@ -64,6 +64,7 @@
#include "platform/weborigin/SecurityOrigin.h"
#include "public/platform/Platform.h"
#include "public/platform/WebCursorInfo.h"
+#include "public/platform/WebFloatRect.h"
#include "public/platform/WebFrameScheduler.h"
#include "public/platform/WebRect.h"
#include "public/platform/WebURLRequest.h"
@@ -519,6 +520,14 @@ IntRect ChromeClientImpl::viewportToScreen(const IntRect& rectInViewport) const
return screenRect;
}
+FloatRect ChromeClientImpl::windowToViewport(const FloatRect& rectInWindow) const
+{
+ WebFloatRect viewportRect(rectInWindow);
+ if (m_webView->client())
+ m_webView->client()->convertWindowToViewport(&viewportRect);
+ return viewportRect;
+}
+
WebScreenInfo ChromeClientImpl::screenInfo() const
{
return m_webView->client() ? m_webView->client()->screenInfo() : WebScreenInfo();

Powered by Google App Engine
This is Rietveld 408576698