| 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_ |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 #include "webkit/tools/test_shell/mock_spellcheck.h" | 43 #include "webkit/tools/test_shell/mock_spellcheck.h" |
| 44 #include "webkit/tools/test_shell/test_navigation_controller.h" | 44 #include "webkit/tools/test_shell/test_navigation_controller.h" |
| 45 | 45 |
| 46 struct WebPreferences; | 46 struct WebPreferences; |
| 47 class GURL; | 47 class GURL; |
| 48 class TestShell; | 48 class TestShell; |
| 49 class WebWidgetHost; | 49 class WebWidgetHost; |
| 50 | 50 |
| 51 namespace WebKit { | 51 namespace WebKit { |
| 52 class WebStorageNamespace; | 52 class WebStorageNamespace; |
| 53 struct WebWindowFeatures; |
| 53 } | 54 } |
| 54 | 55 |
| 55 class TestWebViewDelegate : public WebKit::WebViewClient, | 56 class TestWebViewDelegate : public WebKit::WebViewClient, |
| 56 public WebKit::WebFrameClient, | 57 public WebKit::WebFrameClient, |
| 57 public webkit_glue::WebPluginPageDelegate, | 58 public webkit_glue::WebPluginPageDelegate, |
| 58 public base::SupportsWeakPtr<TestWebViewDelegate> { | 59 public base::SupportsWeakPtr<TestWebViewDelegate> { |
| 59 public: | 60 public: |
| 60 struct CapturedContextMenuEvent { | 61 struct CapturedContextMenuEvent { |
| 61 CapturedContextMenuEvent(int in_node_type, | 62 CapturedContextMenuEvent(int in_node_type, |
| 62 int in_x, | 63 int in_x, |
| 63 int in_y) | 64 int in_y) |
| 64 : node_type(in_node_type), | 65 : node_type(in_node_type), |
| 65 x(in_x), | 66 x(in_x), |
| 66 y(in_y) { | 67 y(in_y) { |
| 67 } | 68 } |
| 68 | 69 |
| 69 int node_type; | 70 int node_type; |
| 70 int x; | 71 int x; |
| 71 int y; | 72 int y; |
| 72 }; | 73 }; |
| 73 | 74 |
| 74 typedef std::vector<CapturedContextMenuEvent> CapturedContextMenuEvents; | 75 typedef std::vector<CapturedContextMenuEvent> CapturedContextMenuEvents; |
| 75 | 76 |
| 76 // WebKit::WebViewClient | 77 // WebKit::WebViewClient |
| 78 // TODO(rafaelw): Remove this when |
| 79 // WebViewClient::createView(WebFrame,WebWindowFeatures&) lands. |
| 77 virtual WebKit::WebView* createView(WebKit::WebFrame* creator); | 80 virtual WebKit::WebView* createView(WebKit::WebFrame* creator); |
| 81 virtual WebKit::WebView* createView( |
| 82 WebKit::WebFrame* creator, |
| 83 const WebKit::WebWindowFeatures& window_features); |
| 78 virtual WebKit::WebWidget* createPopupMenu(WebKit::WebPopupType popup_type); | 84 virtual WebKit::WebWidget* createPopupMenu(WebKit::WebPopupType popup_type); |
| 79 virtual WebKit::WebWidget* createPopupMenu( | 85 virtual WebKit::WebWidget* createPopupMenu( |
| 80 const WebKit::WebPopupMenuInfo& info); | 86 const WebKit::WebPopupMenuInfo& info); |
| 81 virtual WebKit::WebStorageNamespace* createSessionStorageNamespace(); | 87 virtual WebKit::WebStorageNamespace* createSessionStorageNamespace(); |
| 82 virtual void didAddMessageToConsole( | 88 virtual void didAddMessageToConsole( |
| 83 const WebKit::WebConsoleMessage& message, | 89 const WebKit::WebConsoleMessage& message, |
| 84 const WebKit::WebString& source_name, unsigned source_line); | 90 const WebKit::WebString& source_name, unsigned source_line); |
| 85 virtual void didStartLoading(); | 91 virtual void didStartLoading(); |
| 86 virtual void didStopLoading(); | 92 virtual void didStopLoading(); |
| 87 virtual bool shouldBeginEditing(const WebKit::WebRange& range); | 93 virtual bool shouldBeginEditing(const WebKit::WebRange& range); |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 std::string edit_command_name_; | 426 std::string edit_command_name_; |
| 421 std::string edit_command_value_; | 427 std::string edit_command_value_; |
| 422 | 428 |
| 423 // The mock spellchecker used in TestWebViewDelegate::spellCheck(). | 429 // The mock spellchecker used in TestWebViewDelegate::spellCheck(). |
| 424 MockSpellCheck mock_spellcheck_; | 430 MockSpellCheck mock_spellcheck_; |
| 425 | 431 |
| 426 DISALLOW_COPY_AND_ASSIGN(TestWebViewDelegate); | 432 DISALLOW_COPY_AND_ASSIGN(TestWebViewDelegate); |
| 427 }; | 433 }; |
| 428 | 434 |
| 429 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_WEBVIEW_DELEGATE_H_ | 435 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_WEBVIEW_DELEGATE_H_ |
| OLD | NEW |