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

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

Issue 2443753002: Count presence of viewport tag as mobile-friendly
Patch Set: default false Created 4 years, 2 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
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.h ('k') | third_party/WebKit/Source/web/tests/ViewportTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/WebViewImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp
index 8fb1989aeac1d01e1a82051d1e5c418a1f46c09a..7c6da6a23c50cd7ced6ab8e203098b11e0eedb40 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -417,7 +417,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client,
m_rootLayer(nullptr),
m_rootGraphicsLayer(nullptr),
m_visualViewportContainerLayer(nullptr),
- m_matchesHeuristicsForGpuRasterization(false),
+ m_isDesktopSiteOnMobile(false),
m_flingModifier(0),
m_flingSourceDevice(WebGestureDeviceUninitialized),
m_fullscreenController(FullscreenController::create(this)),
@@ -869,8 +869,7 @@ WebInputEventResult WebViewImpl::handleGestureEvent(
WebDevToolsAgentImpl* devTools = mainFrameDevToolsAgentImpl();
VisualViewport& visualViewport = page()->frameHost().visualViewport();
bool screencastEnabled = devTools && devTools->screencastEnabled();
- if (event.data.tap.width > 0 &&
- !visualViewport.shouldDisableDesktopWorkarounds() &&
+ if (event.data.tap.width > 0 && m_isDesktopSiteOnMobile &&
!screencastEnabled) {
IntRect boundingBox(visualViewport.viewportToRootFrame(
IntRect(event.x - event.data.tap.width / 2,
@@ -2941,7 +2940,7 @@ bool WebViewImpl::scrollFocusedEditableElementIntoRect(
bool zoomInToLegibleScale =
m_webSettings->autoZoomFocusedNodeToLegibleScale() &&
- !page()->frameHost().visualViewport().shouldDisableDesktopWorkarounds();
+ m_isDesktopSiteOnMobile;
if (zoomInToLegibleScale) {
// When deciding whether to zoom in on a focused text box, we should decide
@@ -3357,20 +3356,21 @@ void WebViewImpl::updatePageDefinedViewportConstraints(
updateMainFrameLayoutSize();
// If we don't support mobile viewports, allow GPU rasterization.
- m_matchesHeuristicsForGpuRasterization = true;
- if (m_layerTreeView)
+ m_isDesktopSiteOnMobile = false;
+ if (m_layerTreeView) {
m_layerTreeView->heuristicsForGpuRasterizationUpdated(
- m_matchesHeuristicsForGpuRasterization);
+ !m_isDesktopSiteOnMobile);
+ }
return;
}
Document* document = page()->deprecatedLocalMainFrame()->document();
- m_matchesHeuristicsForGpuRasterization =
- description.matchesHeuristicsForGpuRasterization();
- if (m_layerTreeView)
+ m_isDesktopSiteOnMobile = !description.isSpecifiedByAuthor();
+ if (m_layerTreeView) {
m_layerTreeView->heuristicsForGpuRasterizationUpdated(
- m_matchesHeuristicsForGpuRasterization);
+ !m_isDesktopSiteOnMobile);
+ }
Length defaultMinWidth = document->viewportDefaultMinWidth();
if (defaultMinWidth.isAuto())
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.h ('k') | third_party/WebKit/Source/web/tests/ViewportTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698