| 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 #ifndef VideoTrack_h | 5 #ifndef VideoTrack_h |
| 6 #define VideoTrack_h | 6 #define VideoTrack_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
| 9 #include "core/CoreExport.h" | 9 #include "core/CoreExport.h" |
| 10 #include "core/html/track/TrackBase.h" | 10 #include "core/html/track/TrackBase.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 class CORE_EXPORT VideoTrack final : public NoBaseWillBeGarbageCollectedFinalize
d<VideoTrack>, public TrackBase, public ScriptWrappable { | 14 class CORE_EXPORT VideoTrack final : public NoBaseWillBeGarbageCollectedFinalize
d<VideoTrack>, public TrackBase, public ScriptWrappable { |
| 15 DEFINE_WRAPPERTYPEINFO(); | 15 DEFINE_WRAPPERTYPEINFO(); |
| 16 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(VideoTrack); | 16 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(VideoTrack); |
| 17 public: | 17 public: |
| 18 static PassRefPtrWillBeRawPtr<VideoTrack> create(const String& id, const Ato
micString& kind, const AtomicString& label, const AtomicString& language, bool s
elected) | 18 static PassRefPtrWillBeRawPtr<VideoTrack> create(const String& id, const Ato
micString& kind, const AtomicString& label, const AtomicString& language, bool s
elected) |
| 19 { | 19 { |
| 20 return adoptRefWillBeNoop(new VideoTrack(id, kind, label, language, sele
cted)); | 20 return adoptRefWillBeNoop(new VideoTrack(id, kind, label, language, sele
cted)); |
| 21 } | 21 } |
| 22 | 22 |
| 23 virtual ~VideoTrack(); | 23 ~VideoTrack() override; |
| 24 DECLARE_VIRTUAL_TRACE(); | 24 DECLARE_VIRTUAL_TRACE(); |
| 25 | 25 |
| 26 bool selected() const { return m_selected; } | 26 bool selected() const { return m_selected; } |
| 27 void setSelected(bool); | 27 void setSelected(bool); |
| 28 | 28 |
| 29 // Set selected to false without notifying the owner media element. Used whe
n | 29 // Set selected to false without notifying the owner media element. Used whe
n |
| 30 // another video track is selected, implicitly deselecting this one. | 30 // another video track is selected, implicitly deselecting this one. |
| 31 void clearSelected() { m_selected = false; } | 31 void clearSelected() { m_selected = false; } |
| 32 | 32 |
| 33 // Valid kind keywords. | 33 // Valid kind keywords. |
| 34 static const AtomicString& alternativeKeyword(); | 34 static const AtomicString& alternativeKeyword(); |
| 35 static const AtomicString& captionsKeyword(); | 35 static const AtomicString& captionsKeyword(); |
| 36 static const AtomicString& mainKeyword(); | 36 static const AtomicString& mainKeyword(); |
| 37 static const AtomicString& signKeyword(); | 37 static const AtomicString& signKeyword(); |
| 38 static const AtomicString& subtitlesKeyword(); | 38 static const AtomicString& subtitlesKeyword(); |
| 39 static const AtomicString& commentaryKeyword(); | 39 static const AtomicString& commentaryKeyword(); |
| 40 | 40 |
| 41 static bool isValidKindKeyword(const String&); | 41 static bool isValidKindKeyword(const String&); |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 VideoTrack(const String& id, const AtomicString& kind, const AtomicString& l
abel, const AtomicString& language, bool selected); | 44 VideoTrack(const String& id, const AtomicString& kind, const AtomicString& l
abel, const AtomicString& language, bool selected); |
| 45 | 45 |
| 46 // TrackBase | 46 // TrackBase |
| 47 virtual bool isValidKind(const AtomicString& kind) const override { return i
sValidKindKeyword(kind); } | 47 bool isValidKind(const AtomicString& kind) const override { return isValidKi
ndKeyword(kind); } |
| 48 virtual AtomicString defaultKind() const override; | 48 AtomicString defaultKind() const override; |
| 49 | 49 |
| 50 bool m_selected; | 50 bool m_selected; |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 DEFINE_TRACK_TYPE_CASTS(VideoTrack, TrackBase::VideoTrack); | 53 DEFINE_TRACK_TYPE_CASTS(VideoTrack, TrackBase::VideoTrack); |
| 54 | 54 |
| 55 } // namespace blink | 55 } // namespace blink |
| 56 | 56 |
| 57 #endif // VideoTrack_h | 57 #endif // VideoTrack_h |
| OLD | NEW |