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

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

Issue 1641003003: [DevTools] Small cleanup after device mode v2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@device-mode-cleanup-split
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/InspectorEmulationAgent.cpp
diff --git a/third_party/WebKit/Source/web/InspectorEmulationAgent.cpp b/third_party/WebKit/Source/web/InspectorEmulationAgent.cpp
index 2d57f057f72a31ba7fc8e9c2938507590d91f77b..d33011a355694539ac90b16b5c9bb7a2c9b3b708 100644
--- a/third_party/WebKit/Source/web/InspectorEmulationAgent.cpp
+++ b/third_party/WebKit/Source/web/InspectorEmulationAgent.cpp
@@ -31,7 +31,6 @@ InspectorEmulationAgent::InspectorEmulationAgent(WebLocalFrameImpl* webLocalFram
, m_webLocalFrameImpl(webLocalFrameImpl)
, m_client(client)
{
- webViewImpl()->devToolsEmulator()->setEmulationAgent(this);
}
InspectorEmulationAgent::~InspectorEmulationAgent()
@@ -61,17 +60,6 @@ void InspectorEmulationAgent::disable(ErrorString*)
setEmulatedMedia(&error, String());
}
-void InspectorEmulationAgent::discardAgent()
-{
- webViewImpl()->devToolsEmulator()->setEmulationAgent(nullptr);
-}
-
-void InspectorEmulationAgent::didCommitLoadForLocalFrame(LocalFrame* frame)
-{
- if (frame == m_webLocalFrameImpl->frame())
- viewportChanged();
-}
-
void InspectorEmulationAgent::resetPageScaleFactor(ErrorString*)
{
webViewImpl()->resetScaleStateImmediately();
@@ -105,30 +93,6 @@ void InspectorEmulationAgent::setCPUThrottlingRate(ErrorString*, double throttli
m_client->setCPUThrottlingRate(throttlingRate);
}
-void InspectorEmulationAgent::viewportChanged()
-{
- if (!webViewImpl()->devToolsEmulator()->deviceEmulationEnabled() || !frontend())
- return;
-
- FrameView* view = m_webLocalFrameImpl->frameView();
- if (!view)
- return;
-
- IntSize contentsSize = view->contentsSize();
- FloatPoint scrollOffset;
- scrollOffset = FloatPoint(view->scrollableArea()->visibleContentRectDouble().location());
-
- RefPtr<TypeBuilder::Emulation::Viewport> viewport = TypeBuilder::Emulation::Viewport::create()
- .setScrollX(scrollOffset.x())
- .setScrollY(scrollOffset.y())
- .setContentsWidth(contentsSize.width())
- .setContentsHeight(contentsSize.height())
- .setPageScaleFactor(webViewImpl()->page()->pageScaleFactor())
- .setMinimumPageScaleFactor(webViewImpl()->minimumPageScaleFactor())
- .setMaximumPageScaleFactor(webViewImpl()->maximumPageScaleFactor());
- frontend()->viewportChanged(viewport);
-}
-
DEFINE_TRACE(InspectorEmulationAgent)
{
visitor->trace(m_webLocalFrameImpl);
« no previous file with comments | « third_party/WebKit/Source/web/InspectorEmulationAgent.h ('k') | third_party/WebKit/Source/web/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698