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

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

Issue 1976183002: Add TextTrack::isVisualKind helper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: One more Created 4 years, 7 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 | « no previous file | third_party/WebKit/Source/core/html/track/AutomaticTrackSelection.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
index b0cc0f259bc6e8372d26d511c669636564b11415..beaa552e9f848587003ddddedf1e9eed40648ca9 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
@@ -3270,12 +3270,7 @@ bool HTMLMediaElement::hasClosedCaptions() const
{
if (m_textTracks) {
for (unsigned i = 0; i < m_textTracks->length(); ++i) {
- TextTrack* track = m_textTracks->anonymousIndexedGetter(i);
- if (track->getReadinessState() == TextTrack::FailedToLoad)
- continue;
-
- if (track->kind() == TextTrack::captionsKeyword()
- || track->kind() == TextTrack::subtitlesKeyword())
+ if (m_textTracks->anonymousIndexedGetter(i)->canBeRendered())
return true;
}
}
@@ -3385,9 +3380,7 @@ void HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured()
// the user has turned captions on).
for (unsigned i = 0; i < m_textTracks->length(); ++i) {
TextTrack* textTrack = m_textTracks->anonymousIndexedGetter(i);
- String kind = textTrack->kind();
-
- if (kind == TextTrack::subtitlesKeyword() || kind == TextTrack::captionsKeyword())
+ if (textTrack->isVisualKind())
textTrack->setHasBeenConfigured(false);
}
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/track/AutomaticTrackSelection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698