Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(448)

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 10413015: Upstream implementation for embedded video for WebMediaPlayerAndroid (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase after https://chromiumcodereview.appspot.com/10469003/ got committed Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | media/base/android/media_player_bridge.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" 181 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h"
182 #include "webkit/media/webmediaplayer_impl.h" 182 #include "webkit/media/webmediaplayer_impl.h"
183 #include "webkit/plugins/npapi/plugin_list.h" 183 #include "webkit/plugins/npapi/plugin_list.h"
184 #include "webkit/plugins/npapi/webplugin_delegate.h" 184 #include "webkit/plugins/npapi/webplugin_delegate.h"
185 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" 185 #include "webkit/plugins/npapi/webplugin_delegate_impl.h"
186 #include "webkit/plugins/npapi/webplugin_impl.h" 186 #include "webkit/plugins/npapi/webplugin_impl.h"
187 #include "webkit/plugins/ppapi/ppapi_webplugin_impl.h" 187 #include "webkit/plugins/ppapi/ppapi_webplugin_impl.h"
188 188
189 #if defined(OS_ANDROID) 189 #if defined(OS_ANDROID)
190 #include "webkit/media/android/webmediaplayer_android.h" 190 #include "webkit/media/android/webmediaplayer_android.h"
191 #include "webkit/media/android/webmediaplayer_manager_android.h"
191 #elif defined(OS_WIN) 192 #elif defined(OS_WIN)
192 // TODO(port): these files are currently Windows only because they concern: 193 // TODO(port): these files are currently Windows only because they concern:
193 // * theming 194 // * theming
194 #include "ui/base/native_theme/native_theme_win.h" 195 #include "ui/base/native_theme/native_theme_win.h"
195 #elif defined(USE_X11) 196 #elif defined(USE_X11)
196 #include "third_party/WebKit/Source/WebKit/chromium/public/linux/WebRenderTheme. h" 197 #include "third_party/WebKit/Source/WebKit/chromium/public/linux/WebRenderTheme. h"
197 #include "ui/base/native_theme/native_theme.h" 198 #include "ui/base/native_theme/native_theme.h"
198 #elif defined(OS_MACOSX) 199 #elif defined(OS_MACOSX)
199 #include "skia/ext/skia_utils_mac.h" 200 #include "skia/ext/skia_utils_mac.h"
200 #endif 201 #endif
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 p2p_socket_dispatcher_ = new content::P2PSocketDispatcher(this); 605 p2p_socket_dispatcher_ = new content::P2PSocketDispatcher(this);
605 if (!media_stream_dispatcher_) 606 if (!media_stream_dispatcher_)
606 media_stream_dispatcher_ = new MediaStreamDispatcher(this); 607 media_stream_dispatcher_ = new MediaStreamDispatcher(this);
607 #endif 608 #endif
608 609
609 new MHTMLGenerator(this); 610 new MHTMLGenerator(this);
610 #if defined(OS_MACOSX) 611 #if defined(OS_MACOSX)
611 new TextInputClientObserver(this); 612 new TextInputClientObserver(this);
612 #endif // defined(OS_MACOSX) 613 #endif // defined(OS_MACOSX)
613 614
615 #if defined(OS_ANDROID)
616 media_player_manager_.reset(
617 new webkit_media::WebMediaPlayerManagerAndroid());
618 #endif
619
614 // The next group of objects all implement RenderViewObserver, so are deleted 620 // The next group of objects all implement RenderViewObserver, so are deleted
615 // along with the RenderView automatically. 621 // along with the RenderView automatically.
616 devtools_agent_ = new DevToolsAgent(this); 622 devtools_agent_ = new DevToolsAgent(this);
617 renderer_accessibility_ = new RendererAccessibility(this, accessibility_mode); 623 renderer_accessibility_ = new RendererAccessibility(this, accessibility_mode);
618 mouse_lock_dispatcher_ = new MouseLockDispatcher(this); 624 mouse_lock_dispatcher_ = new MouseLockDispatcher(this);
619 intents_host_ = new WebIntentsHost(this); 625 intents_host_ = new WebIntentsHost(this);
620 626
621 new IdleUserDetector(this); 627 new IdleUserDetector(this);
622 628
623 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 629 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
(...skipping 1671 matching lines...) Expand 10 before | Expand all | Expand 10 after
2295 routing_id_); 2301 routing_id_);
2296 } 2302 }
2297 } 2303 }
2298 2304
2299 WebMediaPlayer* RenderViewImpl::createMediaPlayer( 2305 WebMediaPlayer* RenderViewImpl::createMediaPlayer(
2300 WebFrame* frame, WebMediaPlayerClient* client) { 2306 WebFrame* frame, WebMediaPlayerClient* client) {
2301 FOR_EACH_OBSERVER( 2307 FOR_EACH_OBSERVER(
2302 RenderViewObserver, observers_, WillCreateMediaPlayer(frame, client)); 2308 RenderViewObserver, observers_, WillCreateMediaPlayer(frame, client));
2303 2309
2304 #if defined(OS_ANDROID) 2310 #if defined(OS_ANDROID)
2311 // TODO(qinmin): upstream the implementation of StreamTextureFactoryImpl
2312 // to replace the NULL param here.
2305 return new webkit_media::WebMediaPlayerAndroid( 2313 return new webkit_media::WebMediaPlayerAndroid(
2306 client, cookieJar(frame)); 2314 frame, client, cookieJar(frame), media_player_manager_.get(), NULL);
2307 #endif 2315 #endif
2308 2316
2309 media::MessageLoopFactory* message_loop_factory = 2317 media::MessageLoopFactory* message_loop_factory =
2310 new media::MessageLoopFactory(); 2318 new media::MessageLoopFactory();
2311 media::FilterCollection* collection = new media::FilterCollection(); 2319 media::FilterCollection* collection = new media::FilterCollection();
2312 RenderMediaLog* render_media_log = new RenderMediaLog(); 2320 RenderMediaLog* render_media_log = new RenderMediaLog();
2313 2321
2314 RenderAudioSourceProvider* audio_source_provider = NULL; 2322 RenderAudioSourceProvider* audio_source_provider = NULL;
2315 2323
2316 // Add in any custom filter factories first. 2324 // Add in any custom filter factories first.
(...skipping 2716 matching lines...) Expand 10 before | Expand all | Expand 10 after
5033 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidHandleMouseEvent(event)); 5041 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidHandleMouseEvent(event));
5034 } 5042 }
5035 5043
5036 void RenderViewImpl::DidHandleTouchEvent(const WebTouchEvent& event) { 5044 void RenderViewImpl::DidHandleTouchEvent(const WebTouchEvent& event) {
5037 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidHandleTouchEvent(event)); 5045 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidHandleTouchEvent(event));
5038 } 5046 }
5039 5047
5040 void RenderViewImpl::OnWasHidden() { 5048 void RenderViewImpl::OnWasHidden() {
5041 RenderWidget::OnWasHidden(); 5049 RenderWidget::OnWasHidden();
5042 5050
5051 #if defined(OS_ANDROID)
5052 // Inform WebMediaPlayerManagerAndroid to release all media player resources.
5053 media_player_manager_->ReleaseMediaResources();
5054 #endif
5055
5043 if (webview()) { 5056 if (webview()) {
5044 webview()->settings()->setMinimumTimerInterval( 5057 webview()->settings()->setMinimumTimerInterval(
5045 webkit_glue::kBackgroundTabTimerInterval); 5058 webkit_glue::kBackgroundTabTimerInterval);
5046 webview()->setVisibilityState(visibilityState(), false); 5059 webview()->setVisibilityState(visibilityState(), false);
5047 } 5060 }
5048 5061
5049 // Inform PPAPI plugins that their page is no longer visible. 5062 // Inform PPAPI plugins that their page is no longer visible.
5050 pepper_delegate_.PageVisibilityChanged(false); 5063 pepper_delegate_.PageVisibilityChanged(false);
5051 5064
5052 #if defined(OS_MACOSX) 5065 #if defined(OS_MACOSX)
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
5536 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { 5549 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const {
5537 return !!RenderThreadImpl::current()->compositor_thread(); 5550 return !!RenderThreadImpl::current()->compositor_thread();
5538 } 5551 }
5539 5552
5540 void RenderViewImpl::OnJavaBridgeInit() { 5553 void RenderViewImpl::OnJavaBridgeInit() {
5541 DCHECK(!java_bridge_dispatcher_); 5554 DCHECK(!java_bridge_dispatcher_);
5542 #if defined(ENABLE_JAVA_BRIDGE) 5555 #if defined(ENABLE_JAVA_BRIDGE)
5543 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); 5556 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this);
5544 #endif 5557 #endif
5545 } 5558 }
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | media/base/android/media_player_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698