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

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

Issue 2696893002: [Blink>Media] Add heuristic for dominant video detection for Android (Closed)
Patch Set: addressed nits 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
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 fb4daa679ce0224022e3b29c6f7a54fa294f6426..adbac930ac140fafc82931d16b67362612b4992b 100644
--- a/third_party/WebKit/Source/core/html/HTMLVideoElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLVideoElement.cpp
@@ -25,6 +25,7 @@
#include "core/html/HTMLVideoElement.h"
+#include <memory>
#include "bindings/core/v8/ExceptionState.h"
#include "core/CSSPropertyNames.h"
#include "core/HTMLNames.h"
@@ -36,6 +37,7 @@
#include "core/frame/ImageBitmap.h"
#include "core/frame/LocalDOMWindow.h"
#include "core/frame/Settings.h"
+#include "core/html/MediaCustomControlsFullscreenDetector.h"
#include "core/html/parser/HTMLParserIdioms.h"
#include "core/imagebitmap/ImageBitmapOptions.h"
#include "core/layout/LayoutImage.h"
@@ -46,14 +48,15 @@
#include "platform/graphics/ImageBuffer.h"
#include "platform/graphics/gpu/Extensions3DUtil.h"
#include "public/platform/WebCanvas.h"
-#include <memory>
namespace blink {
using namespace HTMLNames;
inline HTMLVideoElement::HTMLVideoElement(Document& document)
- : HTMLMediaElement(videoTag, document) {
+ : HTMLMediaElement(videoTag, document),
+ m_customControlsFullscreenDetector(
+ new MediaCustomControlsFullscreenDetector(*this)) {
if (document.settings()) {
m_defaultPosterURL =
AtomicString(document.settings()->getDefaultVideoPosterURL());
@@ -69,6 +72,7 @@ HTMLVideoElement* HTMLVideoElement::create(Document& document) {
DEFINE_TRACE(HTMLVideoElement) {
visitor->trace(m_imageLoader);
+ visitor->trace(m_customControlsFullscreenDetector);
HTMLMediaElement::trace(visitor);
}
@@ -277,6 +281,8 @@ bool HTMLVideoElement::usesOverlayFullscreenVideo() const {
void HTMLVideoElement::didMoveToNewDocument(Document& oldDocument) {
if (m_imageLoader)
m_imageLoader->elementDidMoveToNewDocument();
+ if (m_customControlsFullscreenDetector)
mlamouri (slow - plz ping) 2017/02/27 18:04:55 Why do you do a null-check here?
Zhiqiang Zhang (Slow) 2017/02/28 12:16:52 Got mislead by the if-statement above. Removed.
+ m_customControlsFullscreenDetector->didMoveToNewDocument(oldDocument);
HTMLMediaElement::didMoveToNewDocument(oldDocument);
}

Powered by Google App Engine
This is Rietveld 408576698