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

Unified Diff: Source/web/WebFrameImpl.cpp

Issue 23187005: [DevTools] Use device metrics emulation implemented in content. (Closed) Base URL: svn://svn.chromium.org/blink/trunk/
Patch Set: Reupload Created 7 years, 3 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: Source/web/WebFrameImpl.cpp
diff --git a/Source/web/WebFrameImpl.cpp b/Source/web/WebFrameImpl.cpp
index 5a53a30f4d295dcf33e9b43264495b136ca34d42..758a307ae608c8ba3de95645ee660fe02d4d5e71 100644
--- a/Source/web/WebFrameImpl.cpp
+++ b/Source/web/WebFrameImpl.cpp
@@ -2085,6 +2085,7 @@ WebFrameImpl::WebFrameImpl(WebFrameClient* client)
, m_findMatchRectsAreValid(false)
, m_identifier(generateFrameIdentifier())
, m_inSameDocumentHistoryLoad(false)
+ , m_inputEventsScaleFactorForEmulation(1)
{
WebKit::Platform::current()->incrementStatsCounter(webFrameActiveCount);
frameCount++;
@@ -2195,11 +2196,10 @@ void WebFrameImpl::createFrameView()
if (webView->shouldAutoResize() && isMainFrame)
frame()->view()->enableAutoSizeMode(true, webView->minAutoSize(), webView->maxAutoSize());
+ frame()->view()->setInputEventsScaleFactorForEmulation(m_inputEventsScaleFactorForEmulation);
+
if (isMainFrame)
webView->suppressInvalidations(false);
-
- if (isMainFrame && webView->devToolsAgentPrivate())
- webView->devToolsAgentPrivate()->mainFrameViewCreated(this);
}
WebFrameImpl* WebFrameImpl::fromFrame(Frame* frame)
@@ -2314,6 +2314,13 @@ void WebFrameImpl::setCanHaveScrollbars(bool canHaveScrollbars)
frame()->view()->setCanHaveScrollbars(canHaveScrollbars);
}
+void WebFrameImpl::setInputEventsScaleFactorForEmulation(float contentScaleFactor)
+{
+ m_inputEventsScaleFactorForEmulation = contentScaleFactor;
+ if (frame()->view())
+ frame()->view()->setInputEventsScaleFactorForEmulation(m_inputEventsScaleFactorForEmulation);
+}
+
void WebFrameImpl::invalidateArea(AreaToInvalidate area)
{
ASSERT(frame() && frame()->view());

Powered by Google App Engine
This is Rietveld 408576698