Index: Source/core/dom/FullscreenElementStack.cpp |
diff --git a/Source/core/dom/FullscreenElementStack.cpp b/Source/core/dom/FullscreenElementStack.cpp |
index 22875bfdc6440676f30dc17a5338acdcf3372529..adc93809507982eeb27c610ccc7fca671d84c69c 100644 |
--- a/Source/core/dom/FullscreenElementStack.cpp |
+++ b/Source/core/dom/FullscreenElementStack.cpp |
@@ -30,6 +30,7 @@ |
#include "HTMLNames.h" |
#include "core/dom/Document.h" |
+#include "core/dom/FullscreenObserver.h" |
#include "core/events/Event.h" |
#include "core/frame/FrameHost.h" |
#include "core/frame/LocalFrame.h" |
@@ -135,6 +136,16 @@ void FullscreenElementStack::documentWasDisposed() |
m_fullScreenElementStack.clear(); |
} |
+void FullscreenElementStack::addObserver(FullscreenObserver* observer) |
+{ |
+ m_fullscreenObservers.add(observer); |
+} |
+ |
+void FullscreenElementStack::removeObserver(FullscreenObserver* observer) |
+{ |
+ m_fullscreenObservers.remove(observer); |
+} |
+ |
bool FullscreenElementStack::fullScreenIsAllowedForElement(Element* element) const |
{ |
ASSERT(element); |
@@ -348,6 +359,7 @@ void FullscreenElementStack::webkitExitFullscreen() |
// full screen stack. |
if (!newTop) { |
host->chrome().client().exitFullScreenForElement(m_fullScreenElement.get()); |
+ notifyObserversDidFullyExitFullScreen(); |
return; |
} |
@@ -516,6 +528,14 @@ void FullscreenElementStack::fullScreenChangeDelayTimerFired(Timer<FullscreenEle |
} |
} |
+void FullscreenElementStack::notifyObserversDidFullyExitFullScreen() |
+{ |
+ Vector<FullscreenObserver*> copy; |
+ copyToVector(m_fullscreenObservers, copy); |
+ for (Vector<FullscreenObserver*>::const_iterator it = copy.begin(); it != copy.end(); ++it) |
+ (*it)->didFullyExitFullscreen(); |
+} |
+ |
void FullscreenElementStack::fullScreenElementRemoved() |
{ |
m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(false); |