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