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

Side by Side Diff: Source/core/html/track/TextTrack.cpp

Issue 1082533002: Support text track selection in video controls (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * Copyright (C) 2011, 2012, 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2011, 2012, 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 int TextTrack::trackIndexRelativeToRenderedTracks() 451 int TextTrack::trackIndexRelativeToRenderedTracks()
452 { 452 {
453 ASSERT(m_trackList); 453 ASSERT(m_trackList);
454 454
455 if (m_renderedTrackIndex == invalidTrackIndex) 455 if (m_renderedTrackIndex == invalidTrackIndex)
456 m_renderedTrackIndex = m_trackList->getTrackIndexRelativeToRenderedTrack s(this); 456 m_renderedTrackIndex = m_trackList->getTrackIndexRelativeToRenderedTrack s(this);
457 457
458 return m_renderedTrackIndex; 458 return m_renderedTrackIndex;
459 } 459 }
460 460
461 bool TextTrack::isRenderable()
462 {
463 // A track can be displayed when it's of kind captions or subtitles and hasn 't failed to load
philipj_slow 2015/05/05 14:36:57 I guess this means that if the readinessState is N
fs 2015/05/05 15:32:44 Yes. Optionally I suppose one could "gray it out"
srivats 2016/02/23 01:39:27 Should we just exclude the NotLoaded tracks from b
philipj_slow 2016/03/01 11:21:04 I think what you have now in the other CL seems to
464 if ((kind() == captionsKeyword() || kind() == subtitlesKeyword()) && readine ssState() != FailedToLoad)
465 return true;
466 return false;
467 }
468
461 const AtomicString& TextTrack::interfaceName() const 469 const AtomicString& TextTrack::interfaceName() const
462 { 470 {
463 return EventTargetNames::TextTrack; 471 return EventTargetNames::TextTrack;
464 } 472 }
465 473
466 ExecutionContext* TextTrack::executionContext() const 474 ExecutionContext* TextTrack::executionContext() const
467 { 475 {
468 HTMLMediaElement* owner = mediaElement(); 476 HTMLMediaElement* owner = mediaElement();
469 return owner ? owner->executionContext() : 0; 477 return owner ? owner->executionContext() : 0;
470 } 478 }
(...skipping 17 matching lines...) Expand all
488 { 496 {
489 visitor->trace(m_cues); 497 visitor->trace(m_cues);
490 visitor->trace(m_activeCues); 498 visitor->trace(m_activeCues);
491 visitor->trace(m_regions); 499 visitor->trace(m_regions);
492 visitor->trace(m_trackList); 500 visitor->trace(m_trackList);
493 TrackBase::trace(visitor); 501 TrackBase::trace(visitor);
494 EventTargetWithInlineData::trace(visitor); 502 EventTargetWithInlineData::trace(visitor);
495 } 503 }
496 504
497 } // namespace blink 505 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698