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 15 matching lines...) Expand all Loading... |
26 #include "third_party/WebKit/WebKit/chromium/public/WebDeviceOrientationClientMo
ck.h" | 26 #include "third_party/WebKit/WebKit/chromium/public/WebDeviceOrientationClientMo
ck.h" |
27 #include "third_party/WebKit/WebKit/chromium/public/WebCString.h" | 27 #include "third_party/WebKit/WebKit/chromium/public/WebCString.h" |
28 #include "third_party/WebKit/WebKit/chromium/public/WebData.h" | 28 #include "third_party/WebKit/WebKit/chromium/public/WebData.h" |
29 #include "third_party/WebKit/WebKit/chromium/public/WebDataSource.h" | 29 #include "third_party/WebKit/WebKit/chromium/public/WebDataSource.h" |
30 #include "third_party/WebKit/WebKit/chromium/public/WebDragData.h" | 30 #include "third_party/WebKit/WebKit/chromium/public/WebDragData.h" |
31 #include "third_party/WebKit/WebKit/chromium/public/WebHistoryItem.h" | 31 #include "third_party/WebKit/WebKit/chromium/public/WebHistoryItem.h" |
32 #include "third_party/WebKit/WebKit/chromium/public/WebImage.h" | 32 #include "third_party/WebKit/WebKit/chromium/public/WebImage.h" |
33 #include "third_party/WebKit/WebKit/chromium/public/WebFileError.h" | 33 #include "third_party/WebKit/WebKit/chromium/public/WebFileError.h" |
34 #include "third_party/WebKit/WebKit/chromium/public/WebFileSystemCallbacks.h" | 34 #include "third_party/WebKit/WebKit/chromium/public/WebFileSystemCallbacks.h" |
35 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" | 35 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" |
| 36 #if defined(ENABLE_CLIENT_BASED_GEOLOCATION) |
| 37 #include "third_party/WebKit/WebKit/chromium/public/WebGeolocationClientMock.h" |
| 38 #endif |
36 #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" | 39 #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" |
37 #include "third_party/WebKit/WebKit/chromium/public/WebKitClient.h" | 40 #include "third_party/WebKit/WebKit/chromium/public/WebKitClient.h" |
38 #include "third_party/WebKit/WebKit/chromium/public/WebNode.h" | 41 #include "third_party/WebKit/WebKit/chromium/public/WebNode.h" |
39 #include "third_party/WebKit/WebKit/chromium/public/WebNotificationPresenter.h" | 42 #include "third_party/WebKit/WebKit/chromium/public/WebNotificationPresenter.h" |
40 #include "third_party/WebKit/WebKit/chromium/public/WebPluginParams.h" | 43 #include "third_party/WebKit/WebKit/chromium/public/WebPluginParams.h" |
41 #include "third_party/WebKit/WebKit/chromium/public/WebPoint.h" | 44 #include "third_party/WebKit/WebKit/chromium/public/WebPoint.h" |
42 #include "third_party/WebKit/WebKit/chromium/public/WebPopupMenu.h" | 45 #include "third_party/WebKit/WebKit/chromium/public/WebPopupMenu.h" |
43 #include "third_party/WebKit/WebKit/chromium/public/WebRange.h" | 46 #include "third_party/WebKit/WebKit/chromium/public/WebRange.h" |
44 #include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h" | 47 #include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h" |
45 #include "third_party/WebKit/WebKit/chromium/public/WebSpeechInputController.h" | 48 #include "third_party/WebKit/WebKit/chromium/public/WebSpeechInputController.h" |
46 #include "third_party/WebKit/WebKit/chromium/public/WebSpeechInputControllerMock
.h" | 49 #include "third_party/WebKit/WebKit/chromium/public/WebSpeechInputControllerMock
.h" |
47 #include "third_party/WebKit/WebKit/chromium/public/WebSpeechInputListener.h" | 50 #include "third_party/WebKit/WebKit/chromium/public/WebSpeechInputListener.h" |
48 #include "third_party/WebKit/WebKit/chromium/public/WebStorageNamespace.h" | 51 #include "third_party/WebKit/WebKit/chromium/public/WebStorageNamespace.h" |
49 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" | 52 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" |
50 #include "third_party/WebKit/WebKit/chromium/public/WebURL.h" | 53 #include "third_party/WebKit/WebKit/chromium/public/WebURL.h" |
51 #include "third_party/WebKit/WebKit/chromium/public/WebURLError.h" | 54 #include "third_party/WebKit/WebKit/chromium/public/WebURLError.h" |
52 #include "third_party/WebKit/WebKit/chromium/public/WebURLRequest.h" | 55 #include "third_party/WebKit/WebKit/chromium/public/WebURLRequest.h" |
53 #include "third_party/WebKit/WebKit/chromium/public/WebURLResponse.h" | 56 #include "third_party/WebKit/WebKit/chromium/public/WebURLResponse.h" |
54 #include "third_party/WebKit/WebKit/chromium/public/WebView.h" | 57 #include "third_party/WebKit/WebKit/chromium/public/WebView.h" |
55 #include "third_party/WebKit/WebKit/chromium/public/WebWindowFeatures.h" | 58 #include "third_party/WebKit/WebKit/chromium/public/WebWindowFeatures.h" |
56 #include "webkit/appcache/web_application_cache_host_impl.h" | 59 #include "webkit/appcache/web_application_cache_host_impl.h" |
57 #include "webkit/glue/glue_serialize.h" | 60 #include "webkit/glue/glue_serialize.h" |
58 #include "webkit/glue/media/video_renderer_impl.h" | 61 #include "webkit/glue/media/video_renderer_impl.h" |
| 62 #include "webkit/glue/plugins/webplugin_impl.h" |
| 63 #include "webkit/glue/plugins/plugin_list.h" |
| 64 #include "webkit/glue/plugins/webplugin_delegate_impl.h" |
59 #include "webkit/glue/webdropdata.h" | 65 #include "webkit/glue/webdropdata.h" |
60 #include "webkit/glue/webkit_glue.h" | 66 #include "webkit/glue/webkit_glue.h" |
61 #include "webkit/glue/webmediaplayer_impl.h" | 67 #include "webkit/glue/webmediaplayer_impl.h" |
62 #include "webkit/glue/webpreferences.h" | 68 #include "webkit/glue/webpreferences.h" |
63 #include "webkit/glue/window_open_disposition.h" | 69 #include "webkit/glue/window_open_disposition.h" |
64 #include "webkit/plugins/npapi/webplugin_impl.h" | |
65 #include "webkit/plugins/npapi/plugin_list.h" | |
66 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" | |
67 #include "webkit/tools/test_shell/accessibility_controller.h" | 70 #include "webkit/tools/test_shell/accessibility_controller.h" |
68 #include "webkit/tools/test_shell/mock_spellcheck.h" | 71 #include "webkit/tools/test_shell/mock_spellcheck.h" |
69 #include "webkit/tools/test_shell/notification_presenter.h" | 72 #include "webkit/tools/test_shell/notification_presenter.h" |
70 #include "webkit/tools/test_shell/simple_appcache_system.h" | 73 #include "webkit/tools/test_shell/simple_appcache_system.h" |
71 #include "webkit/tools/test_shell/simple_file_system.h" | 74 #include "webkit/tools/test_shell/simple_file_system.h" |
72 #include "webkit/tools/test_shell/test_geolocation_service.h" | 75 #include "webkit/tools/test_shell/test_geolocation_service.h" |
73 #include "webkit/tools/test_shell/test_navigation_controller.h" | 76 #include "webkit/tools/test_shell/test_navigation_controller.h" |
74 #include "webkit/tools/test_shell/test_shell.h" | 77 #include "webkit/tools/test_shell/test_shell.h" |
75 #include "webkit/tools/test_shell/test_web_worker.h" | 78 #include "webkit/tools/test_shell/test_web_worker.h" |
76 | 79 |
77 #if defined(ENABLE_CLIENT_BASED_GEOLOCATION) | |
78 #include "third_party/WebKit/WebKit/chromium/public/WebGeolocationClientMock.h" | |
79 #endif | |
80 | |
81 #if defined(OS_WIN) | 80 #if defined(OS_WIN) |
82 // TODO(port): make these files work everywhere. | 81 // TODO(port): make these files work everywhere. |
83 #include "webkit/tools/test_shell/drag_delegate.h" | 82 #include "webkit/tools/test_shell/drag_delegate.h" |
84 #include "webkit/tools/test_shell/drop_delegate.h" | 83 #include "webkit/tools/test_shell/drop_delegate.h" |
85 #endif | 84 #endif |
86 | 85 |
87 using appcache::WebApplicationCacheHostImpl; | 86 using appcache::WebApplicationCacheHostImpl; |
88 using WebKit::WebAccessibilityObject; | 87 using WebKit::WebAccessibilityObject; |
89 using WebKit::WebApplicationCacheHost; | 88 using WebKit::WebApplicationCacheHost; |
90 using WebKit::WebApplicationCacheHostClient; | 89 using WebKit::WebApplicationCacheHostClient; |
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 | 704 |
706 WebScreenInfo TestWebViewDelegate::screenInfo() { | 705 WebScreenInfo TestWebViewDelegate::screenInfo() { |
707 if (WebWidgetHost* host = GetWidgetHost()) | 706 if (WebWidgetHost* host = GetWidgetHost()) |
708 return host->GetScreenInfo(); | 707 return host->GetScreenInfo(); |
709 | 708 |
710 return WebScreenInfo(); | 709 return WebScreenInfo(); |
711 } | 710 } |
712 | 711 |
713 // WebFrameClient ------------------------------------------------------------ | 712 // WebFrameClient ------------------------------------------------------------ |
714 | 713 |
715 WebPlugin* TestWebViewDelegate::createPlugin(WebFrame* frame, | 714 WebPlugin* TestWebViewDelegate::createPlugin( |
716 const WebPluginParams& params) { | 715 WebFrame* frame, const WebPluginParams& params) { |
717 bool allow_wildcard = true; | 716 bool allow_wildcard = true; |
718 webkit::npapi::WebPluginInfo info; | 717 WebPluginInfo info; |
719 std::string actual_mime_type; | 718 std::string actual_mime_type; |
720 if (!webkit::npapi::PluginList::Singleton()->GetPluginInfo( | 719 if (!NPAPI::PluginList::Singleton()->GetPluginInfo( |
721 params.url, params.mimeType.utf8(), allow_wildcard, &info, | 720 params.url, params.mimeType.utf8(), allow_wildcard, &info, |
722 &actual_mime_type) || !info.enabled) | 721 &actual_mime_type) || !info.enabled) |
723 return NULL; | 722 return NULL; |
724 | 723 |
725 return new webkit::npapi::WebPluginImpl( | 724 return new webkit_glue::WebPluginImpl( |
726 frame, params, info.path, actual_mime_type, AsWeakPtr()); | 725 frame, params, info.path, actual_mime_type, AsWeakPtr()); |
727 } | 726 } |
728 | 727 |
729 WebWorker* TestWebViewDelegate::createWorker(WebFrame* frame, | 728 WebWorker* TestWebViewDelegate::createWorker( |
730 WebWorkerClient* client) { | 729 WebFrame* frame, WebWorkerClient* client) { |
731 return new TestWebWorker(); | 730 return new TestWebWorker(); |
732 } | 731 } |
733 | 732 |
734 WebMediaPlayer* TestWebViewDelegate::createMediaPlayer( | 733 WebMediaPlayer* TestWebViewDelegate::createMediaPlayer( |
735 WebFrame* frame, WebMediaPlayerClient* client) { | 734 WebFrame* frame, WebMediaPlayerClient* client) { |
736 scoped_ptr<media::FilterCollection> collection( | 735 scoped_ptr<media::FilterCollection> collection( |
737 new media::FilterCollection()); | 736 new media::FilterCollection()); |
738 | 737 |
739 scoped_refptr<webkit_glue::VideoRendererImpl> video_renderer( | 738 scoped_refptr<webkit_glue::VideoRendererImpl> video_renderer( |
740 new webkit_glue::VideoRendererImpl(false)); | 739 new webkit_glue::VideoRendererImpl(false)); |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1345 #endif | 1344 #endif |
1346 | 1345 |
1347 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { | 1346 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { |
1348 fake_rect_ = rect; | 1347 fake_rect_ = rect; |
1349 using_fake_rect_ = true; | 1348 using_fake_rect_ = true; |
1350 } | 1349 } |
1351 | 1350 |
1352 WebRect TestWebViewDelegate::fake_window_rect() { | 1351 WebRect TestWebViewDelegate::fake_window_rect() { |
1353 return fake_rect_; | 1352 return fake_rect_; |
1354 } | 1353 } |
OLD | NEW |