| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "content/renderer/media/webinbandtexttrack_impl.h" | 5 #include "content/renderer/media/webinbandtexttrack_impl.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace content { | 9 namespace content { |
| 10 | 10 |
| 11 WebInbandTextTrackImpl::WebInbandTextTrackImpl( | 11 WebInbandTextTrackImpl::WebInbandTextTrackImpl( |
| 12 Kind kind, | 12 Kind kind, |
| 13 const blink::WebString& label, | 13 const blink::WebString& label, |
| 14 const blink::WebString& language, | 14 const blink::WebString& language, |
| 15 int index) | 15 int index) |
| 16 : client_(NULL), | 16 : client_(NULL), |
| 17 mode_(ModeDisabled), | |
| 18 kind_(kind), | 17 kind_(kind), |
| 19 label_(label), | 18 label_(label), |
| 20 language_(language), | 19 language_(language), |
| 21 index_(index) { | 20 index_(index) { |
| 22 } | 21 } |
| 23 | 22 |
| 24 WebInbandTextTrackImpl::~WebInbandTextTrackImpl() { | 23 WebInbandTextTrackImpl::~WebInbandTextTrackImpl() { |
| 25 DCHECK(!client_); | 24 DCHECK(!client_); |
| 26 } | 25 } |
| 27 | 26 |
| 28 void WebInbandTextTrackImpl::setClient( | 27 void WebInbandTextTrackImpl::setClient( |
| 29 blink::WebInbandTextTrackClient* client) { | 28 blink::WebInbandTextTrackClient* client) { |
| 30 client_ = client; | 29 client_ = client; |
| 31 } | 30 } |
| 32 | 31 |
| 33 blink::WebInbandTextTrackClient* WebInbandTextTrackImpl::client() { | 32 blink::WebInbandTextTrackClient* WebInbandTextTrackImpl::client() { |
| 34 return client_; | 33 return client_; |
| 35 } | 34 } |
| 36 | 35 |
| 37 void WebInbandTextTrackImpl::setMode(Mode mode) { | |
| 38 mode_ = mode; | |
| 39 } | |
| 40 | |
| 41 WebInbandTextTrackImpl::Mode WebInbandTextTrackImpl::mode() const { | |
| 42 return mode_; | |
| 43 } | |
| 44 | |
| 45 WebInbandTextTrackImpl::Kind WebInbandTextTrackImpl::kind() const { | 36 WebInbandTextTrackImpl::Kind WebInbandTextTrackImpl::kind() const { |
| 46 return kind_; | 37 return kind_; |
| 47 } | 38 } |
| 48 | 39 |
| 49 bool WebInbandTextTrackImpl::isClosedCaptions() const { | |
| 50 switch (kind_) { | |
| 51 case KindCaptions: | |
| 52 case KindSubtitles: | |
| 53 return true; | |
| 54 | |
| 55 default: | |
| 56 return false; | |
| 57 } | |
| 58 } | |
| 59 | |
| 60 blink::WebString WebInbandTextTrackImpl::label() const { | 40 blink::WebString WebInbandTextTrackImpl::label() const { |
| 61 return label_; | 41 return label_; |
| 62 } | 42 } |
| 63 | 43 |
| 64 blink::WebString WebInbandTextTrackImpl::language() const { | 44 blink::WebString WebInbandTextTrackImpl::language() const { |
| 65 return language_; | 45 return language_; |
| 66 } | 46 } |
| 67 | 47 |
| 68 bool WebInbandTextTrackImpl::isDefault() const { | |
| 69 return false; | |
| 70 } | |
| 71 | |
| 72 int WebInbandTextTrackImpl::textTrackIndex() const { | 48 int WebInbandTextTrackImpl::textTrackIndex() const { |
| 73 return index_; | 49 return index_; |
| 74 } | 50 } |
| 75 | 51 |
| 76 } // namespace content | 52 } // namespace content |
| OLD | NEW |