OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 } | 640 } |
641 | 641 |
642 WebMediaPlayer* TestWebViewDelegate::createMediaPlayer( | 642 WebMediaPlayer* TestWebViewDelegate::createMediaPlayer( |
643 WebFrame* frame, WebMediaPlayerClient* client) { | 643 WebFrame* frame, WebMediaPlayerClient* client) { |
644 scoped_ptr<media::MessageLoopFactory> message_loop_factory( | 644 scoped_ptr<media::MessageLoopFactory> message_loop_factory( |
645 new media::MessageLoopFactoryImpl()); | 645 new media::MessageLoopFactoryImpl()); |
646 | 646 |
647 scoped_ptr<media::FilterCollection> collection( | 647 scoped_ptr<media::FilterCollection> collection( |
648 new media::FilterCollection()); | 648 new media::FilterCollection()); |
649 | 649 |
650 scoped_refptr<webkit_media::VideoRendererImpl> video_renderer( | |
651 new webkit_media::VideoRendererImpl(false)); | |
652 collection->AddVideoRenderer(video_renderer); | |
653 | |
654 scoped_ptr<webkit_media::WebMediaPlayerImpl> result( | 650 scoped_ptr<webkit_media::WebMediaPlayerImpl> result( |
655 new webkit_media::WebMediaPlayerImpl( | 651 new webkit_media::WebMediaPlayerImpl( |
656 client, | 652 client, |
657 base::WeakPtr<webkit_media::WebMediaPlayerDelegate>(), | 653 base::WeakPtr<webkit_media::WebMediaPlayerDelegate>(), |
658 collection.release(), | 654 collection.release(), |
659 message_loop_factory.release(), | 655 message_loop_factory.release(), |
660 NULL, | 656 NULL, |
661 new media::MediaLog())); | 657 new media::MediaLog())); |
662 if (!result->Initialize(frame, false, video_renderer)) { | 658 if (!result->Initialize(frame, false)) { |
663 return NULL; | 659 return NULL; |
664 } | 660 } |
665 return result.release(); | 661 return result.release(); |
666 } | 662 } |
667 | 663 |
668 WebApplicationCacheHost* TestWebViewDelegate::createApplicationCacheHost( | 664 WebApplicationCacheHost* TestWebViewDelegate::createApplicationCacheHost( |
669 WebFrame* frame, WebApplicationCacheHostClient* client) { | 665 WebFrame* frame, WebApplicationCacheHostClient* client) { |
670 return SimpleAppCacheSystem::CreateApplicationCacheHost(client); | 666 return SimpleAppCacheSystem::CreateApplicationCacheHost(client); |
671 } | 667 } |
672 | 668 |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1155 } | 1151 } |
1156 | 1152 |
1157 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { | 1153 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { |
1158 fake_rect_ = rect; | 1154 fake_rect_ = rect; |
1159 using_fake_rect_ = true; | 1155 using_fake_rect_ = true; |
1160 } | 1156 } |
1161 | 1157 |
1162 WebRect TestWebViewDelegate::fake_window_rect() { | 1158 WebRect TestWebViewDelegate::fake_window_rect() { |
1163 return fake_rect_; | 1159 return fake_rect_; |
1164 } | 1160 } |
OLD | NEW |