| 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 "media/blink/webmediaplayer_impl.h" | 5 #include "media/blink/webmediaplayer_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1068 const blink::WebString web_label = | 1068 const blink::WebString web_label = |
| 1069 blink::WebString::fromUTF8(config.label()); | 1069 blink::WebString::fromUTF8(config.label()); |
| 1070 const blink::WebString web_language = | 1070 const blink::WebString web_language = |
| 1071 blink::WebString::fromUTF8(config.language()); | 1071 blink::WebString::fromUTF8(config.language()); |
| 1072 const blink::WebString web_id = | 1072 const blink::WebString web_id = |
| 1073 blink::WebString::fromUTF8(config.id()); | 1073 blink::WebString::fromUTF8(config.id()); |
| 1074 | 1074 |
| 1075 scoped_ptr<WebInbandTextTrackImpl> web_inband_text_track( | 1075 scoped_ptr<WebInbandTextTrackImpl> web_inband_text_track( |
| 1076 new WebInbandTextTrackImpl(web_kind, web_label, web_language, web_id)); | 1076 new WebInbandTextTrackImpl(web_kind, web_label, web_language, web_id)); |
| 1077 | 1077 |
| 1078 scoped_ptr<TextTrack> text_track(new TextTrackImpl( | 1078 scoped_ptr<media::TextTrack> text_track(new TextTrackImpl( |
| 1079 main_task_runner_, client_, std::move(web_inband_text_track))); | 1079 main_task_runner_, client_, std::move(web_inband_text_track))); |
| 1080 | 1080 |
| 1081 done_cb.Run(std::move(text_track)); | 1081 done_cb.Run(std::move(text_track)); |
| 1082 } | 1082 } |
| 1083 | 1083 |
| 1084 void WebMediaPlayerImpl::OnHidden() { | 1084 void WebMediaPlayerImpl::OnHidden() { |
| 1085 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 1085 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
| 1086 if (!IsSuspendUponHiddenEnabled()) | 1086 if (!IsSuspendUponHiddenEnabled()) |
| 1087 return; | 1087 return; |
| 1088 | 1088 |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1552 bool WebMediaPlayerImpl::IsAutomaticResumeAllowed() { | 1552 bool WebMediaPlayerImpl::IsAutomaticResumeAllowed() { |
| 1553 #if defined(OS_ANDROID) | 1553 #if defined(OS_ANDROID) |
| 1554 return !hasVideo() || (delegate_ && !delegate_->IsHidden()); | 1554 return !hasVideo() || (delegate_ && !delegate_->IsHidden()); |
| 1555 #else | 1555 #else |
| 1556 // On non-Android platforms Resume() is always allowed. | 1556 // On non-Android platforms Resume() is always allowed. |
| 1557 return true; | 1557 return true; |
| 1558 #endif | 1558 #endif |
| 1559 } | 1559 } |
| 1560 | 1560 |
| 1561 } // namespace media | 1561 } // namespace media |
| OLD | NEW |