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

Unified Diff: webkit/media/webinbandtexttrack_impl.cc

Issue 13419002: Media Source dispatches inband text tracks (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: incorporated aaron's comments Created 7 years, 7 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: webkit/media/webinbandtexttrack_impl.cc
diff --git a/webkit/media/webinbandtexttrack_impl.cc b/webkit/media/webinbandtexttrack_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ed642005fb4248cd26c6e8cf998998d7e2b83d99
--- /dev/null
+++ b/webkit/media/webinbandtexttrack_impl.cc
@@ -0,0 +1,76 @@
+// Copyright (c) 2013 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.
+
+#include "webkit/media/webinbandtexttrack_impl.h"
+
+#include "base/logging.h"
+
+namespace webkit_media {
+
+WebInbandTextTrackImpl::WebInbandTextTrackImpl(
+ Kind kind,
+ const WebKit::WebString& label,
+ const WebKit::WebString& language,
+ int index)
+ : client_(NULL),
+ mode_(ModeDisabled),
+ kind_(kind),
+ label_(label),
+ language_(language),
+ index_(index) {
+}
+
+WebInbandTextTrackImpl::~WebInbandTextTrackImpl() {
+ DCHECK(!client_);
+}
+
+void WebInbandTextTrackImpl::setClient(
+ WebKit::WebInbandTextTrackClient* client) {
+ client_ = client;
+}
+
+WebKit::WebInbandTextTrackClient* WebInbandTextTrackImpl::client() {
+ return client_;
+}
+
+void WebInbandTextTrackImpl::setMode(Mode mode) {
+ mode_ = mode;
+}
+
+WebInbandTextTrackImpl::Mode WebInbandTextTrackImpl::mode() const {
+ return mode_;
+}
+
+WebInbandTextTrackImpl::Kind WebInbandTextTrackImpl::kind() const {
+ return kind_;
+}
+
+bool WebInbandTextTrackImpl::isClosedCaptions() const {
+ switch (kind_) {
+ case KindCaptions:
+ case KindSubtitles:
+ return true;
+
+ default:
+ return false;
+ }
+}
+
+WebKit::WebString WebInbandTextTrackImpl::label() const {
+ return label_;
+}
+
+WebKit::WebString WebInbandTextTrackImpl::language() const {
+ return language_;
+}
+
+bool WebInbandTextTrackImpl::isDefault() const {
+ return false;
+}
+
+int WebInbandTextTrackImpl::textTrackIndex() const {
+ return index_;
+}
+
+} // namespace webkit_media

Powered by Google App Engine
This is Rietveld 408576698