OLD | NEW |
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 r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. |
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
9 * Copyright (C) 2013 Google Inc. All rights reserved. | 9 * Copyright (C) 2013 Google Inc. All rights reserved. |
10 * | 10 * |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 , public DocumentLifecycleObserver { | 49 , public DocumentLifecycleObserver { |
50 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(FullscreenElementStack); | 50 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(FullscreenElementStack); |
51 public: | 51 public: |
52 virtual ~FullscreenElementStack(); | 52 virtual ~FullscreenElementStack(); |
53 static const char* supplementName(); | 53 static const char* supplementName(); |
54 static FullscreenElementStack& from(Document&); | 54 static FullscreenElementStack& from(Document&); |
55 static FullscreenElementStack* fromIfExists(Document&); | 55 static FullscreenElementStack* fromIfExists(Document&); |
56 static Element* fullscreenElementFrom(Document&); | 56 static Element* fullscreenElementFrom(Document&); |
57 static Element* currentFullScreenElementFrom(Document&); | 57 static Element* currentFullScreenElementFrom(Document&); |
58 static bool isFullScreen(Document&); | 58 static bool isFullScreen(Document&); |
59 static bool isActiveFullScreenElement(const Element*); | 59 static bool isActiveFullScreenElement(const Element&); |
60 | 60 |
61 enum FullScreenCheckType { | 61 enum FullScreenCheckType { |
62 EnforceIFrameAllowFullScreenRequirement, | 62 EnforceIFrameAllowFullScreenRequirement, |
63 ExemptIFrameAllowFullScreenRequirement, | 63 ExemptIFrameAllowFullScreenRequirement, |
64 }; | 64 }; |
65 | 65 |
66 void requestFullScreenForElement(Element*, unsigned short flags, FullScreenC
heckType); | 66 void requestFullScreenForElement(Element&, unsigned short flags, FullScreenC
heckType); |
67 void webkitCancelFullScreen(); | 67 void webkitCancelFullScreen(); |
68 | 68 |
69 void webkitWillEnterFullScreenForElement(Element*); | 69 void webkitWillEnterFullScreenForElement(Element*); |
70 void webkitDidEnterFullScreenForElement(Element*); | 70 void webkitDidEnterFullScreenForElement(Element*); |
71 void webkitWillExitFullScreenForElement(Element*); | 71 void webkitWillExitFullScreenForElement(Element*); |
72 void webkitDidExitFullScreenForElement(Element*); | 72 void webkitDidExitFullScreenForElement(Element*); |
73 | 73 |
74 void setFullScreenRenderer(RenderFullScreen*); | 74 void setFullScreenRenderer(RenderFullScreen*); |
75 RenderFullScreen* fullScreenRenderer() const { return m_fullScreenRenderer;
} | 75 RenderFullScreen* fullScreenRenderer() const { return m_fullScreenRenderer;
} |
76 void fullScreenRendererDestroyed(); | 76 void fullScreenRendererDestroyed(); |
77 | 77 |
78 void clearFullscreenElementStack(); | 78 void clearFullscreenElementStack(); |
79 void popFullscreenElementStack(); | 79 void popFullscreenElementStack(); |
80 void pushFullscreenElementStack(Element*); | 80 void pushFullscreenElementStack(Element&); |
81 void addDocumentToFullScreenChangeEventQueue(Document*); | 81 void addDocumentToFullScreenChangeEventQueue(Document&); |
82 | 82 |
83 bool fullScreenIsAllowedForElement(Element*) const; | |
84 void fullScreenElementRemoved(); | 83 void fullScreenElementRemoved(); |
85 void removeFullScreenElementOfSubtree(Node*, bool amongChildrenOnly = false)
; | 84 void removeFullScreenElementOfSubtree(Node*, bool amongChildrenOnly = false)
; |
86 | 85 |
87 // W3C API | 86 // W3C API |
88 static bool webkitFullscreenEnabled(Document&); | 87 static bool webkitFullscreenEnabled(Document&); |
89 Element* webkitFullscreenElement() const { return !m_fullScreenElementStack.
isEmpty() ? m_fullScreenElementStack.last().get() : 0; } | 88 Element* webkitFullscreenElement() const { return !m_fullScreenElementStack.
isEmpty() ? m_fullScreenElementStack.last().get() : 0; } |
90 void webkitExitFullscreen(); | 89 void webkitExitFullscreen(); |
91 | 90 |
92 bool webkitIsFullScreen() const { return m_fullScreenElement.get(); } | 91 bool webkitIsFullScreen() const { return m_fullScreenElement.get(); } |
93 bool webkitFullScreenKeyboardInputAllowed() const { return m_fullScreenEleme
nt.get() && m_areKeysEnabledInFullScreen; } | 92 bool webkitFullScreenKeyboardInputAllowed() const { return m_fullScreenEleme
nt.get() && m_areKeysEnabledInFullScreen; } |
(...skipping 18 matching lines...) Expand all Loading... |
112 RefPtrWillBeMember<Element> m_fullScreenElement; | 111 RefPtrWillBeMember<Element> m_fullScreenElement; |
113 WillBeHeapVector<RefPtrWillBeMember<Element> > m_fullScreenElementStack; | 112 WillBeHeapVector<RefPtrWillBeMember<Element> > m_fullScreenElementStack; |
114 RenderFullScreen* m_fullScreenRenderer; | 113 RenderFullScreen* m_fullScreenRenderer; |
115 Timer<FullscreenElementStack> m_fullScreenChangeDelayTimer; | 114 Timer<FullscreenElementStack> m_fullScreenChangeDelayTimer; |
116 WillBeHeapDeque<RefPtrWillBeMember<Node> > m_fullScreenChangeEventTargetQueu
e; | 115 WillBeHeapDeque<RefPtrWillBeMember<Node> > m_fullScreenChangeEventTargetQueu
e; |
117 WillBeHeapDeque<RefPtrWillBeMember<Node> > m_fullScreenErrorEventTargetQueue
; | 116 WillBeHeapDeque<RefPtrWillBeMember<Node> > m_fullScreenErrorEventTargetQueue
; |
118 LayoutRect m_savedPlaceholderFrameRect; | 117 LayoutRect m_savedPlaceholderFrameRect; |
119 RefPtr<RenderStyle> m_savedPlaceholderRenderStyle; | 118 RefPtr<RenderStyle> m_savedPlaceholderRenderStyle; |
120 }; | 119 }; |
121 | 120 |
122 inline bool FullscreenElementStack::isActiveFullScreenElement(const Element* ele
ment) | 121 inline bool FullscreenElementStack::isActiveFullScreenElement(const Element& ele
ment) |
123 { | 122 { |
124 FullscreenElementStack* controller = fromIfExists(element->document()); | 123 FullscreenElementStack* controller = fromIfExists(element.document()); |
125 if (!controller) | 124 if (!controller) |
126 return false; | 125 return false; |
127 return controller->webkitIsFullScreen() && controller->webkitCurrentFullScre
enElement() == element; | 126 return controller->webkitIsFullScreen() && controller->webkitCurrentFullScre
enElement() == element; |
128 } | 127 } |
129 | 128 |
130 inline FullscreenElementStack* FullscreenElementStack::fromIfExists(Document& do
cument) | 129 inline FullscreenElementStack* FullscreenElementStack::fromIfExists(Document& do
cument) |
131 { | 130 { |
132 if (!document.hasFullscreenElementStack()) | 131 if (!document.hasFullscreenElementStack()) |
133 return 0; | 132 return 0; |
134 return fromIfExistsSlow(document); | 133 return fromIfExistsSlow(document); |
135 } | 134 } |
136 | 135 |
137 } // namespace WebCore | 136 } // namespace WebCore |
138 | 137 |
139 #endif // FullscreenElementStack_h | 138 #endif // FullscreenElementStack_h |
OLD | NEW |