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/android/webmediaplayer_android.h" | 5 #include "content/renderer/media/android/webmediaplayer_android.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
15 #include "base/metrics/histogram.h" | 15 #include "base/metrics/histogram.h" |
16 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
| 17 #include "base/strings/utf_string_conversions.h" |
17 #include "cc/layers/video_layer.h" | 18 #include "cc/layers/video_layer.h" |
18 #include "content/public/common/content_client.h" | 19 #include "content/public/common/content_client.h" |
19 #include "content/public/renderer/render_frame.h" | 20 #include "content/public/renderer/render_frame.h" |
20 #include "content/renderer/media/android/proxy_media_keys.h" | 21 #include "content/renderer/media/android/proxy_media_keys.h" |
21 #include "content/renderer/media/android/renderer_demuxer_android.h" | 22 #include "content/renderer/media/android/renderer_demuxer_android.h" |
22 #include "content/renderer/media/android/renderer_media_player_manager.h" | 23 #include "content/renderer/media/android/renderer_media_player_manager.h" |
23 #include "content/renderer/media/crypto/key_systems.h" | 24 #include "content/renderer/media/crypto/key_systems.h" |
24 #include "content/renderer/media/webmediaplayer_delegate.h" | 25 #include "content/renderer/media/webmediaplayer_delegate.h" |
25 #include "content/renderer/media/webmediaplayer_util.h" | 26 #include "content/renderer/media/webmediaplayer_util.h" |
26 #include "content/renderer/render_frame_impl.h" | 27 #include "content/renderer/render_frame_impl.h" |
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1093 } | 1094 } |
1094 #endif | 1095 #endif |
1095 | 1096 |
1096 // The following EME related code is copied from WebMediaPlayerImpl. | 1097 // The following EME related code is copied from WebMediaPlayerImpl. |
1097 // TODO(xhwang): Remove duplicate code between WebMediaPlayerAndroid and | 1098 // TODO(xhwang): Remove duplicate code between WebMediaPlayerAndroid and |
1098 // WebMediaPlayerImpl. | 1099 // WebMediaPlayerImpl. |
1099 | 1100 |
1100 // Convert a WebString to ASCII, falling back on an empty string in the case | 1101 // Convert a WebString to ASCII, falling back on an empty string in the case |
1101 // of a non-ASCII string. | 1102 // of a non-ASCII string. |
1102 static std::string ToASCIIOrEmpty(const blink::WebString& string) { | 1103 static std::string ToASCIIOrEmpty(const blink::WebString& string) { |
1103 return IsStringASCII(string) ? UTF16ToASCII(string) : std::string(); | 1104 return IsStringASCII(string) ? base::UTF16ToASCII(string) : std::string(); |
1104 } | 1105 } |
1105 | 1106 |
1106 // Helper functions to report media EME related stats to UMA. They follow the | 1107 // Helper functions to report media EME related stats to UMA. They follow the |
1107 // convention of more commonly used macros UMA_HISTOGRAM_ENUMERATION and | 1108 // convention of more commonly used macros UMA_HISTOGRAM_ENUMERATION and |
1108 // UMA_HISTOGRAM_COUNTS. The reason that we cannot use those macros directly is | 1109 // UMA_HISTOGRAM_COUNTS. The reason that we cannot use those macros directly is |
1109 // that UMA_* macros require the names to be constant throughout the process' | 1110 // that UMA_* macros require the names to be constant throughout the process' |
1110 // lifetime. | 1111 // lifetime. |
1111 | 1112 |
1112 static void EmeUMAHistogramEnumeration(const std::string& key_system, | 1113 static void EmeUMAHistogramEnumeration(const std::string& key_system, |
1113 const std::string& method, | 1114 const std::string& method, |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1442 | 1443 |
1443 void WebMediaPlayerAndroid::exitFullscreen() { | 1444 void WebMediaPlayerAndroid::exitFullscreen() { |
1444 manager_->ExitFullscreen(player_id_); | 1445 manager_->ExitFullscreen(player_id_); |
1445 } | 1446 } |
1446 | 1447 |
1447 bool WebMediaPlayerAndroid::canEnterFullscreen() const { | 1448 bool WebMediaPlayerAndroid::canEnterFullscreen() const { |
1448 return manager_->CanEnterFullscreen(frame_); | 1449 return manager_->CanEnterFullscreen(frame_); |
1449 } | 1450 } |
1450 | 1451 |
1451 } // namespace content | 1452 } // namespace content |
OLD | NEW |