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

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

Issue 1690493002: Switch to LayoutThemeMobile when emulating mobile device in DevTools. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more mac compile Created 4 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: third_party/WebKit/Source/web/DevToolsEmulator.cpp
diff --git a/third_party/WebKit/Source/web/DevToolsEmulator.cpp b/third_party/WebKit/Source/web/DevToolsEmulator.cpp
index bdf02329725645f88ae76bcdf9d2dccc50ff89b3..9b556bd6c9ae1f1b09a2ca7279eef0b0c11ede88 100644
--- a/third_party/WebKit/Source/web/DevToolsEmulator.cpp
+++ b/third_party/WebKit/Source/web/DevToolsEmulator.cpp
@@ -8,6 +8,7 @@
#include "core/frame/FrameView.h"
#include "core/frame/Settings.h"
#include "core/page/Page.h"
+#include "core/style/ComputedStyle.h"
#include "platform/RuntimeEnabledFeatures.h"
#include "public/platform/WebLayerTreeView.h"
#include "web/WebInputEventConversion.h"
@@ -51,6 +52,7 @@ DevToolsEmulator::DevToolsEmulator(WebViewImpl* webViewImpl)
, m_deviceMetricsEnabled(false)
, m_emulateMobileEnabled(false)
, m_isOverlayScrollbarsEnabled(false)
+ , m_isMobileLayoutThemeEnabled(false)
, m_originalDefaultMinimumPageScaleFactor(0)
, m_originalDefaultMaximumPageScaleFactor(0)
, m_embedderTextAutosizingEnabled(webViewImpl->page()->settings().textAutosizingEnabled())
@@ -255,6 +257,9 @@ void DevToolsEmulator::enableMobileEmulation()
m_emulateMobileEnabled = true;
m_isOverlayScrollbarsEnabled = RuntimeEnabledFeatures::overlayScrollbarsEnabled();
RuntimeEnabledFeatures::setOverlayScrollbarsEnabled(true);
+ m_isMobileLayoutThemeEnabled = RuntimeEnabledFeatures::mobileLayoutThemeEnabled();
+ RuntimeEnabledFeatures::setMobileLayoutThemeEnabled(true);
dgozman 2016/02/11 18:53:44 I was thinking about testing this, but didn't come
+ ComputedStyle::clearInitialStyle();
m_webViewImpl->page()->settings().setUseMobileViewportStyle(true);
m_webViewImpl->enableViewport();
m_webViewImpl->settings()->setViewportMetaEnabled(true);
@@ -284,6 +289,8 @@ void DevToolsEmulator::disableMobileEmulation()
if (!m_emulateMobileEnabled)
return;
RuntimeEnabledFeatures::setOverlayScrollbarsEnabled(m_isOverlayScrollbarsEnabled);
+ RuntimeEnabledFeatures::setMobileLayoutThemeEnabled(m_isMobileLayoutThemeEnabled);
+ ComputedStyle::clearInitialStyle();
m_webViewImpl->disableViewport();
m_webViewImpl->settings()->setViewportMetaEnabled(false);
m_webViewImpl->page()->frameHost().visualViewport().initializeScrollbars();

Powered by Google App Engine
This is Rietveld 408576698