Index: third_party/WebKit/Source/core/dom/Fullscreen.h |
diff --git a/third_party/WebKit/Source/core/dom/Fullscreen.h b/third_party/WebKit/Source/core/dom/Fullscreen.h |
index 34b28d69d10eab6b61f507048405d53a1f6ef7c8..ea75c8385dcf4cb1b105f791d9db698fb150b820 100644 |
--- a/third_party/WebKit/Source/core/dom/Fullscreen.h |
+++ b/third_party/WebKit/Source/core/dom/Fullscreen.h |
@@ -41,6 +41,8 @@ |
#include "wtf/RefPtr.h" |
#include "wtf/Vector.h" |
+#include <set> |
+ |
namespace blink { |
class LayoutFullScreen; |
@@ -61,6 +63,14 @@ class CORE_EXPORT Fullscreen final |
static Element* currentFullScreenElementFrom(Document&); |
static bool isCurrentFullScreenElement(const Element&); |
+ class FullscreenObserver { |
+ public: |
+ FullscreenObserver() {} |
+ virtual ~FullscreenObserver() {} |
+ virtual void onEnteredFullscreen() = 0; |
+ virtual void onExitedFullscreen() = 0; |
+ }; |
+ |
enum RequestType { |
// Element.requestFullscreen() |
UnprefixedRequest, |
@@ -118,6 +128,9 @@ class CORE_EXPORT Fullscreen final |
// ContextLifecycleObserver: |
void contextDestroyed() override; |
+ void registerObserver(FullscreenObserver*); |
+ void removeObserver(FullscreenObserver*); |
+ |
DECLARE_VIRTUAL_TRACE(); |
private: |
@@ -153,6 +166,8 @@ class CORE_EXPORT Fullscreen final |
// postMessage can carry user gestures. If that happens, this should be |
// moved to be part of |m_fullscreenElementStack|. |
bool m_forCrossProcessDescendant; |
+ |
+ std::set<FullscreenObserver*> m_observers; |
}; |
inline Fullscreen* Fullscreen::fromIfExists(Document& document) { |