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

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

Issue 1079323002: Support text track selection in video controls (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge Blink repo changes and addressed comments from philipj and UX Created 4 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 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 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 int TextTrack::trackIndexRelativeToRenderedTracks() 436 int TextTrack::trackIndexRelativeToRenderedTracks()
437 { 437 {
438 ASSERT(m_trackList); 438 ASSERT(m_trackList);
439 439
440 if (m_renderedTrackIndex == invalidTrackIndex) 440 if (m_renderedTrackIndex == invalidTrackIndex)
441 m_renderedTrackIndex = m_trackList->getTrackIndexRelativeToRenderedTrack s(this); 441 m_renderedTrackIndex = m_trackList->getTrackIndexRelativeToRenderedTrack s(this);
442 442
443 return m_renderedTrackIndex; 443 return m_renderedTrackIndex;
444 } 444 }
445 445
446 bool TextTrack::isRenderable()
fs 2016/02/23 13:16:44 Maybe move this closer to isRendered() and format
srivats 2016/02/24 05:20:18 Done.
447 {
448 // A track can be displayed when it's of kind captions or subtitles and hasn 't failed to load
fs 2016/02/23 13:16:44 uNit: Add full stop.
srivats 2016/02/24 05:20:18 Done.
449 if ((kind() == captionsKeyword() || kind() == subtitlesKeyword()) && readine ssState() != FailedToLoad)
450 return true;
451 return false;
452 }
453
446 const AtomicString& TextTrack::interfaceName() const 454 const AtomicString& TextTrack::interfaceName() const
447 { 455 {
448 return EventTargetNames::TextTrack; 456 return EventTargetNames::TextTrack;
449 } 457 }
450 458
451 ExecutionContext* TextTrack::executionContext() const 459 ExecutionContext* TextTrack::executionContext() const
452 { 460 {
453 HTMLMediaElement* owner = mediaElement(); 461 HTMLMediaElement* owner = mediaElement();
454 return owner ? owner->executionContext() : 0; 462 return owner ? owner->executionContext() : 0;
455 } 463 }
(...skipping 17 matching lines...) Expand all
473 { 481 {
474 visitor->trace(m_cues); 482 visitor->trace(m_cues);
475 visitor->trace(m_activeCues); 483 visitor->trace(m_activeCues);
476 visitor->trace(m_regions); 484 visitor->trace(m_regions);
477 visitor->trace(m_trackList); 485 visitor->trace(m_trackList);
478 TrackBase::trace(visitor); 486 TrackBase::trace(visitor);
479 RefCountedGarbageCollectedEventTargetWithInlineData<TextTrack>::trace(visito r); 487 RefCountedGarbageCollectedEventTargetWithInlineData<TextTrack>::trace(visito r);
480 } 488 }
481 489
482 } // namespace blink 490 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698