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 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
722 WebWorker* TestWebViewDelegate::createWorker( | 722 WebWorker* TestWebViewDelegate::createWorker( |
723 WebFrame* frame, WebWorkerClient* client) { | 723 WebFrame* frame, WebWorkerClient* client) { |
724 return new TestWebWorker(); | 724 return new TestWebWorker(); |
725 } | 725 } |
726 | 726 |
727 WebMediaPlayer* TestWebViewDelegate::createMediaPlayer( | 727 WebMediaPlayer* TestWebViewDelegate::createMediaPlayer( |
728 WebFrame* frame, WebMediaPlayerClient* client) { | 728 WebFrame* frame, WebMediaPlayerClient* client) { |
729 scoped_ptr<media::FilterCollection> collection( | 729 scoped_ptr<media::FilterCollection> collection( |
730 new media::FilterCollection()); | 730 new media::FilterCollection()); |
731 | 731 |
732 // TODO(annacc): do we still need appcache_host? http://crbug.com/65135 | 732 appcache::WebApplicationCacheHostImpl* appcache_host = |
733 // appcache::WebApplicationCacheHostImpl* appcache_host = | 733 appcache::WebApplicationCacheHostImpl::FromFrame(frame); |
734 // appcache::WebApplicationCacheHostImpl::FromFrame(frame); | 734 |
| 735 // TODO(hclam): this is the same piece of code as in RenderView, maybe they |
| 736 // should be grouped together. |
| 737 webkit_glue::MediaResourceLoaderBridgeFactory* bridge_factory_simple = |
| 738 new webkit_glue::MediaResourceLoaderBridgeFactory( |
| 739 GURL(frame->url()), // referrer |
| 740 "null", // frame origin |
| 741 "null", // main_frame_origin |
| 742 base::GetCurrentProcId(), |
| 743 appcache_host ? appcache_host->host_id() : appcache::kNoHostId, |
| 744 0); |
| 745 webkit_glue::MediaResourceLoaderBridgeFactory* bridge_factory_buffered = |
| 746 new webkit_glue::MediaResourceLoaderBridgeFactory( |
| 747 GURL(frame->url()), // referrer |
| 748 "null", // frame origin |
| 749 "null", // main_frame_origin |
| 750 base::GetCurrentProcId(), |
| 751 appcache_host ? appcache_host->host_id() : appcache::kNoHostId, |
| 752 0); |
735 | 753 |
736 scoped_refptr<webkit_glue::VideoRendererImpl> video_renderer( | 754 scoped_refptr<webkit_glue::VideoRendererImpl> video_renderer( |
737 new webkit_glue::VideoRendererImpl(false)); | 755 new webkit_glue::VideoRendererImpl(false)); |
738 collection->AddVideoRenderer(video_renderer); | 756 collection->AddVideoRenderer(video_renderer); |
739 | 757 |
740 scoped_ptr<webkit_glue::WebMediaPlayerImpl> result( | 758 scoped_ptr<webkit_glue::WebMediaPlayerImpl> result( |
741 new webkit_glue::WebMediaPlayerImpl(client, collection.release())); | 759 new webkit_glue::WebMediaPlayerImpl(client, collection.release())); |
742 if (!result->Initialize(frame, false, video_renderer)) { | 760 if (!result->Initialize(bridge_factory_simple, |
| 761 bridge_factory_buffered, |
| 762 false, |
| 763 video_renderer)) { |
743 return NULL; | 764 return NULL; |
744 } | 765 } |
745 return result.release(); | 766 return result.release(); |
746 } | 767 } |
747 | 768 |
748 WebApplicationCacheHost* TestWebViewDelegate::createApplicationCacheHost( | 769 WebApplicationCacheHost* TestWebViewDelegate::createApplicationCacheHost( |
749 WebFrame* frame, WebApplicationCacheHostClient* client) { | 770 WebFrame* frame, WebApplicationCacheHostClient* client) { |
750 return SimpleAppCacheSystem::CreateApplicationCacheHost(client); | 771 return SimpleAppCacheSystem::CreateApplicationCacheHost(client); |
751 } | 772 } |
752 | 773 |
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1338 } | 1359 } |
1339 | 1360 |
1340 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { | 1361 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { |
1341 fake_rect_ = rect; | 1362 fake_rect_ = rect; |
1342 using_fake_rect_ = true; | 1363 using_fake_rect_ = true; |
1343 } | 1364 } |
1344 | 1365 |
1345 WebRect TestWebViewDelegate::fake_window_rect() { | 1366 WebRect TestWebViewDelegate::fake_window_rect() { |
1346 return fake_rect_; | 1367 return fake_rect_; |
1347 } | 1368 } |
OLD | NEW |