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

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

Issue 2495423004: Convert FullscreenController to use WebCallbacks (Closed)
Patch Set: just in case Created 4 years 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // Called by FullscreenController to notify that we've entered or exited 95 // Called by FullscreenController to notify that we've exited fullscreen. All
96 // fullscreen. All frames are notified, so there may be no pending request. 96 // frames are notified, so there may be no fullscreen element.
97 void didEnterFullscreen();
98 void didExitFullscreen(); 97 void didExitFullscreen();
99 98
100 void setFullScreenLayoutObject(LayoutFullScreen*); 99 void setFullScreenLayoutObject(LayoutFullScreen*);
101 LayoutFullScreen* fullScreenLayoutObject() const { 100 LayoutFullScreen* fullScreenLayoutObject() const {
102 return m_fullScreenLayoutObject; 101 return m_fullScreenLayoutObject;
103 } 102 }
104 void fullScreenLayoutObjectDestroyed(); 103 void fullScreenLayoutObjectDestroyed();
105 104
106 void elementRemoved(Element&); 105 void elementRemoved(Element&);
107 106
(...skipping 10 matching lines...) Expand all
118 Element* currentFullScreenElement() const { 117 Element* currentFullScreenElement() const {
119 return m_currentFullScreenElement.get(); 118 return m_currentFullScreenElement.get();
120 } 119 }
121 120
122 // ContextLifecycleObserver: 121 // ContextLifecycleObserver:
123 void contextDestroyed() override; 122 void contextDestroyed() override;
124 123
125 DECLARE_VIRTUAL_TRACE(); 124 DECLARE_VIRTUAL_TRACE();
126 125
127 private: 126 private:
127 friend class RequestFullscreenCallbacks;
128
128 static Fullscreen* fromIfExistsSlow(Document&); 129 static Fullscreen* fromIfExistsSlow(Document&);
129 130
130 explicit Fullscreen(Document&); 131 explicit Fullscreen(Document&);
131 132
132 Document* document(); 133 Document* document();
133 134
135 void didEnterFullscreen(Element&);
136
134 void clearFullscreenElementStack(); 137 void clearFullscreenElementStack();
135 void popFullscreenElementStack(); 138 void popFullscreenElementStack();
136 void pushFullscreenElementStack(Element&, RequestType); 139 void pushFullscreenElementStack(Element&, RequestType);
137 140
138 void enqueueChangeEvent(Document&, RequestType); 141 void enqueueChangeEvent(Document&, RequestType);
139 void enqueueErrorEvent(Element&, RequestType); 142 void enqueueErrorEvent(Element&, RequestType);
140 void eventQueueTimerFired(TimerBase*); 143 void eventQueueTimerFired(TimerBase*);
141 144
142 Member<Element> m_pendingFullscreenElement;
143 HeapVector<std::pair<Member<Element>, RequestType>> m_fullscreenElementStack; 145 HeapVector<std::pair<Member<Element>, RequestType>> m_fullscreenElementStack;
144 Member<Element> m_currentFullScreenElement; 146 Member<Element> m_currentFullScreenElement;
145 LayoutFullScreen* m_fullScreenLayoutObject; 147 LayoutFullScreen* m_fullScreenLayoutObject;
146 Timer<Fullscreen> m_eventQueueTimer; 148 Timer<Fullscreen> m_eventQueueTimer;
147 HeapDeque<Member<Event>> m_eventQueue; 149 HeapDeque<Member<Event>> m_eventQueue;
148 LayoutRect m_savedPlaceholderFrameRect; 150 LayoutRect m_savedPlaceholderFrameRect;
149 RefPtr<ComputedStyle> m_savedPlaceholderComputedStyle; 151 RefPtr<ComputedStyle> m_savedPlaceholderComputedStyle;
150 152
151 // TODO(alexmos, dcheng): Currently, this assumes that if fullscreen was 153 // TODO(alexmos, dcheng): Currently, this assumes that if fullscreen was
152 // entered for an element in an out-of-process iframe, then it's not 154 // entered for an element in an out-of-process iframe, then it's not
(...skipping 15 matching lines...) Expand all
168 170
169 inline bool Fullscreen::isCurrentFullScreenElement(const Element& element) { 171 inline bool Fullscreen::isCurrentFullScreenElement(const Element& element) {
170 if (Fullscreen* found = fromIfExists(element.document())) 172 if (Fullscreen* found = fromIfExists(element.document()))
171 return found->currentFullScreenElement() == &element; 173 return found->currentFullScreenElement() == &element;
172 return false; 174 return false;
173 } 175 }
174 176
175 } // namespace blink 177 } // namespace blink
176 178
177 #endif // Fullscreen_h 179 #endif // Fullscreen_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/BUILD.gn ('k') | third_party/WebKit/Source/core/dom/Fullscreen.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698