OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // This file contains the implementation of TestWebViewDelegate, which serves | 5 // This file contains the implementation of TestWebViewDelegate, which serves |
6 // as the WebViewDelegate for the TestShellWebHost. The host is expected to | 6 // as the WebViewDelegate for the TestShellWebHost. The host is expected to |
7 // have initialized a MessageLoop before these methods are called. | 7 // have initialized a MessageLoop before these methods are called. |
8 | 8 |
9 #include "webkit/tools/test_shell/test_webview_delegate.h" | 9 #include "webkit/tools/test_shell/test_webview_delegate.h" |
10 | 10 |
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
719 | 719 |
720 WebWorker* TestWebViewDelegate::createWorker( | 720 WebWorker* TestWebViewDelegate::createWorker( |
721 WebFrame* frame, WebWorkerClient* client) { | 721 WebFrame* frame, WebWorkerClient* client) { |
722 return new TestWebWorker(); | 722 return new TestWebWorker(); |
723 } | 723 } |
724 | 724 |
725 WebMediaPlayer* TestWebViewDelegate::createMediaPlayer( | 725 WebMediaPlayer* TestWebViewDelegate::createMediaPlayer( |
726 WebFrame* frame, WebMediaPlayerClient* client) { | 726 WebFrame* frame, WebMediaPlayerClient* client) { |
727 scoped_ptr<media::MediaFilterCollection> collection( | 727 scoped_ptr<media::MediaFilterCollection> collection( |
728 new media::MediaFilterCollection()); | 728 new media::MediaFilterCollection()); |
729 | 729 /* |
730 appcache::WebApplicationCacheHostImpl* appcache_host = | 730 appcache::WebApplicationCacheHostImpl* appcache_host = |
scherkus (not reviewing)
2010/11/30 20:05:39
ditto
annacc
2010/11/30 21:51:45
Will do.
| |
731 appcache::WebApplicationCacheHostImpl::FromFrame(frame); | 731 appcache::WebApplicationCacheHostImpl::FromFrame(frame); |
732 | 732 */ |
733 // TODO(hclam): this is the same piece of code as in RenderView, maybe they | |
734 // should be grouped together. | |
735 webkit_glue::MediaResourceLoaderBridgeFactory* bridge_factory_simple = | |
736 new webkit_glue::MediaResourceLoaderBridgeFactory( | |
737 GURL(frame->url()), // referrer | |
738 "null", // frame origin | |
739 "null", // main_frame_origin | |
740 base::GetCurrentProcId(), | |
741 appcache_host ? appcache_host->host_id() : appcache::kNoHostId, | |
742 0); | |
743 webkit_glue::MediaResourceLoaderBridgeFactory* bridge_factory_buffered = | |
744 new webkit_glue::MediaResourceLoaderBridgeFactory( | |
745 GURL(frame->url()), // referrer | |
746 "null", // frame origin | |
747 "null", // main_frame_origin | |
748 base::GetCurrentProcId(), | |
749 appcache_host ? appcache_host->host_id() : appcache::kNoHostId, | |
750 0); | |
751 | |
752 scoped_refptr<webkit_glue::VideoRendererImpl> video_renderer( | 733 scoped_refptr<webkit_glue::VideoRendererImpl> video_renderer( |
753 new webkit_glue::VideoRendererImpl(false)); | 734 new webkit_glue::VideoRendererImpl(false)); |
754 collection->AddVideoRenderer(video_renderer); | 735 collection->AddVideoRenderer(video_renderer); |
755 | 736 |
756 return new webkit_glue::WebMediaPlayerImpl( | 737 return new webkit_glue::WebMediaPlayerImpl( |
757 client, collection.release(), bridge_factory_simple, | 738 client, collection.release(), frame, false, video_renderer); |
758 bridge_factory_buffered, false, video_renderer); | |
759 } | 739 } |
760 | 740 |
761 WebApplicationCacheHost* TestWebViewDelegate::createApplicationCacheHost( | 741 WebApplicationCacheHost* TestWebViewDelegate::createApplicationCacheHost( |
762 WebFrame* frame, WebApplicationCacheHostClient* client) { | 742 WebFrame* frame, WebApplicationCacheHostClient* client) { |
763 return SimpleAppCacheSystem::CreateApplicationCacheHost(client); | 743 return SimpleAppCacheSystem::CreateApplicationCacheHost(client); |
764 } | 744 } |
765 | 745 |
766 bool TestWebViewDelegate::allowPlugins(WebFrame* frame, | 746 bool TestWebViewDelegate::allowPlugins(WebFrame* frame, |
767 bool enabled_per_settings) { | 747 bool enabled_per_settings) { |
768 return enabled_per_settings && shell_->allow_plugins(); | 748 return enabled_per_settings && shell_->allow_plugins(); |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1355 } | 1335 } |
1356 | 1336 |
1357 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { | 1337 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { |
1358 fake_rect_ = rect; | 1338 fake_rect_ = rect; |
1359 using_fake_rect_ = true; | 1339 using_fake_rect_ = true; |
1360 } | 1340 } |
1361 | 1341 |
1362 WebRect TestWebViewDelegate::fake_window_rect() { | 1342 WebRect TestWebViewDelegate::fake_window_rect() { |
1363 return fake_rect_; | 1343 return fake_rect_; |
1364 } | 1344 } |
OLD | NEW |