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 // TestWebViewDelegate class: | 5 // TestWebViewDelegate class: |
6 // This class implements the WebViewDelegate methods for the test shell. One | 6 // This class implements the WebViewDelegate methods for the test shell. One |
7 // instance is owned by each TestShell. | 7 // instance is owned by each TestShell. |
8 | 8 |
9 #ifndef WEBKIT_TOOLS_TEST_SHELL_TEST_WEBVIEW_DELEGATE_H_ | 9 #ifndef WEBKIT_TOOLS_TEST_SHELL_TEST_WEBVIEW_DELEGATE_H_ |
10 #define WEBKIT_TOOLS_TEST_SHELL_TEST_WEBVIEW_DELEGATE_H_ | 10 #define WEBKIT_TOOLS_TEST_SHELL_TEST_WEBVIEW_DELEGATE_H_ |
11 | 11 |
| 12 #include "build/build_config.h" |
| 13 |
| 14 #if defined(OS_WIN) |
| 15 #include <windows.h> |
| 16 #endif |
| 17 |
12 #include <map> | 18 #include <map> |
13 #include <set> | 19 #include <set> |
14 #include <string> | 20 #include <string> |
15 | 21 |
| 22 #if defined(TOOLKIT_USES_GTK) |
| 23 #include <gdk/gdkcursor.h> |
| 24 #endif |
| 25 |
16 #include "base/basictypes.h" | 26 #include "base/basictypes.h" |
17 #include "base/scoped_ptr.h" | 27 #include "base/scoped_ptr.h" |
18 #include "base/weak_ptr.h" | 28 #include "base/weak_ptr.h" |
19 #include "build/build_config.h" | |
20 #include "third_party/WebKit/WebKit/chromium/public/WebContextMenuData.h" | 29 #include "third_party/WebKit/WebKit/chromium/public/WebContextMenuData.h" |
21 #include "third_party/WebKit/WebKit/chromium/public/WebFileSystem.h" | 30 #include "third_party/WebKit/WebKit/chromium/public/WebFileSystem.h" |
22 #include "third_party/WebKit/WebKit/chromium/public/WebFrameClient.h" | 31 #include "third_party/WebKit/WebKit/chromium/public/WebFrameClient.h" |
23 #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" | 32 #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" |
| 33 #if defined(OS_MACOSX) |
| 34 #include "third_party/WebKit/WebKit/chromium/public/WebPopupMenuInfo.h" |
| 35 #endif |
24 #include "third_party/WebKit/WebKit/chromium/public/WebPopupType.h" | 36 #include "third_party/WebKit/WebKit/chromium/public/WebPopupType.h" |
25 #include "third_party/WebKit/WebKit/chromium/public/WebViewClient.h" | 37 #include "third_party/WebKit/WebKit/chromium/public/WebViewClient.h" |
26 #include "webkit/glue/webcursor.h" | 38 #include "webkit/glue/webcursor.h" |
27 #include "webkit/plugins/npapi/webplugin_page_delegate.h" | 39 #include "webkit/glue/plugins/webplugin_page_delegate.h" |
28 #include "webkit/tools/test_shell/mock_spellcheck.h" | |
29 #include "webkit/tools/test_shell/test_navigation_controller.h" | |
30 | |
31 #if defined(OS_MACOSX) | |
32 #include "third_party/WebKit/WebKit/chromium/public/WebPopupMenuInfo.h" | |
33 #endif | |
34 | |
35 #if defined(OS_WIN) | 40 #if defined(OS_WIN) |
36 #include <windows.h> | |
37 | |
38 #include "webkit/tools/test_shell/drag_delegate.h" | 41 #include "webkit/tools/test_shell/drag_delegate.h" |
39 #include "webkit/tools/test_shell/drop_delegate.h" | 42 #include "webkit/tools/test_shell/drop_delegate.h" |
40 #endif | 43 #endif |
41 | 44 #include "webkit/tools/test_shell/mock_spellcheck.h" |
42 #if defined(TOOLKIT_USES_GTK) | 45 #include "webkit/tools/test_shell/test_navigation_controller.h" |
43 #include <gdk/gdkcursor.h> | |
44 #endif | |
45 | 46 |
46 struct WebPreferences; | 47 struct WebPreferences; |
47 class GURL; | 48 class GURL; |
48 class TestGeolocationService; | 49 class TestGeolocationService; |
49 class TestShell; | 50 class TestShell; |
50 class WebWidgetHost; | 51 class WebWidgetHost; |
51 | 52 |
52 namespace WebKit { | 53 namespace WebKit { |
53 class WebDeviceOrientationClient; | 54 class WebDeviceOrientationClient; |
54 class WebSpeechInputController; | 55 class WebSpeechInputController; |
55 class WebSpeechInputListener; | 56 class WebSpeechInputListener; |
56 class WebStorageNamespace; | 57 class WebStorageNamespace; |
57 struct WebWindowFeatures; | 58 struct WebWindowFeatures; |
58 } | 59 } |
59 | 60 |
60 class TestWebViewDelegate : public WebKit::WebViewClient, | 61 class TestWebViewDelegate : public WebKit::WebViewClient, |
61 public WebKit::WebFrameClient, | 62 public WebKit::WebFrameClient, |
62 public webkit::npapi::WebPluginPageDelegate, | 63 public webkit_glue::WebPluginPageDelegate, |
63 public base::SupportsWeakPtr<TestWebViewDelegate> { | 64 public base::SupportsWeakPtr<TestWebViewDelegate> { |
64 public: | 65 public: |
65 struct CapturedContextMenuEvent { | 66 struct CapturedContextMenuEvent { |
66 CapturedContextMenuEvent(int in_node_type, | 67 CapturedContextMenuEvent(int in_node_type, |
67 int in_x, | 68 int in_x, |
68 int in_y) | 69 int in_y) |
69 : node_type(in_node_type), | 70 : node_type(in_node_type), |
70 x(in_x), | 71 x(in_x), |
71 y(in_y) { | 72 y(in_y) { |
72 } | 73 } |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 virtual void didRunInsecureContent( | 232 virtual void didRunInsecureContent( |
232 WebKit::WebFrame* frame, const WebKit::WebSecurityOrigin& origin); | 233 WebKit::WebFrame* frame, const WebKit::WebSecurityOrigin& origin); |
233 virtual bool allowScript(WebKit::WebFrame* frame, bool enabled_per_settings); | 234 virtual bool allowScript(WebKit::WebFrame* frame, bool enabled_per_settings); |
234 virtual void openFileSystem( | 235 virtual void openFileSystem( |
235 WebKit::WebFrame* frame, | 236 WebKit::WebFrame* frame, |
236 WebKit::WebFileSystem::Type type, | 237 WebKit::WebFileSystem::Type type, |
237 long long size, | 238 long long size, |
238 bool create, | 239 bool create, |
239 WebKit::WebFileSystemCallbacks* callbacks); | 240 WebKit::WebFileSystemCallbacks* callbacks); |
240 | 241 |
241 // webkit::npapi::WebPluginPageDelegate | 242 // webkit_glue::WebPluginPageDelegate |
242 virtual webkit::npapi::WebPluginDelegate* CreatePluginDelegate( | 243 virtual webkit_glue::WebPluginDelegate* CreatePluginDelegate( |
243 const FilePath& url, | 244 const FilePath& url, |
244 const std::string& mime_type); | 245 const std::string& mime_type); |
245 virtual void CreatedPluginWindow( | 246 virtual void CreatedPluginWindow( |
246 gfx::PluginWindowHandle handle); | 247 gfx::PluginWindowHandle handle); |
247 virtual void WillDestroyPluginWindow( | 248 virtual void WillDestroyPluginWindow( |
248 gfx::PluginWindowHandle handle); | 249 gfx::PluginWindowHandle handle); |
249 virtual void DidMovePlugin( | 250 virtual void DidMovePlugin( |
250 const webkit::npapi::WebPluginGeometry& move); | 251 const webkit_glue::WebPluginGeometry& move); |
251 virtual void DidStartLoadingForPlugin() {} | 252 virtual void DidStartLoadingForPlugin() {} |
252 virtual void DidStopLoadingForPlugin() {} | 253 virtual void DidStopLoadingForPlugin() {} |
253 virtual void ShowModalHTMLDialogForPlugin( | 254 virtual void ShowModalHTMLDialogForPlugin( |
254 const GURL& url, | 255 const GURL& url, |
255 const gfx::Size& size, | 256 const gfx::Size& size, |
256 const std::string& json_arguments, | 257 const std::string& json_arguments, |
257 std::string* json_retval) {} | 258 std::string* json_retval) {} |
258 virtual WebKit::WebCookieJar* GetCookieJar(); | 259 virtual WebKit::WebCookieJar* GetCookieJar(); |
259 | 260 |
260 TestWebViewDelegate(TestShell* shell); | 261 TestWebViewDelegate(TestShell* shell); |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 MockSpellCheck mock_spellcheck_; | 468 MockSpellCheck mock_spellcheck_; |
468 | 469 |
469 #if !defined(ENABLE_CLIENT_BASED_GEOLOCATION) | 470 #if !defined(ENABLE_CLIENT_BASED_GEOLOCATION) |
470 scoped_ptr<TestGeolocationService> test_geolocation_service_; | 471 scoped_ptr<TestGeolocationService> test_geolocation_service_; |
471 #endif | 472 #endif |
472 | 473 |
473 DISALLOW_COPY_AND_ASSIGN(TestWebViewDelegate); | 474 DISALLOW_COPY_AND_ASSIGN(TestWebViewDelegate); |
474 }; | 475 }; |
475 | 476 |
476 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_WEBVIEW_DELEGATE_H_ | 477 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_WEBVIEW_DELEGATE_H_ |
OLD | NEW |