OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "webkit/renderer/media/texttrack_impl.h" | |
6 | |
7 #include "third_party/WebKit/public/web/WebInbandTextTrackClient.h" | |
8 #include "webkit/renderer/media/webinbandtexttrack_impl.h" | |
9 | |
10 namespace webkit_media { | |
11 | |
12 TextTrackImpl::TextTrackImpl(WebInbandTextTrackImpl* text_track) | |
13 : text_track_(text_track) { | |
14 // This impl object assumes ownership of the text_track object. | |
15 } | |
16 | |
17 TextTrackImpl::~TextTrackImpl() { | |
18 } | |
19 | |
20 void TextTrackImpl::addWebVTTCue(const base::TimeDelta& start, | |
21 const base::TimeDelta& end, | |
22 const std::string& id, | |
23 const std::string& content, | |
24 const std::string& settings) { | |
25 if (WebKit::WebInbandTextTrackClient* client = text_track_->client()) | |
26 client->addWebVTTCue(start.InSecondsF(), | |
27 end.InSecondsF(), | |
28 WebKit::WebString::fromUTF8(id), | |
29 WebKit::WebString::fromUTF8(content), | |
30 WebKit::WebString::fromUTF8(settings)); | |
31 } | |
32 | |
33 } // namespace webkit_media | |
OLD | NEW |