| OLD | NEW |
| 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 // 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_ptr<webkit_media::WebMediaPlayerImpl> result( | 650 webkit_media::WebMediaPlayerImpl* media_player = |
| 651 new webkit_media::WebMediaPlayerImpl( | 651 new webkit_media::WebMediaPlayerImpl( |
| 652 client, | 652 client, |
| 653 base::WeakPtr<webkit_media::WebMediaPlayerDelegate>(), | 653 base::WeakPtr<webkit_media::WebMediaPlayerDelegate>(), |
| 654 collection.release(), | 654 collection.release(), |
| 655 NULL, | 655 NULL, |
| 656 message_loop_factory.release(), | 656 message_loop_factory.release(), |
| 657 NULL, | 657 NULL, |
| 658 new media::MediaLog())); | 658 new media::MediaLog()); |
| 659 if (!result->Initialize(frame, false)) { | 659 media_player->Initialize(frame); |
| 660 return NULL; | 660 return media_player; |
| 661 } | |
| 662 return result.release(); | |
| 663 } | 661 } |
| 664 | 662 |
| 665 WebApplicationCacheHost* TestWebViewDelegate::createApplicationCacheHost( | 663 WebApplicationCacheHost* TestWebViewDelegate::createApplicationCacheHost( |
| 666 WebFrame* frame, WebApplicationCacheHostClient* client) { | 664 WebFrame* frame, WebApplicationCacheHostClient* client) { |
| 667 return SimpleAppCacheSystem::CreateApplicationCacheHost(client); | 665 return SimpleAppCacheSystem::CreateApplicationCacheHost(client); |
| 668 } | 666 } |
| 669 | 667 |
| 670 bool TestWebViewDelegate::allowPlugins(WebFrame* frame, | 668 bool TestWebViewDelegate::allowPlugins(WebFrame* frame, |
| 671 bool enabled_per_settings) { | 669 bool enabled_per_settings) { |
| 672 return enabled_per_settings && shell_->allow_plugins(); | 670 return enabled_per_settings && shell_->allow_plugins(); |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1156 } | 1154 } |
| 1157 | 1155 |
| 1158 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { | 1156 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { |
| 1159 fake_rect_ = rect; | 1157 fake_rect_ = rect; |
| 1160 using_fake_rect_ = true; | 1158 using_fake_rect_ = true; |
| 1161 } | 1159 } |
| 1162 | 1160 |
| 1163 WebRect TestWebViewDelegate::fake_window_rect() { | 1161 WebRect TestWebViewDelegate::fake_window_rect() { |
| 1164 return fake_rect_; | 1162 return fake_rect_; |
| 1165 } | 1163 } |
| OLD | NEW |