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

Side by Side Diff: third_party/WebKit/Source/core/dom/DocumentStatisticsCollector.cpp

Issue 2443753002: Count presence of viewport tag as mobile-friendly
Patch Set: default false Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/ViewportDescription.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "DocumentStatisticsCollector.h" 5 #include "DocumentStatisticsCollector.h"
6 6
7 #include "core/HTMLNames.h" 7 #include "core/HTMLNames.h"
8 #include "core/InputTypeNames.h" 8 #include "core/InputTypeNames.h"
9 #include "core/dom/ElementTraversal.h" 9 #include "core/dom/ElementTraversal.h"
10 #include "core/dom/NodeComputedStyle.h" 10 #include "core/dom/NodeComputedStyle.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 if (meta.name() == ogType || meta.getAttribute(propertyAttr) == ogType) { 174 if (meta.name() == ogType || meta.getAttribute(propertyAttr) == ogType) {
175 if (equalIgnoringCase(meta.content(), "article")) { 175 if (equalIgnoringCase(meta.content(), "article")) {
176 return true; 176 return true;
177 } 177 }
178 } 178 }
179 } 179 }
180 return false; 180 return false;
181 } 181 }
182 182
183 bool isMobileFriendly(Document& document) { 183 bool isMobileFriendly(Document& document) {
184 if (FrameHost* frameHost = document.frameHost()) 184 return document.viewportDescription().isSpecifiedByAuthor();
185 return frameHost->visualViewport().shouldDisableDesktopWorkarounds();
186 return false;
187 } 185 }
188 186
189 } // namespace 187 } // namespace
190 188
191 WebDistillabilityFeatures DocumentStatisticsCollector::collectStatistics( 189 WebDistillabilityFeatures DocumentStatisticsCollector::collectStatistics(
192 Document& document) { 190 Document& document) {
193 TRACE_EVENT0("blink", "DocumentStatisticsCollector::collectStatistics"); 191 TRACE_EVENT0("blink", "DocumentStatisticsCollector::collectStatistics");
194 192
195 WebDistillabilityFeatures features = WebDistillabilityFeatures(); 193 WebDistillabilityFeatures features = WebDistillabilityFeatures();
196 194
(...skipping 23 matching lines...) Expand all
220 double elapsedTime = monotonicallyIncreasingTime() - startTime; 218 double elapsedTime = monotonicallyIncreasingTime() - startTime;
221 219
222 DEFINE_STATIC_LOCAL(CustomCountHistogram, distillabilityHistogram, 220 DEFINE_STATIC_LOCAL(CustomCountHistogram, distillabilityHistogram,
223 ("WebCore.DistillabilityUs", 1, 1000000, 50)); 221 ("WebCore.DistillabilityUs", 1, 1000000, 50));
224 distillabilityHistogram.count(static_cast<int>(1e6 * elapsedTime)); 222 distillabilityHistogram.count(static_cast<int>(1e6 * elapsedTime));
225 223
226 return features; 224 return features;
227 } 225 }
228 226
229 } // namespace blink 227 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/ViewportDescription.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698