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

Unified Diff: Source/core/dom/Document.cpp

Issue 1118613002: Hook up Android closed captions 'enabled' setting to Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index cb8f31309f048e6ccc3c01fc1c60d479d25a7a19..9ad5538a833e9e84263e32c81b11bdf4d8dd01b3 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -141,6 +141,7 @@
#include "core/html/HTMLIFrameElement.h"
#include "core/html/HTMLInputElement.h"
#include "core/html/HTMLLinkElement.h"
+#include "core/html/HTMLMediaElement.h"
#include "core/html/HTMLMetaElement.h"
#include "core/html/HTMLScriptElement.h"
#include "core/html/HTMLStyleElement.h"
@@ -672,6 +673,30 @@ void Document::mediaQueryAffectingValueChanged()
InspectorInstrumentation::mediaQueryResultChanged(this);
}
+void Document::registerForTextTracksVisibilityChangedCallback(HTMLMediaElement* mediaElement)
+{
+ if (!mediaElement)
+ return;
+ if (m_textTracksVisibilityChangedElements.contains(mediaElement))
+ return;
+ m_textTracksVisibilityChangedElements.append(mediaElement);
+}
+
+void Document::unregisterFromTextTracksVisibilityChangedCallback(HTMLMediaElement* mediaElement)
+{
+ size_t index = m_textTracksVisibilityChangedElements.find(mediaElement);
+ if (index != kNotFound)
+ m_textTracksVisibilityChangedElements.remove(index);
+}
+
+void Document::textTracksVisibilityChanged(bool visible)
+{
+ for (Vector<HTMLMediaElement*>::iterator it = m_textTracksVisibilityChangedElements.begin();
+ it != m_textTracksVisibilityChangedElements.end(); ++it) {
+ (*it)->setClosedCaptionsVisible(visible);
+ }
+}
+
void Document::setCompatibilityMode(CompatibilityMode mode)
{
if (m_compatibilityModeLocked || mode == m_compatibilityMode)

Powered by Google App Engine
This is Rietveld 408576698