Chromium Code Reviews| Index: Source/core/html/track/AutomaticTrackSelection.h |
| diff --git a/Source/core/html/track/AutomaticTrackSelection.h b/Source/core/html/track/AutomaticTrackSelection.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..89433628d28123724582c1e138ca46bc263e64b1 |
| --- /dev/null |
| +++ b/Source/core/html/track/AutomaticTrackSelection.h |
| @@ -0,0 +1,41 @@ |
| +// Copyright 2015 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. |
| + |
| +#ifndef AutomaticTrackSelection_h |
| +#define AutomaticTrackSelection_h |
| + |
| +#include "platform/heap/Handle.h" |
| + |
| +namespace blink { |
| + |
| +class TextTrackList; |
| +class TrackGroup; |
| + |
| +class AutomaticTrackSelection { |
| + STACK_ALLOCATED(); |
| +public: |
| + struct Configuration { |
| + Configuration() |
| + : disableCurrentlyEnabledTracks(false) |
| + , forceEnableSubtitleOrCaptionTrack(false) { } |
| + |
| + bool disableCurrentlyEnabledTracks; |
| + bool forceEnableSubtitleOrCaptionTrack; |
| + }; |
| + |
| + AutomaticTrackSelection(TextTrackList*, const Configuration&); |
| + |
| + void perform(); |
| + |
| +private: |
| + void performAutomaticTextTrackSelection(const TrackGroup&); |
| + void enableDefaultMetadataTextTracks(const TrackGroup&); |
| + |
| + RawPtrWillBeMember<TextTrackList> m_textTracks; |
|
philipj_slow
2015/02/11 03:00:24
Could we make this an argument to perform() to sav
fs
2015/02/11 10:02:26
Done. (Wanted to make it 'const' too, but apparent
philipj_slow
2015/02/11 10:29:54
Well, it does modify the members of the list, so e
|
| + Configuration m_configuration; |
|
philipj_slow
2015/02/11 03:00:24
Make it const to document that performing track se
fs
2015/02/11 10:02:26
Done. (Unit-testability would require passing the
|
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // AutomaticTrackSelection_h |