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/AudioTrack.h" | 5 #include "core/html/track/AudioTrack.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 |
11 AudioTrack::AudioTrack(const String& id, const AtomicString& kind, const AtomicS
tring& label, const AtomicString& language, bool enabled) | 11 AudioTrack::AudioTrack(const String& id, const AtomicString& kind, const AtomicS
tring& label, const AtomicString& language, bool enabled) |
12 : TrackBase(WebMediaPlayer::AudioTrack, label, language, id) | 12 : TrackBase(WebMediaPlayer::AudioTrack, kind, label, language, id) |
13 , m_enabled(enabled) | 13 , m_enabled(enabled) |
14 { | 14 { |
15 setKind(kind); | |
16 } | 15 } |
17 | 16 |
18 AudioTrack::~AudioTrack() | 17 AudioTrack::~AudioTrack() |
19 { | 18 { |
20 } | 19 } |
21 | 20 |
22 DEFINE_TRACE(AudioTrack) | 21 DEFINE_TRACE(AudioTrack) |
23 { | 22 { |
24 TrackBase::trace(visitor); | 23 TrackBase::trace(visitor); |
25 } | 24 } |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 } | 65 } |
67 | 66 |
68 const AtomicString& AudioTrack::commentaryKeyword() | 67 const AtomicString& AudioTrack::commentaryKeyword() |
69 { | 68 { |
70 DEFINE_STATIC_LOCAL(const AtomicString, keyword, ("commentary")); | 69 DEFINE_STATIC_LOCAL(const AtomicString, keyword, ("commentary")); |
71 return keyword; | 70 return keyword; |
72 } | 71 } |
73 | 72 |
74 bool AudioTrack::isValidKindKeyword(const String& kind) | 73 bool AudioTrack::isValidKindKeyword(const String& kind) |
75 { | 74 { |
76 return (kind == alternativeKeyword()) | 75 return kind == alternativeKeyword() |
77 || (kind == descriptionsKeyword()) | 76 || kind == descriptionsKeyword() |
78 || (kind == mainKeyword()) | 77 || kind == mainKeyword() |
79 || (kind == mainDescriptionsKeyword()) | 78 || kind == mainDescriptionsKeyword() |
80 || (kind == translationKeyword()) | 79 || kind == translationKeyword() |
81 || (kind == commentaryKeyword()) | 80 || kind == commentaryKeyword() |
82 || (kind == emptyAtom); | 81 || kind == emptyAtom; |
83 } | |
84 | |
85 AtomicString AudioTrack::invalidValueDefaultKind() const | |
86 { | |
87 return emptyAtom; | |
88 } | 82 } |
89 | 83 |
90 } // namespace blink | 84 } // namespace blink |
OLD | NEW |