| 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 |
| 11 #include "base/debug/trace_event.h" | 11 #include "base/debug/trace_event.h" |
| 12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
| 13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
| 14 #include "base/process_util.h" | 14 #include "base/process_util.h" |
| 15 #include "base/string_util.h" | 15 #include "base/string_util.h" |
| 16 #include "base/stringprintf.h" | 16 #include "base/stringprintf.h" |
| 17 #include "base/string_number_conversions.h" | 17 #include "base/string_number_conversions.h" |
| 18 #include "base/utf_string_conversions.h" | 18 #include "base/utf_string_conversions.h" |
| 19 #include "media/base/filter_collection.h" | 19 #include "media/base/filter_collection.h" |
| 20 #include "media/base/media_log.h" | 20 #include "media/base/media_log.h" |
| 21 #include "media/base/message_loop_factory.h" | |
| 22 #include "net/base/net_errors.h" | 21 #include "net/base/net_errors.h" |
| 23 #include "third_party/WebKit/Source/Platform/chromium/public/Platform.h" | 22 #include "third_party/WebKit/Source/Platform/chromium/public/Platform.h" |
| 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityObjec
t.h" | 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityObjec
t.h" |
| 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" | 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" |
| 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebContextMenuData.h" | 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebContextMenuData.h" |
| 27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDeviceOrientationC
lientMock.h" | 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDeviceOrientationC
lientMock.h" |
| 28 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCString.h
" | 27 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCString.h
" |
| 29 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebData.h" | 28 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebData.h" |
| 30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h" | 29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h" |
| 31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 57 #include "ui/gfx/point.h" | 56 #include "ui/gfx/point.h" |
| 58 #include "webkit/appcache/web_application_cache_host_impl.h" | 57 #include "webkit/appcache/web_application_cache_host_impl.h" |
| 59 #include "webkit/glue/glue_serialize.h" | 58 #include "webkit/glue/glue_serialize.h" |
| 60 #include "webkit/glue/webdropdata.h" | 59 #include "webkit/glue/webdropdata.h" |
| 61 #include "webkit/glue/webkit_glue.h" | 60 #include "webkit/glue/webkit_glue.h" |
| 62 #include "webkit/glue/webpreferences.h" | 61 #include "webkit/glue/webpreferences.h" |
| 63 #include "webkit/glue/weburlrequest_extradata_impl.h" | 62 #include "webkit/glue/weburlrequest_extradata_impl.h" |
| 64 #include "webkit/glue/window_open_disposition.h" | 63 #include "webkit/glue/window_open_disposition.h" |
| 65 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" | 64 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" |
| 66 #include "webkit/media/webmediaplayer_impl.h" | 65 #include "webkit/media/webmediaplayer_impl.h" |
| 66 #include "webkit/media/webmediaplayer_params.h" |
| 67 #include "webkit/plugins/npapi/webplugin_impl.h" | 67 #include "webkit/plugins/npapi/webplugin_impl.h" |
| 68 #include "webkit/plugins/npapi/plugin_list.h" | 68 #include "webkit/plugins/npapi/plugin_list.h" |
| 69 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" | 69 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" |
| 70 #include "webkit/tools/test_shell/mock_spellcheck.h" | 70 #include "webkit/tools/test_shell/mock_spellcheck.h" |
| 71 #include "webkit/tools/test_shell/notification_presenter.h" | 71 #include "webkit/tools/test_shell/notification_presenter.h" |
| 72 #include "webkit/tools/test_shell/simple_appcache_system.h" | 72 #include "webkit/tools/test_shell/simple_appcache_system.h" |
| 73 #include "webkit/tools/test_shell/simple_dom_storage_system.h" | 73 #include "webkit/tools/test_shell/simple_dom_storage_system.h" |
| 74 #include "webkit/tools/test_shell/simple_file_system.h" | 74 #include "webkit/tools/test_shell/simple_file_system.h" |
| 75 #include "webkit/tools/test_shell/test_navigation_controller.h" | 75 #include "webkit/tools/test_shell/test_navigation_controller.h" |
| 76 #include "webkit/tools/test_shell/test_shell.h" | 76 #include "webkit/tools/test_shell/test_shell.h" |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 } | 524 } |
| 525 } | 525 } |
| 526 #endif // defined (OS_MACOSX) | 526 #endif // defined (OS_MACOSX) |
| 527 | 527 |
| 528 return new webkit::npapi::WebPluginImpl( | 528 return new webkit::npapi::WebPluginImpl( |
| 529 frame, params, plugins.front().path, AsWeakPtr()); | 529 frame, params, plugins.front().path, AsWeakPtr()); |
| 530 } | 530 } |
| 531 | 531 |
| 532 WebMediaPlayer* TestWebViewDelegate::createMediaPlayer( | 532 WebMediaPlayer* TestWebViewDelegate::createMediaPlayer( |
| 533 WebFrame* frame, const WebKit::WebURL& url, WebMediaPlayerClient* client) { | 533 WebFrame* frame, const WebKit::WebURL& url, WebMediaPlayerClient* client) { |
| 534 scoped_ptr<media::MessageLoopFactory> message_loop_factory( | 534 webkit_media::WebMediaPlayerParams params( |
| 535 new media::MessageLoopFactory()); | 535 NULL, NULL, NULL, NULL, new media::MediaLog()); |
| 536 | |
| 537 scoped_ptr<media::FilterCollection> collection( | |
| 538 new media::FilterCollection()); | |
| 539 | |
| 540 return new webkit_media::WebMediaPlayerImpl( | 536 return new webkit_media::WebMediaPlayerImpl( |
| 541 frame, | 537 frame, |
| 542 client, | 538 client, |
| 543 base::WeakPtr<webkit_media::WebMediaPlayerDelegate>(), | 539 base::WeakPtr<webkit_media::WebMediaPlayerDelegate>(), |
| 544 collection.release(), | 540 params); |
| 545 NULL, | |
| 546 NULL, | |
| 547 message_loop_factory.release(), | |
| 548 NULL, | |
| 549 new media::MediaLog()); | |
| 550 } | 541 } |
| 551 | 542 |
| 552 WebApplicationCacheHost* TestWebViewDelegate::createApplicationCacheHost( | 543 WebApplicationCacheHost* TestWebViewDelegate::createApplicationCacheHost( |
| 553 WebFrame* frame, WebApplicationCacheHostClient* client) { | 544 WebFrame* frame, WebApplicationCacheHostClient* client) { |
| 554 return SimpleAppCacheSystem::CreateApplicationCacheHost(client); | 545 return SimpleAppCacheSystem::CreateApplicationCacheHost(client); |
| 555 } | 546 } |
| 556 | 547 |
| 557 bool TestWebViewDelegate::allowPlugins(WebFrame* frame, | 548 bool TestWebViewDelegate::allowPlugins(WebFrame* frame, |
| 558 bool enabled_per_settings) { | 549 bool enabled_per_settings) { |
| 559 return enabled_per_settings && shell_->allow_plugins(); | 550 return enabled_per_settings && shell_->allow_plugins(); |
| (...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1034 } | 1025 } |
| 1035 | 1026 |
| 1036 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { | 1027 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { |
| 1037 fake_rect_ = rect; | 1028 fake_rect_ = rect; |
| 1038 using_fake_rect_ = true; | 1029 using_fake_rect_ = true; |
| 1039 } | 1030 } |
| 1040 | 1031 |
| 1041 WebRect TestWebViewDelegate::fake_window_rect() { | 1032 WebRect TestWebViewDelegate::fake_window_rect() { |
| 1042 return fake_rect_; | 1033 return fake_rect_; |
| 1043 } | 1034 } |
| OLD | NEW |