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

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

Issue 1415183004: Add WebDocument::isMobileFriendly() to blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@webkit
Patch Set: Created 5 years, 1 month 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 | « no previous file | third_party/WebKit/public/web/WebDocument.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/WebDocument.cpp
diff --git a/third_party/WebKit/Source/web/WebDocument.cpp b/third_party/WebKit/Source/web/WebDocument.cpp
index 8931b88119c87fcc0724bb90697e608ac04d596a..be3d67d2f0b322dc8240c937a18c5318883433e2 100644
--- a/third_party/WebKit/Source/web/WebDocument.cpp
+++ b/third_party/WebKit/Source/web/WebDocument.cpp
@@ -44,6 +44,7 @@
#include "core/dom/Fullscreen.h"
#include "core/dom/StyleEngine.h"
#include "core/events/Event.h"
+#include "core/frame/FrameHost.h"
#include "core/html/HTMLAllCollection.h"
#include "core/html/HTMLBodyElement.h"
#include "core/html/HTMLCollection.h"
@@ -329,6 +330,14 @@ WebDistillabilityFeatures WebDocument::distillabilityFeatures()
return DocumentStatisticsCollector::collectStatistics(*unwrap<Document>());
}
+bool WebDocument::isMobileFriendly()
+{
+ FrameHost* frameHost = unwrap<Document>()->frameHost();
+ if (!frameHost)
+ return false;
+ return frameHost->visualViewport().shouldDisableDesktopWorkarounds();
+}
+
WebDocument::WebDocument(const PassRefPtrWillBeRawPtr<Document>& elem)
: WebNode(elem)
{
« no previous file with comments | « no previous file | third_party/WebKit/public/web/WebDocument.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698