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

Unified Diff: third_party/WebKit/Source/core/dom/Fullscreen.h

Issue 2411553003: Notify WebMediaPlayer when its ancestor enters/exists fullscreen. (Closed)
Patch Set: Rebased. Add FullscreenObserver. Created 4 years, 2 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
« no previous file with comments | « media/blink/webmediaplayer_impl.cc ('k') | third_party/WebKit/Source/core/dom/Fullscreen.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « media/blink/webmediaplayer_impl.cc ('k') | third_party/WebKit/Source/core/dom/Fullscreen.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698