| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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" | 12 #include "build/build_config.h" |
| 13 | 13 |
| 14 #if defined(OS_WIN) | 14 #if defined(OS_WIN) |
| 15 #include <windows.h> | 15 #include <windows.h> |
| 16 #endif | 16 #endif |
| 17 #include <map> | 17 #include <map> |
| 18 | 18 |
| 19 #if defined(OS_LINUX) | 19 #if defined(OS_LINUX) |
| 20 #include <gdk/gdkcursor.h> | 20 #include <gdk/gdkcursor.h> |
| 21 #endif | 21 #endif |
| 22 | 22 |
| 23 #include "base/basictypes.h" | 23 #include "base/basictypes.h" |
| 24 #include "base/ref_counted.h" | 24 #include "base/ref_counted.h" |
| 25 #include "base/scoped_ptr.h" | 25 #include "base/scoped_ptr.h" |
| 26 #if defined(OS_MACOSX) |
| 27 #include "webkit/api/public/WebRect.h" |
| 28 #include "webkit/api/public/WebPopupMenuInfo.h" |
| 29 #endif |
| 26 #include "webkit/glue/webcursor.h" | 30 #include "webkit/glue/webcursor.h" |
| 27 #include "webkit/glue/webview_delegate.h" | 31 #include "webkit/glue/webview_delegate.h" |
| 28 #include "webkit/glue/webwidget_delegate.h" | 32 #include "webkit/glue/webwidget_delegate.h" |
| 29 #if defined(OS_WIN) | 33 #if defined(OS_WIN) |
| 30 #include "webkit/tools/test_shell/drag_delegate.h" | 34 #include "webkit/tools/test_shell/drag_delegate.h" |
| 31 #include "webkit/tools/test_shell/drop_delegate.h" | 35 #include "webkit/tools/test_shell/drop_delegate.h" |
| 32 #endif | 36 #endif |
| 33 #include "webkit/tools/test_shell/test_navigation_controller.h" | 37 #include "webkit/tools/test_shell/test_navigation_controller.h" |
| 34 | 38 |
| 35 struct WebPreferences; | 39 struct WebPreferences; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 #endif | 79 #endif |
| 76 { | 80 { |
| 77 } | 81 } |
| 78 virtual ~TestWebViewDelegate(); | 82 virtual ~TestWebViewDelegate(); |
| 79 | 83 |
| 80 // WebViewDelegate | 84 // WebViewDelegate |
| 81 virtual WebView* CreateWebView(WebView* webview, | 85 virtual WebView* CreateWebView(WebView* webview, |
| 82 bool user_gesture, | 86 bool user_gesture, |
| 83 const GURL& creator_url); | 87 const GURL& creator_url); |
| 84 virtual WebWidget* CreatePopupWidget(WebView* webview, bool activatable); | 88 virtual WebWidget* CreatePopupWidget(WebView* webview, bool activatable); |
| 89 #if defined(OS_MACOSX) |
| 90 virtual WebWidget* CreatePopupWidgetWithInfo( |
| 91 WebView* webview, |
| 92 const WebKit::WebPopupMenuInfo& info); |
| 93 #endif |
| 85 virtual WebPluginDelegate* CreatePluginDelegate( | 94 virtual WebPluginDelegate* CreatePluginDelegate( |
| 86 WebView* webview, | 95 WebView* webview, |
| 87 const GURL& url, | 96 const GURL& url, |
| 88 const std::string& mime_type, | 97 const std::string& mime_type, |
| 89 const std::string& clsid, | 98 const std::string& clsid, |
| 90 std::string* actual_mime_type); | 99 std::string* actual_mime_type); |
| 91 #if defined(OS_LINUX) | 100 #if defined(OS_LINUX) |
| 92 virtual gfx::PluginWindowHandle CreatePluginContainer(); | 101 virtual gfx::PluginWindowHandle CreatePluginContainer(); |
| 93 virtual void WillDestroyPluginWindow(gfx::PluginWindowHandle handle); | 102 virtual void WillDestroyPluginWindow(gfx::PluginWindowHandle handle); |
| 94 #endif | 103 #endif |
| 95 virtual WebKit::WebMediaPlayer* CreateWebMediaPlayer( | 104 virtual WebKit::WebMediaPlayer* CreateWebMediaPlayer( |
| 96 WebKit::WebMediaPlayerClient* client); | 105 WebKit::WebMediaPlayerClient* client); |
| 97 virtual WebKit::WebWorker* CreateWebWorker(WebKit::WebWorkerClient* client); | 106 virtual WebKit::WebWorker* CreateWebWorker(WebKit::WebWorkerClient* client); |
| 98 virtual void OpenURL(WebView* webview, | 107 virtual void OpenURL(WebView* webview, |
| 99 const GURL& url, | 108 const GURL& url, |
| 100 const GURL& referrer, | 109 const GURL& referrer, |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 virtual void NavigateBackForwardSoon(int offset); | 229 virtual void NavigateBackForwardSoon(int offset); |
| 221 virtual int GetHistoryBackListCount(); | 230 virtual int GetHistoryBackListCount(); |
| 222 virtual int GetHistoryForwardListCount(); | 231 virtual int GetHistoryForwardListCount(); |
| 223 | 232 |
| 224 // WebWidgetDelegate | 233 // WebWidgetDelegate |
| 225 virtual void DidInvalidateRect(WebWidget* webwidget, | 234 virtual void DidInvalidateRect(WebWidget* webwidget, |
| 226 const WebKit::WebRect& rect); | 235 const WebKit::WebRect& rect); |
| 227 virtual void DidScrollRect(WebWidget* webwidget, int dx, int dy, | 236 virtual void DidScrollRect(WebWidget* webwidget, int dx, int dy, |
| 228 const WebKit::WebRect& clip_rect); | 237 const WebKit::WebRect& clip_rect); |
| 229 virtual void Show(WebWidget* webview, WindowOpenDisposition disposition); | 238 virtual void Show(WebWidget* webview, WindowOpenDisposition disposition); |
| 230 virtual void ShowAsPopupWithItems(WebWidget* webwidget, | |
| 231 const WebKit::WebRect& bounds, | |
| 232 int item_height, | |
| 233 int selected_index, | |
| 234 const std::vector<WebMenuItem>& items); | |
| 235 virtual void CloseWidgetSoon(WebWidget* webwidget); | 239 virtual void CloseWidgetSoon(WebWidget* webwidget); |
| 236 virtual void Focus(WebWidget* webwidget); | 240 virtual void Focus(WebWidget* webwidget); |
| 237 virtual void Blur(WebWidget* webwidget); | 241 virtual void Blur(WebWidget* webwidget); |
| 238 virtual void SetCursor(WebWidget* webwidget, | 242 virtual void SetCursor(WebWidget* webwidget, |
| 239 const WebKit::WebCursorInfo& cursor); | 243 const WebKit::WebCursorInfo& cursor); |
| 240 virtual void GetWindowRect(WebWidget* webwidget, WebKit::WebRect* rect); | 244 virtual void GetWindowRect(WebWidget* webwidget, WebKit::WebRect* rect); |
| 241 virtual void SetWindowRect(WebWidget* webwidget, | 245 virtual void SetWindowRect(WebWidget* webwidget, |
| 242 const WebKit::WebRect& rect); | 246 const WebKit::WebRect& rect); |
| 243 virtual void GetRootWindowRect(WebWidget *, WebKit::WebRect *); | 247 virtual void GetRootWindowRect(WebWidget *, WebKit::WebRect *); |
| 244 virtual void GetRootWindowResizerRect(WebWidget* webwidget, | 248 virtual void GetRootWindowResizerRect(WebWidget* webwidget, |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 typedef std::map<uint32, std::string> ResourceMap; | 344 typedef std::map<uint32, std::string> ResourceMap; |
| 341 ResourceMap resource_identifier_map_; | 345 ResourceMap resource_identifier_map_; |
| 342 std::string GetResourceDescription(uint32 identifier); | 346 std::string GetResourceDescription(uint32 identifier); |
| 343 | 347 |
| 344 // true if we want to enable smart insert/delete. | 348 // true if we want to enable smart insert/delete. |
| 345 bool smart_insert_delete_enabled_; | 349 bool smart_insert_delete_enabled_; |
| 346 | 350 |
| 347 // true if we want to enable selection of trailing whitespaces | 351 // true if we want to enable selection of trailing whitespaces |
| 348 bool select_trailing_whitespace_enabled_; | 352 bool select_trailing_whitespace_enabled_; |
| 349 | 353 |
| 354 CapturedContextMenuEvents captured_context_menu_events_; |
| 355 |
| 350 WebCursor current_cursor_; | 356 WebCursor current_cursor_; |
| 357 |
| 351 #if defined(OS_WIN) | 358 #if defined(OS_WIN) |
| 352 // Classes needed by drag and drop. | 359 // Classes needed by drag and drop. |
| 353 scoped_refptr<TestDragDelegate> drag_delegate_; | 360 scoped_refptr<TestDragDelegate> drag_delegate_; |
| 354 scoped_refptr<TestDropDelegate> drop_delegate_; | 361 scoped_refptr<TestDropDelegate> drop_delegate_; |
| 355 #endif | 362 #endif |
| 356 | 363 |
| 357 #if defined(OS_LINUX) | 364 #if defined(OS_LINUX) |
| 358 // The type of cursor the window is currently using. | 365 // The type of cursor the window is currently using. |
| 359 // Used for judging whether a new SetCursor call is actually changing the | 366 // Used for judging whether a new SetCursor call is actually changing the |
| 360 // cursor. | 367 // cursor. |
| 361 GdkCursorType cursor_type_; | 368 GdkCursorType cursor_type_; |
| 362 #endif | 369 #endif |
| 363 | 370 |
| 364 CapturedContextMenuEvents captured_context_menu_events_; | 371 #if defined(OS_MACOSX) |
| 372 scoped_ptr<WebKit::WebPopupMenuInfo> popup_menu_info_; |
| 373 WebKit::WebRect popup_bounds_; |
| 374 #endif |
| 365 | 375 |
| 366 DISALLOW_COPY_AND_ASSIGN(TestWebViewDelegate); | 376 DISALLOW_COPY_AND_ASSIGN(TestWebViewDelegate); |
| 367 }; | 377 }; |
| 368 | 378 |
| 369 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_WEBVIEW_DELEGATE_H_ | 379 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_WEBVIEW_DELEGATE_H_ |
| OLD | NEW |