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

Unified Diff: third_party/WebKit/Source/core/html/shadow/MediaControlsOrientationLockDelegate.cpp

Issue 2724983006: Media Controls: do not use events but C++ callbacks for insertion/removal from document. (Closed)
Patch Set: Created 3 years, 10 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 | « third_party/WebKit/Source/core/html/shadow/MediaControlsMediaEventListener.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/shadow/MediaControlsOrientationLockDelegate.cpp
diff --git a/third_party/WebKit/Source/core/html/shadow/MediaControlsOrientationLockDelegate.cpp b/third_party/WebKit/Source/core/html/shadow/MediaControlsOrientationLockDelegate.cpp
index f29c4c5e96961e78a9d3f10d87f856742bdb2348..71d89b35e4e776ac71a0738f96e19a9387791acd 100644
--- a/third_party/WebKit/Source/core/html/shadow/MediaControlsOrientationLockDelegate.cpp
+++ b/third_party/WebKit/Source/core/html/shadow/MediaControlsOrientationLockDelegate.cpp
@@ -69,6 +69,8 @@ MediaControlsOrientationLockDelegate::MediaControlsOrientationLockDelegate(
}
void MediaControlsOrientationLockDelegate::attach() {
+ DCHECK(videoElement().isConnected());
+
document().addEventListener(EventTypeNames::fullscreenchange, this, true);
videoElement().addEventListener(EventTypeNames::webkitfullscreenchange, this,
true);
@@ -76,6 +78,8 @@ void MediaControlsOrientationLockDelegate::attach() {
}
void MediaControlsOrientationLockDelegate::detach() {
+ DCHECK(!videoElement().isConnected());
+
document().removeEventListener(EventTypeNames::fullscreenchange, this, true);
videoElement().removeEventListener(EventTypeNames::webkitfullscreenchange,
this, true);
« no previous file with comments | « third_party/WebKit/Source/core/html/shadow/MediaControlsMediaEventListener.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698