| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "core/html/track/VideoTrack.h" | 5 #include "core/html/track/VideoTrack.h" |
| 6 | 6 |
| 7 #include "core/html/HTMLMediaElement.h" | 7 #include "core/html/HTMLMediaElement.h" |
| 8 | 8 |
| 9 namespace blink { | 9 namespace blink { |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 TrackBase::trace(visitor); | 23 TrackBase::trace(visitor); |
| 24 } | 24 } |
| 25 | 25 |
| 26 void VideoTrack::setSelected(bool selected) | 26 void VideoTrack::setSelected(bool selected) |
| 27 { | 27 { |
| 28 if (selected == m_selected) | 28 if (selected == m_selected) |
| 29 return; | 29 return; |
| 30 | 30 |
| 31 m_selected = selected; | 31 m_selected = selected; |
| 32 | 32 |
| 33 if (mediaElement()) { | 33 if (mediaElement()) |
| 34 WebMediaPlayer::TrackId selectedTrackId = id(); | 34 mediaElement()->selectedVideoTrackChanged(this); |
| 35 mediaElement()->selectedVideoTrackChanged(selected ? &selectedTrackId :
0); | |
| 36 } | |
| 37 } | 35 } |
| 38 | 36 |
| 39 const AtomicString& VideoTrack::alternativeKeyword() | 37 const AtomicString& VideoTrack::alternativeKeyword() |
| 40 { | 38 { |
| 41 DEFINE_STATIC_LOCAL(const AtomicString, keyword, ("alternative")); | 39 DEFINE_STATIC_LOCAL(const AtomicString, keyword, ("alternative")); |
| 42 return keyword; | 40 return keyword; |
| 43 } | 41 } |
| 44 | 42 |
| 45 const AtomicString& VideoTrack::captionsKeyword() | 43 const AtomicString& VideoTrack::captionsKeyword() |
| 46 { | 44 { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 77 return kind == alternativeKeyword() | 75 return kind == alternativeKeyword() |
| 78 || kind == captionsKeyword() | 76 || kind == captionsKeyword() |
| 79 || kind == mainKeyword() | 77 || kind == mainKeyword() |
| 80 || kind == signKeyword() | 78 || kind == signKeyword() |
| 81 || kind == subtitlesKeyword() | 79 || kind == subtitlesKeyword() |
| 82 || kind == commentaryKeyword() | 80 || kind == commentaryKeyword() |
| 83 || kind == emptyAtom; | 81 || kind == emptyAtom; |
| 84 } | 82 } |
| 85 | 83 |
| 86 } // namespace blink | 84 } // namespace blink |
| OLD | NEW |