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

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

Issue 2651883008: Make content::FeaturePolicy implement WebFeaturePolicy, and use it in blink code (Closed)
Patch Set: Duplicate FP object rather than modifying in-place Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 10 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
(...skipping 11 matching lines...) Expand all
22 * 22 *
23 * You should have received a copy of the GNU Library General Public License 23 * You should have received a copy of the GNU Library General Public License
24 * along with this library; see the file COPYING.LIB. If not, write to 24 * along with this library; see the file COPYING.LIB. If not, write to
25 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 25 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
26 * Boston, MA 02110-1301, USA. 26 * Boston, MA 02110-1301, USA.
27 * 27 *
28 */ 28 */
29 29
30 #include "core/dom/Fullscreen.h" 30 #include "core/dom/Fullscreen.h"
31 31
32 #include "bindings/core/v8/ConditionalFeatures.h" 32 #include "bindings/core/v8/ConditionalFeaturesForCore.h"
33 #include "core/dom/Document.h" 33 #include "core/dom/Document.h"
34 #include "core/dom/ElementTraversal.h" 34 #include "core/dom/ElementTraversal.h"
35 #include "core/dom/StyleEngine.h" 35 #include "core/dom/StyleEngine.h"
36 #include "core/dom/TaskRunnerHelper.h" 36 #include "core/dom/TaskRunnerHelper.h"
37 #include "core/events/Event.h" 37 #include "core/events/Event.h"
38 #include "core/frame/FrameView.h" 38 #include "core/frame/FrameView.h"
39 #include "core/frame/HostsUsingFeatures.h" 39 #include "core/frame/HostsUsingFeatures.h"
40 #include "core/frame/LocalFrame.h" 40 #include "core/frame/LocalFrame.h"
41 #include "core/frame/Settings.h" 41 #include "core/frame/Settings.h"
42 #include "core/frame/UseCounter.h" 42 #include "core/frame/UseCounter.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 // 4. Return false. 80 // 4. Return false.
81 return false; 81 return false;
82 } 82 }
83 83
84 // If Feature Policy is enabled, then we need this hack to support it, until 84 // If Feature Policy is enabled, then we need this hack to support it, until
85 // we have proper support for <iframe allowfullscreen> in FP: 85 // we have proper support for <iframe allowfullscreen> in FP:
86 86
87 // 1. If FP, by itself, enables fullscreen in this document, then fullscreen 87 // 1. If FP, by itself, enables fullscreen in this document, then fullscreen
88 // is allowed. 88 // is allowed.
89 if (frame->securityContext()->getFeaturePolicy()->isFeatureEnabled( 89 if (isFeatureEnabledInFrame(WebFeaturePolicyFeature::Fullscreen, frame)) {
90 kFullscreenFeature)) {
91 return true; 90 return true;
92 } 91 }
93 92
94 // 2. Otherwise, if the embedding frame's document is allowed to use 93 // 2. Otherwise, if the embedding frame's document is allowed to use
95 // fullscreen (either through FP or otherwise), and either: 94 // fullscreen (either through FP or otherwise), and either:
96 // a) this is a same-origin embedded document, or 95 // a) this is a same-origin embedded document, or
97 // b) this document's iframe has the allowfullscreen attribute set, 96 // b) this document's iframe has the allowfullscreen attribute set,
98 // then fullscreen is allowed. 97 // then fullscreen is allowed.
99 if (!frame->isMainFrame()) { 98 if (!frame->isMainFrame()) {
100 if (allowedToUseFullscreen(frame->tree().parent())) { 99 if (allowedToUseFullscreen(frame->tree().parent())) {
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 DEFINE_TRACE(Fullscreen) { 866 DEFINE_TRACE(Fullscreen) {
868 visitor->trace(m_pendingFullscreenElement); 867 visitor->trace(m_pendingFullscreenElement);
869 visitor->trace(m_fullscreenElementStack); 868 visitor->trace(m_fullscreenElementStack);
870 visitor->trace(m_currentFullScreenElement); 869 visitor->trace(m_currentFullScreenElement);
871 visitor->trace(m_eventQueue); 870 visitor->trace(m_eventQueue);
872 Supplement<Document>::trace(visitor); 871 Supplement<Document>::trace(visitor);
873 ContextLifecycleObserver::trace(visitor); 872 ContextLifecycleObserver::trace(visitor);
874 } 873 }
875 874
876 } // namespace blink 875 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698