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

Unified Diff: third_party/WebKit/Source/core/html/HTMLVideoElement.cpp

Issue 2738893002: Add flag for enabling/disabling video fullscreen detection (Closed)
Patch Set: rebased Created 3 years, 9 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: third_party/WebKit/Source/core/html/HTMLVideoElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLVideoElement.cpp b/third_party/WebKit/Source/core/html/HTMLVideoElement.cpp
index f0c93fd8584c1bfad56cb8d4cb5ca9dc7dd233c4..90a86f6e9897604811faebcbd56eb3150fb0f959 100644
--- a/third_party/WebKit/Source/core/html/HTMLVideoElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLVideoElement.cpp
@@ -54,13 +54,16 @@ namespace blink {
using namespace HTMLNames;
inline HTMLVideoElement::HTMLVideoElement(Document& document)
- : HTMLMediaElement(videoTag, document),
- m_customControlsFullscreenDetector(
- new MediaCustomControlsFullscreenDetector(*this)) {
+ : HTMLMediaElement(videoTag, document) {
if (document.settings()) {
m_defaultPosterURL =
AtomicString(document.settings()->getDefaultVideoPosterURL());
}
+
+ if (RuntimeEnabledFeatures::videoFullscreenDetectionEnabled()) {
+ m_customControlsFullscreenDetector =
+ new MediaCustomControlsFullscreenDetector(*this);
+ }
}
HTMLVideoElement* HTMLVideoElement::create(Document& document) {
@@ -77,7 +80,9 @@ DEFINE_TRACE(HTMLVideoElement) {
}
void HTMLVideoElement::contextDestroyed(ExecutionContext* context) {
- m_customControlsFullscreenDetector->contextDestroyed();
+ if (m_customControlsFullscreenDetector)
+ m_customControlsFullscreenDetector->contextDestroyed();
+
HTMLMediaElement::contextDestroyed(context);
}

Powered by Google App Engine
This is Rietveld 408576698