| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "android_webview/renderer/aw_content_renderer_client.h" | 5 #include "android_webview/renderer/aw_content_renderer_client.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "android_webview/common/aw_resource.h" | 9 #include "android_webview/common/aw_resource.h" |
| 10 #include "android_webview/common/aw_switches.h" | 10 #include "android_webview/common/aw_switches.h" |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 unsigned long long AwContentRendererClient::VisitedLinkHash( | 211 unsigned long long AwContentRendererClient::VisitedLinkHash( |
| 212 const char* canonical_url, | 212 const char* canonical_url, |
| 213 size_t length) { | 213 size_t length) { |
| 214 return visited_link_slave_->ComputeURLFingerprint(canonical_url, length); | 214 return visited_link_slave_->ComputeURLFingerprint(canonical_url, length); |
| 215 } | 215 } |
| 216 | 216 |
| 217 bool AwContentRendererClient::IsLinkVisited(unsigned long long link_hash) { | 217 bool AwContentRendererClient::IsLinkVisited(unsigned long long link_hash) { |
| 218 return visited_link_slave_->IsVisited(link_hash); | 218 return visited_link_slave_->IsVisited(link_hash); |
| 219 } | 219 } |
| 220 | 220 |
| 221 void AwContentRendererClient::AddKeySystems( | 221 void AwContentRendererClient::AddSupportedKeySystems( |
| 222 std::vector<media::KeySystemInfo>* key_systems) { | 222 std::vector<std::unique_ptr<::media::KeySystemProperties>>* key_systems) { |
| 223 AwAddKeySystems(key_systems); | 223 AwAddKeySystems(key_systems); |
| 224 } | 224 } |
| 225 | 225 |
| 226 bool AwContentRendererClient::ShouldUseMediaPlayerForURL(const GURL& url) { | 226 bool AwContentRendererClient::ShouldUseMediaPlayerForURL(const GURL& url) { |
| 227 // Android WebView needs to support codecs that Chrome does not, for these | 227 // Android WebView needs to support codecs that Chrome does not, for these |
| 228 // cases we must force the usage of Android MediaPlayer instead of Chrome's | 228 // cases we must force the usage of Android MediaPlayer instead of Chrome's |
| 229 // internal player. | 229 // internal player. |
| 230 // | 230 // |
| 231 // Note: Despite these extensions being forwarded for playback to MediaPlayer, | 231 // Note: Despite these extensions being forwarded for playback to MediaPlayer, |
| 232 // HTMLMediaElement.canPlayType() will return empty for these containers. | 232 // HTMLMediaElement.canPlayType() will return empty for these containers. |
| 233 // TODO(boliu): If this is important, extend media::MimeUtil for WebView. | 233 // TODO(boliu): If this is important, extend media::MimeUtil for WebView. |
| 234 // | 234 // |
| 235 // Format list mirrors: | 235 // Format list mirrors: |
| 236 // http://developer.android.com/guide/appendix/media-formats.html | 236 // http://developer.android.com/guide/appendix/media-formats.html |
| 237 static const char* kMediaPlayerExtensions[] = { | 237 static const char* kMediaPlayerExtensions[] = { |
| 238 ".3gp", ".ts", ".flac", ".mid", ".xmf", | 238 ".3gp", ".ts", ".flac", ".mid", ".xmf", |
| 239 ".mxmf", ".rtttl", ".rtx", ".ota", ".imy"}; | 239 ".mxmf", ".rtttl", ".rtx", ".ota", ".imy"}; |
| 240 for (const auto& extension : kMediaPlayerExtensions) { | 240 for (const auto& extension : kMediaPlayerExtensions) { |
| 241 if (base::EndsWith(url.path(), extension, | 241 if (base::EndsWith(url.path(), extension, |
| 242 base::CompareCase::INSENSITIVE_ASCII)) { | 242 base::CompareCase::INSENSITIVE_ASCII)) { |
| 243 return true; | 243 return true; |
| 244 } | 244 } |
| 245 } | 245 } |
| 246 return false; | 246 return false; |
| 247 } | 247 } |
| 248 | 248 |
| 249 } // namespace android_webview | 249 } // namespace android_webview |
| OLD | NEW |