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

Side by Side Diff: third_party/WebKit/Source/core/html/track/AutomaticTrackSelection.cpp

Issue 1418133011: Remove the named item getters on TextTrackList and TextTrackCueList (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/html/track/AutomaticTrackSelection.h" 6 #include "core/html/track/AutomaticTrackSelection.h"
7 7
8 #include "core/html/track/TextTrack.h" 8 #include "core/html/track/TextTrack.h"
9 #include "core/html/track/TextTrackList.h" 9 #include "core/html/track/TextTrackList.h"
10 #include "platform/Language.h" 10 #include "platform/Language.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 } 161 }
162 162
163 void AutomaticTrackSelection::perform(TextTrackList& textTracks) 163 void AutomaticTrackSelection::perform(TextTrackList& textTracks)
164 { 164 {
165 TrackGroup captionAndSubtitleTracks(TrackGroup::CaptionsAndSubtitles); 165 TrackGroup captionAndSubtitleTracks(TrackGroup::CaptionsAndSubtitles);
166 TrackGroup descriptionTracks(TrackGroup::Description); 166 TrackGroup descriptionTracks(TrackGroup::Description);
167 TrackGroup chapterTracks(TrackGroup::Chapter); 167 TrackGroup chapterTracks(TrackGroup::Chapter);
168 TrackGroup metadataTracks(TrackGroup::Metadata); 168 TrackGroup metadataTracks(TrackGroup::Metadata);
169 169
170 for (size_t i = 0; i < textTracks.length(); ++i) { 170 for (size_t i = 0; i < textTracks.length(); ++i) {
171 TextTrack* textTrack = textTracks.item(i); 171 TextTrack* textTrack = textTracks.anonymousIndexedGetter(i);
172 if (!textTrack) 172 if (!textTrack)
173 continue; 173 continue;
174 174
175 String kind = textTrack->kind(); 175 String kind = textTrack->kind();
176 TrackGroup* currentGroup; 176 TrackGroup* currentGroup;
177 if (kind == TextTrack::subtitlesKeyword() || kind == TextTrack::captions Keyword()) { 177 if (kind == TextTrack::subtitlesKeyword() || kind == TextTrack::captions Keyword()) {
178 currentGroup = &captionAndSubtitleTracks; 178 currentGroup = &captionAndSubtitleTracks;
179 } else if (kind == TextTrack::descriptionsKeyword()) { 179 } else if (kind == TextTrack::descriptionsKeyword()) {
180 currentGroup = &descriptionTracks; 180 currentGroup = &descriptionTracks;
181 } else if (kind == TextTrack::chaptersKeyword()) { 181 } else if (kind == TextTrack::chaptersKeyword()) {
(...skipping 26 matching lines...) Expand all
208 performAutomaticTextTrackSelection(captionAndSubtitleTracks); 208 performAutomaticTextTrackSelection(captionAndSubtitleTracks);
209 if (descriptionTracks.tracks.size()) 209 if (descriptionTracks.tracks.size())
210 performAutomaticTextTrackSelection(descriptionTracks); 210 performAutomaticTextTrackSelection(descriptionTracks);
211 if (chapterTracks.tracks.size()) 211 if (chapterTracks.tracks.size())
212 performAutomaticTextTrackSelection(chapterTracks); 212 performAutomaticTextTrackSelection(chapterTracks);
213 if (metadataTracks.tracks.size()) 213 if (metadataTracks.tracks.size())
214 enableDefaultMetadataTextTracks(metadataTracks); 214 enableDefaultMetadataTextTracks(metadataTracks);
215 } 215 }
216 216
217 } // namespace blink 217 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLMediaElement.cpp ('k') | third_party/WebKit/Source/core/html/track/CueTimeline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698