Index: Source/core/html/track/AudioTrackList.cpp |
diff --git a/Source/core/html/track/AudioTrackList.cpp b/Source/core/html/track/AudioTrackList.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..99ffc75d731ed31a33f84571d3d7d89701a94acd |
--- /dev/null |
+++ b/Source/core/html/track/AudioTrackList.cpp |
@@ -0,0 +1,61 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "config.h" |
+#include "core/html/track/AudioTrackList.h" |
+ |
+#include "core/html/HTMLMediaElement.h" |
+#include "core/html/track/AudioTrack.h" |
+ |
+namespace WebCore { |
+ |
+AudioTrackList::~AudioTrackList() |
+{ |
+} |
+ |
+AudioTrackList::AudioTrackList(HTMLMediaElement* owner) |
+ : TrackBaseList(owner) |
+{ |
+ ScriptWrappable::init(this); |
+} |
+ |
+AudioTrack* AudioTrackList::anonymousIndexedGetter(unsigned index) const |
+{ |
+ return static_cast<AudioTrack*>(getByIndex(index)); |
+} |
+ |
+AudioTrack* AudioTrackList::getTrackById(const AtomicString& id) const |
+{ |
+ return static_cast<AudioTrack*>(getById(id)); |
+} |
+ |
+bool AudioTrackList::hasEnabledTrack() const |
+{ |
+ for (unsigned i = 0; i < length(); ++i) { |
+ if (anonymousIndexedGetter(i)->enabled()) |
+ return true; |
+ } |
+ |
+ return false; |
+} |
+ |
+const AtomicString& AudioTrackList::interfaceName() const |
+{ |
+ return EventTargetNames::AudioTrackList; |
+} |
+ |
+ExecutionContext* AudioTrackList::executionContext() const |
+{ |
+ return owner()->executionContext(); |
fs
2014/02/24 10:32:36
I think owner() can end up being NULL here. I imag
acolwell GONE FROM CHROMIUM
2014/03/07 22:08:43
Fixed. ActiveDOMObject takes care of this now.
|
+} |
+ |
+void AudioTrackList::trackEnabled(const AtomicString& id, bool enabled) |
+{ |
+ if (owner()) |
+ owner()->didEnabledAudioTrackChange(id, enabled); |
+ |
+ scheduleChangeEvent(); |
+} |
+ |
+} |