| 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 | 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 25 matching lines...) Expand all Loading... |
| 36 #include "core/dom/Element.h" | 36 #include "core/dom/Element.h" |
| 37 #include "platform/Supplementable.h" | 37 #include "platform/Supplementable.h" |
| 38 #include "platform/Timer.h" | 38 #include "platform/Timer.h" |
| 39 #include "platform/geometry/LayoutRect.h" | 39 #include "platform/geometry/LayoutRect.h" |
| 40 #include "wtf/Deque.h" | 40 #include "wtf/Deque.h" |
| 41 #include "wtf/RefPtr.h" | 41 #include "wtf/RefPtr.h" |
| 42 #include "wtf/Vector.h" | 42 #include "wtf/Vector.h" |
| 43 | 43 |
| 44 namespace blink { | 44 namespace blink { |
| 45 | 45 |
| 46 class ComputedStyle; |
| 46 class LayoutFullScreen; | 47 class LayoutFullScreen; |
| 47 class ComputedStyle; | |
| 48 | 48 |
| 49 class CORE_EXPORT Fullscreen final | 49 class CORE_EXPORT Fullscreen final |
| 50 : public GarbageCollectedFinalized<Fullscreen>, | 50 : public GarbageCollectedFinalized<Fullscreen>, |
| 51 public Supplement<Document>, | 51 public Supplement<Document>, |
| 52 public ContextLifecycleObserver { | 52 public ContextLifecycleObserver { |
| 53 USING_GARBAGE_COLLECTED_MIXIN(Fullscreen); | 53 USING_GARBAGE_COLLECTED_MIXIN(Fullscreen); |
| 54 | 54 |
| 55 public: | 55 public: |
| 56 virtual ~Fullscreen(); | 56 virtual ~Fullscreen(); |
| 57 static const char* supplementName(); | 57 static const char* supplementName(); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 85 // TODO(foolip): The fullscreen element stack is modified synchronously in | 85 // TODO(foolip): The fullscreen element stack is modified synchronously in |
| 86 // requestFullscreen(), which is not per spec and means that | 86 // requestFullscreen(), which is not per spec and means that |
| 87 // |fullscreenElement()| is not always the same as | 87 // |fullscreenElement()| is not always the same as |
| 88 // |currentFullScreenElement()|, see https://crbug.com/402421. | 88 // |currentFullScreenElement()|, see https://crbug.com/402421. |
| 89 Element* fullscreenElement() const { | 89 Element* fullscreenElement() const { |
| 90 return !m_fullscreenElementStack.isEmpty() | 90 return !m_fullscreenElementStack.isEmpty() |
| 91 ? m_fullscreenElementStack.back().first.get() | 91 ? m_fullscreenElementStack.back().first.get() |
| 92 : nullptr; | 92 : nullptr; |
| 93 } | 93 } |
| 94 | 94 |
| 95 void didEnterFullscreenForElement(Element*); | 95 // Called by FullscreenController to notify that we've entered or exited |
| 96 // fullscreen. All frames are notified, so there may be no pending request. |
| 97 void didEnterFullscreen(); |
| 96 void didExitFullscreen(); | 98 void didExitFullscreen(); |
| 97 | 99 |
| 98 void setFullScreenLayoutObject(LayoutFullScreen*); | 100 void setFullScreenLayoutObject(LayoutFullScreen*); |
| 99 LayoutFullScreen* fullScreenLayoutObject() const { | 101 LayoutFullScreen* fullScreenLayoutObject() const { |
| 100 return m_fullScreenLayoutObject; | 102 return m_fullScreenLayoutObject; |
| 101 } | 103 } |
| 102 void fullScreenLayoutObjectDestroyed(); | 104 void fullScreenLayoutObjectDestroyed(); |
| 103 | 105 |
| 104 void elementRemoved(Element&); | 106 void elementRemoved(Element&); |
| 105 | 107 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 130 Document* document(); | 132 Document* document(); |
| 131 | 133 |
| 132 void clearFullscreenElementStack(); | 134 void clearFullscreenElementStack(); |
| 133 void popFullscreenElementStack(); | 135 void popFullscreenElementStack(); |
| 134 void pushFullscreenElementStack(Element&, RequestType); | 136 void pushFullscreenElementStack(Element&, RequestType); |
| 135 | 137 |
| 136 void enqueueChangeEvent(Document&, RequestType); | 138 void enqueueChangeEvent(Document&, RequestType); |
| 137 void enqueueErrorEvent(Element&, RequestType); | 139 void enqueueErrorEvent(Element&, RequestType); |
| 138 void eventQueueTimerFired(TimerBase*); | 140 void eventQueueTimerFired(TimerBase*); |
| 139 | 141 |
| 142 Member<Element> m_pendingFullscreenElement; |
| 140 HeapVector<std::pair<Member<Element>, RequestType>> m_fullscreenElementStack; | 143 HeapVector<std::pair<Member<Element>, RequestType>> m_fullscreenElementStack; |
| 141 Member<Element> m_currentFullScreenElement; | 144 Member<Element> m_currentFullScreenElement; |
| 142 LayoutFullScreen* m_fullScreenLayoutObject; | 145 LayoutFullScreen* m_fullScreenLayoutObject; |
| 143 Timer<Fullscreen> m_eventQueueTimer; | 146 Timer<Fullscreen> m_eventQueueTimer; |
| 144 HeapDeque<Member<Event>> m_eventQueue; | 147 HeapDeque<Member<Event>> m_eventQueue; |
| 145 LayoutRect m_savedPlaceholderFrameRect; | 148 LayoutRect m_savedPlaceholderFrameRect; |
| 146 RefPtr<ComputedStyle> m_savedPlaceholderComputedStyle; | 149 RefPtr<ComputedStyle> m_savedPlaceholderComputedStyle; |
| 147 | 150 |
| 148 // TODO(alexmos, dcheng): Currently, this assumes that if fullscreen was | 151 // TODO(alexmos, dcheng): Currently, this assumes that if fullscreen was |
| 149 // entered for an element in an out-of-process iframe, then it's not | 152 // entered for an element in an out-of-process iframe, then it's not |
| (...skipping 15 matching lines...) Expand all Loading... |
| 165 | 168 |
| 166 inline bool Fullscreen::isCurrentFullScreenElement(const Element& element) { | 169 inline bool Fullscreen::isCurrentFullScreenElement(const Element& element) { |
| 167 if (Fullscreen* found = fromIfExists(element.document())) | 170 if (Fullscreen* found = fromIfExists(element.document())) |
| 168 return found->currentFullScreenElement() == &element; | 171 return found->currentFullScreenElement() == &element; |
| 169 return false; | 172 return false; |
| 170 } | 173 } |
| 171 | 174 |
| 172 } // namespace blink | 175 } // namespace blink |
| 173 | 176 |
| 174 #endif // Fullscreen_h | 177 #endif // Fullscreen_h |
| OLD | NEW |