Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(931)

Unified Diff: Source/core/html/track/AutomaticTrackSelection.h

Issue 868113005: Move automatic text track selection code to AutomaticTrackSelection helper (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698