| 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/html/track/VideoTrackList.h" | 6 #include "core/html/track/VideoTrackList.h" |
| 7 | 7 |
| 8 #include "core/html/HTMLMediaElement.h" | 8 #include "core/html/HTMLMediaElement.h" |
| 9 #include "core/html/track/VideoTrack.h" | 9 #include "core/html/track/VideoTrack.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 PassRefPtrWillBeRawPtr<VideoTrackList> VideoTrackList::create(HTMLMediaElement&
mediaElement) | 13 PassRefPtrWillBeRawPtr<VideoTrackList> VideoTrackList::create(HTMLMediaElement&
mediaElement) |
| 14 { | 14 { |
| 15 return adoptRefWillBeNoop(new VideoTrackList(mediaElement)); | 15 return adoptRefWillBeNoop(new VideoTrackList(mediaElement)); |
| 16 } | 16 } |
| 17 | 17 |
| 18 VideoTrackList::~VideoTrackList() | 18 VideoTrackList::~VideoTrackList() |
| 19 { | 19 { |
| 20 } | 20 } |
| 21 | 21 |
| 22 VideoTrackList::VideoTrackList(HTMLMediaElement& mediaElement) | 22 VideoTrackList::VideoTrackList(HTMLMediaElement& mediaElement) |
| 23 : TrackListBase<VideoTrack>(&mediaElement) | 23 : TrackListBase<VideoTrack>(&mediaElement) |
| 24 { | 24 { |
| 25 ScriptWrappable::init(this); | |
| 26 } | 25 } |
| 27 | 26 |
| 28 const AtomicString& VideoTrackList::interfaceName() const | 27 const AtomicString& VideoTrackList::interfaceName() const |
| 29 { | 28 { |
| 30 return EventTargetNames::VideoTrackList; | 29 return EventTargetNames::VideoTrackList; |
| 31 } | 30 } |
| 32 | 31 |
| 33 int VideoTrackList::selectedIndex() const | 32 int VideoTrackList::selectedIndex() const |
| 34 { | 33 { |
| 35 for (unsigned i = 0; i < length(); ++i) { | 34 for (unsigned i = 0; i < length(); ++i) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 51 if (track->trackId() != selectedTrackId) | 50 if (track->trackId() != selectedTrackId) |
| 52 track->clearSelected(); | 51 track->clearSelected(); |
| 53 else | 52 else |
| 54 ASSERT(track->selected()); | 53 ASSERT(track->selected()); |
| 55 } | 54 } |
| 56 | 55 |
| 57 scheduleChangeEvent(); | 56 scheduleChangeEvent(); |
| 58 } | 57 } |
| 59 | 58 |
| 60 } | 59 } |
| OLD | NEW |