| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 #include "content/renderer/android/synchronous_compositor_factory.h" | 216 #include "content/renderer/android/synchronous_compositor_factory.h" |
| 217 #include "content/renderer/media/android/renderer_media_player_manager.h" | 217 #include "content/renderer/media/android/renderer_media_player_manager.h" |
| 218 #include "content/renderer/media/android/stream_texture_factory_android_impl.h" | 218 #include "content/renderer/media/android/stream_texture_factory_android_impl.h" |
| 219 #include "content/renderer/media/android/webmediaplayer_android.h" | 219 #include "content/renderer/media/android/webmediaplayer_android.h" |
| 220 #include "skia/ext/platform_canvas.h" | 220 #include "skia/ext/platform_canvas.h" |
| 221 #include "third_party/WebKit/public/platform/WebFloatPoint.h" | 221 #include "third_party/WebKit/public/platform/WebFloatPoint.h" |
| 222 #include "third_party/WebKit/public/platform/WebFloatRect.h" | 222 #include "third_party/WebKit/public/platform/WebFloatRect.h" |
| 223 #include "third_party/WebKit/public/web/WebHitTestResult.h" | 223 #include "third_party/WebKit/public/web/WebHitTestResult.h" |
| 224 #include "ui/gfx/rect_f.h" | 224 #include "ui/gfx/rect_f.h" |
| 225 | 225 |
| 226 #if defined(GOOGLE_TV) | |
| 227 #include "content/renderer/media/rtc_video_decoder_bridge_tv.h" | |
| 228 #include "content/renderer/media/rtc_video_decoder_factory_tv.h" | |
| 229 #endif | |
| 230 | |
| 231 #elif defined(OS_WIN) | 226 #elif defined(OS_WIN) |
| 232 // TODO(port): these files are currently Windows only because they concern: | 227 // TODO(port): these files are currently Windows only because they concern: |
| 233 // * theming | 228 // * theming |
| 234 #include "ui/native_theme/native_theme_win.h" | 229 #include "ui/native_theme/native_theme_win.h" |
| 235 #elif defined(USE_X11) | 230 #elif defined(USE_X11) |
| 236 #include "ui/native_theme/native_theme.h" | 231 #include "ui/native_theme/native_theme.h" |
| 237 #elif defined(OS_MACOSX) | 232 #elif defined(OS_MACOSX) |
| 238 #include "skia/ext/skia_utils_mac.h" | 233 #include "skia/ext/skia_utils_mac.h" |
| 239 #endif | 234 #endif |
| 240 | 235 |
| (...skipping 5641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5882 | 5877 |
| 5883 WebMediaPlayer* RenderViewImpl::CreateWebMediaPlayerForMediaStream( | 5878 WebMediaPlayer* RenderViewImpl::CreateWebMediaPlayerForMediaStream( |
| 5884 WebFrame* frame, | 5879 WebFrame* frame, |
| 5885 const blink::WebURL& url, | 5880 const blink::WebURL& url, |
| 5886 WebMediaPlayerClient* client) { | 5881 WebMediaPlayerClient* client) { |
| 5887 #if defined(ENABLE_WEBRTC) | 5882 #if defined(ENABLE_WEBRTC) |
| 5888 if (!InitializeMediaStreamClient()) { | 5883 if (!InitializeMediaStreamClient()) { |
| 5889 LOG(ERROR) << "Failed to initialize MediaStreamClient"; | 5884 LOG(ERROR) << "Failed to initialize MediaStreamClient"; |
| 5890 return NULL; | 5885 return NULL; |
| 5891 } | 5886 } |
| 5892 #if !defined(GOOGLE_TV) | |
| 5893 if (media_stream_client_->IsMediaStream(url)) { | 5887 if (media_stream_client_->IsMediaStream(url)) { |
| 5894 #if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) | 5888 #if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) |
| 5895 bool found_neon = | 5889 bool found_neon = |
| 5896 (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0; | 5890 (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0; |
| 5897 UMA_HISTOGRAM_BOOLEAN("Platform.WebRtcNEONFound", found_neon); | 5891 UMA_HISTOGRAM_BOOLEAN("Platform.WebRtcNEONFound", found_neon); |
| 5898 #endif // defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) | 5892 #endif // defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) |
| 5899 return new WebMediaPlayerMS(frame, client, AsWeakPtr(), | 5893 return new WebMediaPlayerMS(frame, client, AsWeakPtr(), |
| 5900 media_stream_client_, new RenderMediaLog()); | 5894 media_stream_client_, new RenderMediaLog()); |
| 5901 } | 5895 } |
| 5902 #endif // !defined(GOOGLE_TV) | |
| 5903 #endif // defined(ENABLE_WEBRTC) | 5896 #endif // defined(ENABLE_WEBRTC) |
| 5904 return NULL; | 5897 return NULL; |
| 5905 } | 5898 } |
| 5906 | 5899 |
| 5907 #if defined(OS_ANDROID) | 5900 #if defined(OS_ANDROID) |
| 5908 WebContentDetectionResult RenderViewImpl::detectContentAround( | 5901 WebContentDetectionResult RenderViewImpl::detectContentAround( |
| 5909 const WebHitTestResult& touch_hit) { | 5902 const WebHitTestResult& touch_hit) { |
| 5910 DCHECK(!touch_hit.isNull()); | 5903 DCHECK(!touch_hit.isNull()); |
| 5911 DCHECK(!touch_hit.node().isNull()); | 5904 DCHECK(!touch_hit.node().isNull()); |
| 5912 DCHECK(touch_hit.node().isTextNode()); | 5905 DCHECK(touch_hit.node().isTextNode()); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5990 | 5983 |
| 5991 if (!context_provider.get()) { | 5984 if (!context_provider.get()) { |
| 5992 LOG(ERROR) << "Failed to get context3d for media player"; | 5985 LOG(ERROR) << "Failed to get context3d for media player"; |
| 5993 return NULL; | 5986 return NULL; |
| 5994 } | 5987 } |
| 5995 | 5988 |
| 5996 stream_texture_factory.reset(new StreamTextureFactoryImpl( | 5989 stream_texture_factory.reset(new StreamTextureFactoryImpl( |
| 5997 context_provider, gpu_channel_host, routing_id_)); | 5990 context_provider, gpu_channel_host, routing_id_)); |
| 5998 } | 5991 } |
| 5999 | 5992 |
| 6000 scoped_ptr<WebMediaPlayerAndroid> web_media_player_android( | 5993 return new WebMediaPlayerAndroid( |
| 6001 new WebMediaPlayerAndroid( | |
| 6002 frame, | 5994 frame, |
| 6003 client, | 5995 client, |
| 6004 AsWeakPtr(), | 5996 AsWeakPtr(), |
| 6005 media_player_manager_, | 5997 media_player_manager_, |
| 6006 stream_texture_factory.release(), | 5998 stream_texture_factory.release(), |
| 6007 RenderThreadImpl::current()->GetMediaThreadMessageLoopProxy(), | 5999 RenderThreadImpl::current()->GetMediaThreadMessageLoopProxy(), |
| 6008 new RenderMediaLog())); | 6000 new RenderMediaLog()); |
| 6009 #if defined(ENABLE_WEBRTC) && defined(GOOGLE_TV) | |
| 6010 if (media_stream_client_ && media_stream_client_->IsMediaStream(url)) { | |
| 6011 RTCVideoDecoderFactoryTv* factory = RenderThreadImpl::current() | |
| 6012 ->GetMediaStreamDependencyFactory()->decoder_factory_tv(); | |
| 6013 // |media_stream_client| and |factory| outlives |web_media_player_android|. | |
| 6014 if (!factory->AcquireDemuxer() || | |
| 6015 !web_media_player_android->InjectMediaStream( | |
| 6016 media_stream_client_, | |
| 6017 factory, | |
| 6018 base::Bind( | |
| 6019 base::IgnoreResult(&RTCVideoDecoderFactoryTv::ReleaseDemuxer), | |
| 6020 base::Unretained(factory)))) { | |
| 6021 LOG(ERROR) << "Failed to inject media stream."; | |
| 6022 return NULL; | |
| 6023 } | |
| 6024 } | |
| 6025 #endif // defined(ENABLE_WEBRTC) && defined(GOOGLE_TV) | |
| 6026 return web_media_player_android.release(); | |
| 6027 } | 6001 } |
| 6028 | 6002 |
| 6029 #endif // defined(OS_ANDROID) | 6003 #endif // defined(OS_ANDROID) |
| 6030 | 6004 |
| 6031 #if defined(OS_MACOSX) | 6005 #if defined(OS_MACOSX) |
| 6032 void RenderViewImpl::OnSelectPopupMenuItem(int selected_index) { | 6006 void RenderViewImpl::OnSelectPopupMenuItem(int selected_index) { |
| 6033 if (external_popup_menu_ == NULL) { | 6007 if (external_popup_menu_ == NULL) { |
| 6034 // Crash reports from the field indicate that we can be notified with a | 6008 // Crash reports from the field indicate that we can be notified with a |
| 6035 // NULL external popup menu (we probably get notified twice). | 6009 // NULL external popup menu (we probably get notified twice). |
| 6036 // If you hit this please file a bug against jcivelli and include the page | 6010 // If you hit this please file a bug against jcivelli and include the page |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6259 for (size_t i = 0; i < icon_urls.size(); i++) { | 6233 for (size_t i = 0; i < icon_urls.size(); i++) { |
| 6260 WebURL url = icon_urls[i].iconURL(); | 6234 WebURL url = icon_urls[i].iconURL(); |
| 6261 if (!url.isEmpty()) | 6235 if (!url.isEmpty()) |
| 6262 urls.push_back(FaviconURL(url, | 6236 urls.push_back(FaviconURL(url, |
| 6263 ToFaviconType(icon_urls[i].iconType()))); | 6237 ToFaviconType(icon_urls[i].iconType()))); |
| 6264 } | 6238 } |
| 6265 SendUpdateFaviconURL(urls); | 6239 SendUpdateFaviconURL(urls); |
| 6266 } | 6240 } |
| 6267 | 6241 |
| 6268 } // namespace content | 6242 } // namespace content |
| OLD | NEW |