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

Unified Diff: third_party/WebKit/Source/core/frame/VisualViewport.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/core/frame/VisualViewport.h ('k') | third_party/WebKit/Source/web/WebViewImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/frame/VisualViewport.cpp
diff --git a/third_party/WebKit/Source/core/frame/VisualViewport.cpp b/third_party/WebKit/Source/core/frame/VisualViewport.cpp
index c75ad1e66edb10b4ce1ead1bd5a75bc752191696..6a2d1aa920f41557de44e479e66a826eba83f137 100644
--- a/third_party/WebKit/Source/core/frame/VisualViewport.cpp
+++ b/third_party/WebKit/Source/core/frame/VisualViewport.cpp
@@ -31,6 +31,7 @@
#include "core/frame/VisualViewport.h"
#include "core/dom/DOMNodeIds.h"
+#include "core/dom/ViewportDescription.h"
#include "core/frame/FrameHost.h"
#include "core/frame/FrameView.h"
#include "core/frame/LocalFrame.h"
@@ -734,7 +735,8 @@ void VisualViewport::startTrackingPinchStats() {
if (!document->url().protocolIsInHTTPFamily())
return;
- m_trackPinchZoomStatsForPage = !shouldDisableDesktopWorkarounds();
+ m_trackPinchZoomStatsForPage =
+ !document->viewportDescription().isSpecifiedByAuthor();
}
void VisualViewport::userDidChangeScale() {
@@ -769,25 +771,6 @@ void VisualViewport::sendUMAMetrics() {
m_trackPinchZoomStatsForPage = false;
}
-bool VisualViewport::shouldDisableDesktopWorkarounds() const {
- if (!mainFrame() || !mainFrame()->view())
- return false;
-
- if (!mainFrame()->settings()->viewportEnabled())
- return false;
-
- // A document is considered adapted to small screen UAs if one of these holds:
- // 1. The author specified viewport has a constrained width that is equal to
- // the initial viewport width.
- // 2. The author has disabled viewport zoom.
- const PageScaleConstraints& constraints =
- frameHost().pageScaleConstraintsSet().pageDefinedConstraints();
-
- return mainFrame()->view()->layoutSize().width() == m_size.width() ||
- (constraints.minimumScale == constraints.maximumScale &&
- constraints.minimumScale != -1);
-}
-
CompositorAnimationTimeline* VisualViewport::compositorAnimationTimeline()
const {
ScrollingCoordinator* c = frameHost().page().scrollingCoordinator();
« no previous file with comments | « third_party/WebKit/Source/core/frame/VisualViewport.h ('k') | third_party/WebKit/Source/web/WebViewImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698