OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 AutomaticTrackSelection_h | 5 #ifndef AutomaticTrackSelection_h |
6 #define AutomaticTrackSelection_h | 6 #define AutomaticTrackSelection_h |
7 | 7 |
8 #include "core/html/track/TextTrackKindUserPreference.h" | 8 #include "core/html/track/TextTrackKindUserPreference.h" |
9 #include "platform/heap/Handle.h" | 9 #include "platform/heap/Handle.h" |
10 #include "wtf/Allocator.h" | 10 #include "wtf/Allocator.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 class TextTrackList; | 14 class TextTrackList; |
15 class TrackGroup; | 15 class TrackGroup; |
16 | 16 |
17 class AutomaticTrackSelection { | 17 class AutomaticTrackSelection { |
18 STACK_ALLOCATED(); | 18 STACK_ALLOCATED(); |
19 public: | 19 public: |
20 struct Configuration { | 20 struct Configuration { |
21 DISALLOW_ALLOCATION(); | 21 DISALLOW_NEW(); |
22 Configuration() | 22 Configuration() |
23 : disableCurrentlyEnabledTracks(false) | 23 : disableCurrentlyEnabledTracks(false) |
24 , forceEnableSubtitleOrCaptionTrack(false) | 24 , forceEnableSubtitleOrCaptionTrack(false) |
25 , textTrackKindUserPreference(TextTrackKindUserPreference::Default)
{ } | 25 , textTrackKindUserPreference(TextTrackKindUserPreference::Default)
{ } |
26 | 26 |
27 bool disableCurrentlyEnabledTracks; | 27 bool disableCurrentlyEnabledTracks; |
28 bool forceEnableSubtitleOrCaptionTrack; | 28 bool forceEnableSubtitleOrCaptionTrack; |
29 TextTrackKindUserPreference textTrackKindUserPreference; | 29 TextTrackKindUserPreference textTrackKindUserPreference; |
30 }; | 30 }; |
31 | 31 |
32 AutomaticTrackSelection(const Configuration&); | 32 AutomaticTrackSelection(const Configuration&); |
33 | 33 |
34 void perform(TextTrackList&); | 34 void perform(TextTrackList&); |
35 | 35 |
36 private: | 36 private: |
37 void performAutomaticTextTrackSelection(const TrackGroup&); | 37 void performAutomaticTextTrackSelection(const TrackGroup&); |
38 void enableDefaultMetadataTextTracks(const TrackGroup&); | 38 void enableDefaultMetadataTextTracks(const TrackGroup&); |
39 const AtomicString& preferredTrackKind() const; | 39 const AtomicString& preferredTrackKind() const; |
40 | 40 |
41 const Configuration m_configuration; | 41 const Configuration m_configuration; |
42 }; | 42 }; |
43 | 43 |
44 } // namespace blink | 44 } // namespace blink |
45 | 45 |
46 #endif // AutomaticTrackSelection_h | 46 #endif // AutomaticTrackSelection_h |
OLD | NEW |