| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 RequestType { | 61 enum RequestType { |
| 62 UnprefixedRequest, // Element.requestFullscreen() |
| 62 PrefixedRequest, // Element.webkitRequestFullscreen() | 63 PrefixedRequest, // Element.webkitRequestFullscreen() |
| 63 PrefixedMozillaRequest, // Element.webkitRequestFullScreen() | 64 PrefixedMozillaRequest, // Element.webkitRequestFullScreen() |
| 64 PrefixedMozillaAllowKeyboardInputRequest, // Element.webkitRequestFullSc
reen(Element.ALLOW_KEYBOARD_INPUT) | 65 PrefixedMozillaAllowKeyboardInputRequest, // Element.webkitRequestFullSc
reen(Element.ALLOW_KEYBOARD_INPUT) |
| 65 PrefixedVideoRequest, // HTMLVideoElement.webkitEnterFullscreen() and we
bkitEnterFullScreen() | 66 PrefixedVideoRequest, // HTMLVideoElement.webkitEnterFullscreen() and we
bkitEnterFullScreen() |
| 66 }; | 67 }; |
| 67 | 68 |
| 68 void requestFullscreen(Element&, RequestType); | 69 void requestFullscreen(Element&, RequestType); |
| 69 void fullyExitFullscreen(); | 70 void fullyExitFullscreen(); |
| 70 void exitFullscreen(); | 71 void exitFullscreen(); |
| 71 | 72 |
| 72 static bool fullscreenEnabled(Document&); | 73 static bool fullscreenEnabled(Document&); |
| 73 Element* fullscreenElement() const { return !m_fullScreenElementStack.isEmpt
y() ? m_fullScreenElementStack.last().get() : 0; } | 74 Element* fullscreenElement() const { return !m_fullScreenElementStack.isEmpt
y() ? m_fullScreenElementStack.last().first.get() : 0; } |
| 74 | 75 |
| 75 void willEnterFullScreenForElement(Element*); | 76 void willEnterFullScreenForElement(Element*); |
| 76 void didEnterFullScreenForElement(Element*); | 77 void didEnterFullScreenForElement(Element*); |
| 77 void willExitFullScreenForElement(Element*); | 78 void willExitFullScreenForElement(Element*); |
| 78 void didExitFullScreenForElement(Element*); | 79 void didExitFullScreenForElement(Element*); |
| 79 | 80 |
| 80 void setFullScreenRenderer(RenderFullScreen*); | 81 void setFullScreenRenderer(RenderFullScreen*); |
| 81 RenderFullScreen* fullScreenRenderer() const { return m_fullScreenRenderer;
} | 82 RenderFullScreen* fullScreenRenderer() const { return m_fullScreenRenderer;
} |
| 82 void fullScreenRendererDestroyed(); | 83 void fullScreenRendererDestroyed(); |
| 83 | 84 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 97 | 98 |
| 98 private: | 99 private: |
| 99 static FullscreenElementStack* fromIfExistsSlow(Document&); | 100 static FullscreenElementStack* fromIfExistsSlow(Document&); |
| 100 | 101 |
| 101 explicit FullscreenElementStack(Document&); | 102 explicit FullscreenElementStack(Document&); |
| 102 | 103 |
| 103 Document* document(); | 104 Document* document(); |
| 104 | 105 |
| 105 void clearFullscreenElementStack(); | 106 void clearFullscreenElementStack(); |
| 106 void popFullscreenElementStack(); | 107 void popFullscreenElementStack(); |
| 107 void pushFullscreenElementStack(Element&); | 108 void pushFullscreenElementStack(Element&, RequestType); |
| 108 | 109 |
| 109 void enqueueChangeEvent(Document&); | 110 void enqueueChangeEvent(Document&, RequestType); |
| 110 void enqueueErrorEvent(Element&); | 111 void enqueueErrorEvent(Element&, RequestType); |
| 111 void eventQueueTimerFired(Timer<FullscreenElementStack>*); | 112 void eventQueueTimerFired(Timer<FullscreenElementStack>*); |
| 112 | 113 |
| 113 void fullScreenElementRemoved(); | 114 void fullScreenElementRemoved(); |
| 114 | 115 |
| 115 bool m_areKeysEnabledInFullScreen; | 116 bool m_areKeysEnabledInFullScreen; |
| 116 RefPtrWillBeMember<Element> m_fullScreenElement; | 117 RefPtrWillBeMember<Element> m_fullScreenElement; |
| 117 WillBeHeapVector<RefPtrWillBeMember<Element> > m_fullScreenElementStack; | 118 WillBeHeapVector<std::pair<RefPtrWillBeMember<Element>, RequestType> > m_ful
lScreenElementStack; |
| 118 RawPtrWillBeMember<RenderFullScreen> m_fullScreenRenderer; | 119 RawPtrWillBeMember<RenderFullScreen> m_fullScreenRenderer; |
| 119 Timer<FullscreenElementStack> m_eventQueueTimer; | 120 Timer<FullscreenElementStack> m_eventQueueTimer; |
| 120 WillBeHeapDeque<RefPtrWillBeMember<Event> > m_eventQueue; | 121 WillBeHeapDeque<RefPtrWillBeMember<Event> > m_eventQueue; |
| 121 LayoutRect m_savedPlaceholderFrameRect; | 122 LayoutRect m_savedPlaceholderFrameRect; |
| 122 RefPtr<RenderStyle> m_savedPlaceholderRenderStyle; | 123 RefPtr<RenderStyle> m_savedPlaceholderRenderStyle; |
| 123 }; | 124 }; |
| 124 | 125 |
| 125 inline bool FullscreenElementStack::isActiveFullScreenElement(const Element& ele
ment) | 126 inline bool FullscreenElementStack::isActiveFullScreenElement(const Element& ele
ment) |
| 126 { | 127 { |
| 127 FullscreenElementStack* fullscreen = fromIfExists(element.document()); | 128 FullscreenElementStack* fullscreen = fromIfExists(element.document()); |
| 128 if (!fullscreen) | 129 if (!fullscreen) |
| 129 return false; | 130 return false; |
| 130 return fullscreen->webkitCurrentFullScreenElement() == &element; | 131 return fullscreen->webkitCurrentFullScreenElement() == &element; |
| 131 } | 132 } |
| 132 | 133 |
| 133 inline FullscreenElementStack* FullscreenElementStack::fromIfExists(Document& do
cument) | 134 inline FullscreenElementStack* FullscreenElementStack::fromIfExists(Document& do
cument) |
| 134 { | 135 { |
| 135 if (!document.hasFullscreenElementStack()) | 136 if (!document.hasFullscreenElementStack()) |
| 136 return 0; | 137 return 0; |
| 137 return fromIfExistsSlow(document); | 138 return fromIfExistsSlow(document); |
| 138 } | 139 } |
| 139 | 140 |
| 140 } // namespace blink | 141 } // namespace blink |
| 141 | 142 |
| 142 #endif // FullscreenElementStack_h | 143 #endif // FullscreenElementStack_h |
| OLD | NEW |