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 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
747 "null", // frame origin | 747 "null", // frame origin |
748 "null", // main_frame_origin | 748 "null", // main_frame_origin |
749 base::GetCurrentProcId(), | 749 base::GetCurrentProcId(), |
750 appcache_host ? appcache_host->host_id() : appcache::kNoHostId, | 750 appcache_host ? appcache_host->host_id() : appcache::kNoHostId, |
751 0); | 751 0); |
752 | 752 |
753 scoped_refptr<webkit_glue::VideoRendererImpl> video_renderer( | 753 scoped_refptr<webkit_glue::VideoRendererImpl> video_renderer( |
754 new webkit_glue::VideoRendererImpl(false)); | 754 new webkit_glue::VideoRendererImpl(false)); |
755 collection->AddVideoRenderer(video_renderer); | 755 collection->AddVideoRenderer(video_renderer); |
756 | 756 |
757 return new webkit_glue::WebMediaPlayerImpl( | 757 scoped_ptr<webkit_glue::WebMediaPlayerImpl> result( |
758 client, collection.release(), bridge_factory_simple, | 758 new webkit_glue::WebMediaPlayerImpl(client, collection.release())); |
759 bridge_factory_buffered, false, video_renderer); | 759 if (!result->Initialize(bridge_factory_simple, |
| 760 bridge_factory_buffered, |
| 761 false, |
| 762 video_renderer)) { |
| 763 return NULL; |
| 764 } |
| 765 return result.release(); |
760 } | 766 } |
761 | 767 |
762 WebApplicationCacheHost* TestWebViewDelegate::createApplicationCacheHost( | 768 WebApplicationCacheHost* TestWebViewDelegate::createApplicationCacheHost( |
763 WebFrame* frame, WebApplicationCacheHostClient* client) { | 769 WebFrame* frame, WebApplicationCacheHostClient* client) { |
764 return SimpleAppCacheSystem::CreateApplicationCacheHost(client); | 770 return SimpleAppCacheSystem::CreateApplicationCacheHost(client); |
765 } | 771 } |
766 | 772 |
767 bool TestWebViewDelegate::allowPlugins(WebFrame* frame, | 773 bool TestWebViewDelegate::allowPlugins(WebFrame* frame, |
768 bool enabled_per_settings) { | 774 bool enabled_per_settings) { |
769 return enabled_per_settings && shell_->allow_plugins(); | 775 return enabled_per_settings && shell_->allow_plugins(); |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1352 } | 1358 } |
1353 | 1359 |
1354 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { | 1360 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { |
1355 fake_rect_ = rect; | 1361 fake_rect_ = rect; |
1356 using_fake_rect_ = true; | 1362 using_fake_rect_ = true; |
1357 } | 1363 } |
1358 | 1364 |
1359 WebRect TestWebViewDelegate::fake_window_rect() { | 1365 WebRect TestWebViewDelegate::fake_window_rect() { |
1360 return fake_rect_; | 1366 return fake_rect_; |
1361 } | 1367 } |
OLD | NEW |