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

Unified Diff: Source/core/dom/FullscreenElementStack.cpp

Issue 261983005: Stop firing orientationchange events at pages that are not visible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Simplify test case Created 6 years, 7 months 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 side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698