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