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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/public/web/WebDocument.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 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 26 matching lines...) Expand all
37 #include "bindings/core/v8/V8ElementRegistrationOptions.h" 37 #include "bindings/core/v8/V8ElementRegistrationOptions.h"
38 #include "core/css/StyleSheetContents.h" 38 #include "core/css/StyleSheetContents.h"
39 #include "core/dom/CSSSelectorWatch.h" 39 #include "core/dom/CSSSelectorWatch.h"
40 #include "core/dom/Document.h" 40 #include "core/dom/Document.h"
41 #include "core/dom/DocumentStatisticsCollector.h" 41 #include "core/dom/DocumentStatisticsCollector.h"
42 #include "core/dom/DocumentType.h" 42 #include "core/dom/DocumentType.h"
43 #include "core/dom/Element.h" 43 #include "core/dom/Element.h"
44 #include "core/dom/Fullscreen.h" 44 #include "core/dom/Fullscreen.h"
45 #include "core/dom/StyleEngine.h" 45 #include "core/dom/StyleEngine.h"
46 #include "core/events/Event.h" 46 #include "core/events/Event.h"
47 #include "core/frame/FrameHost.h"
47 #include "core/html/HTMLAllCollection.h" 48 #include "core/html/HTMLAllCollection.h"
48 #include "core/html/HTMLBodyElement.h" 49 #include "core/html/HTMLBodyElement.h"
49 #include "core/html/HTMLCollection.h" 50 #include "core/html/HTMLCollection.h"
50 #include "core/html/HTMLElement.h" 51 #include "core/html/HTMLElement.h"
51 #include "core/html/HTMLFormElement.h" 52 #include "core/html/HTMLFormElement.h"
52 #include "core/html/HTMLHeadElement.h" 53 #include "core/html/HTMLHeadElement.h"
53 #include "core/html/HTMLLinkElement.h" 54 #include "core/html/HTMLLinkElement.h"
54 #include "core/layout/LayoutObject.h" 55 #include "core/layout/LayoutObject.h"
55 #include "core/layout/LayoutView.h" 56 #include "core/layout/LayoutView.h"
56 #include "core/loader/DocumentLoader.h" 57 #include "core/loader/DocumentLoader.h"
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 if (!linkElement) 323 if (!linkElement)
323 return false; 324 return false;
324 return equalIgnoringCase(linkElement->fastGetAttribute(HTMLNames::crossorigi nAttr), "use-credentials"); 325 return equalIgnoringCase(linkElement->fastGetAttribute(HTMLNames::crossorigi nAttr), "use-credentials");
325 } 326 }
326 327
327 WebDistillabilityFeatures WebDocument::distillabilityFeatures() 328 WebDistillabilityFeatures WebDocument::distillabilityFeatures()
328 { 329 {
329 return DocumentStatisticsCollector::collectStatistics(*unwrap<Document>()); 330 return DocumentStatisticsCollector::collectStatistics(*unwrap<Document>());
330 } 331 }
331 332
333 bool WebDocument::isMobileFriendly()
334 {
335 FrameHost* frameHost = unwrap<Document>()->frameHost();
336 if (!frameHost)
337 return false;
338 return frameHost->visualViewport().shouldDisableDesktopWorkarounds();
339 }
340
332 WebDocument::WebDocument(const PassRefPtrWillBeRawPtr<Document>& elem) 341 WebDocument::WebDocument(const PassRefPtrWillBeRawPtr<Document>& elem)
333 : WebNode(elem) 342 : WebNode(elem)
334 { 343 {
335 } 344 }
336 345
337 DEFINE_WEB_NODE_TYPE_CASTS(WebDocument, constUnwrap<Node>()->isDocumentNode()); 346 DEFINE_WEB_NODE_TYPE_CASTS(WebDocument, constUnwrap<Node>()->isDocumentNode());
338 347
339 WebDocument& WebDocument::operator=(const PassRefPtrWillBeRawPtr<Document>& elem ) 348 WebDocument& WebDocument::operator=(const PassRefPtrWillBeRawPtr<Document>& elem )
340 { 349 {
341 m_private = elem; 350 m_private = elem;
342 return *this; 351 return *this;
343 } 352 }
344 353
345 WebDocument::operator PassRefPtrWillBeRawPtr<Document>() const 354 WebDocument::operator PassRefPtrWillBeRawPtr<Document>() const
346 { 355 {
347 return toDocument(m_private.get()); 356 return toDocument(m_private.get());
348 } 357 }
349 358
350 } // namespace blink 359 } // namespace blink
OLDNEW
« 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