| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 const WebKit::WebString& misspelled_word); | 124 const WebKit::WebString& misspelled_word); |
| 125 virtual void runModalAlertDialog( | 125 virtual void runModalAlertDialog( |
| 126 WebKit::WebFrame* frame, const WebKit::WebString& message); | 126 WebKit::WebFrame* frame, const WebKit::WebString& message); |
| 127 virtual bool runModalConfirmDialog( | 127 virtual bool runModalConfirmDialog( |
| 128 WebKit::WebFrame* frame, const WebKit::WebString& message); | 128 WebKit::WebFrame* frame, const WebKit::WebString& message); |
| 129 virtual bool runModalPromptDialog( | 129 virtual bool runModalPromptDialog( |
| 130 WebKit::WebFrame* frame, const WebKit::WebString& message, | 130 WebKit::WebFrame* frame, const WebKit::WebString& message, |
| 131 const WebKit::WebString& default_value, WebKit::WebString* actual_value); | 131 const WebKit::WebString& default_value, WebKit::WebString* actual_value); |
| 132 virtual bool runModalBeforeUnloadDialog( | 132 virtual bool runModalBeforeUnloadDialog( |
| 133 WebKit::WebFrame* frame, const WebKit::WebString& message); | 133 WebKit::WebFrame* frame, const WebKit::WebString& message); |
| 134 virtual void showContextMenu( | |
| 135 WebKit::WebFrame* frame, const WebKit::WebContextMenuData& data); | |
| 136 virtual void setStatusText(const WebKit::WebString& text); | 134 virtual void setStatusText(const WebKit::WebString& text); |
| 137 virtual void startDragging( | 135 virtual void startDragging( |
| 138 const WebKit::WebDragData& data, WebKit::WebDragOperationsMask mask, | 136 const WebKit::WebDragData& data, WebKit::WebDragOperationsMask mask, |
| 139 const WebKit::WebImage& image, const WebKit::WebPoint& offset); | 137 const WebKit::WebImage& image, const WebKit::WebPoint& offset); |
| 140 virtual void navigateBackForwardSoon(int offset); | 138 virtual void navigateBackForwardSoon(int offset); |
| 141 virtual int historyBackListCount(); | 139 virtual int historyBackListCount(); |
| 142 virtual int historyForwardListCount(); | 140 virtual int historyForwardListCount(); |
| 143 virtual WebKit::WebNotificationPresenter* notificationPresenter(); | 141 virtual WebKit::WebNotificationPresenter* notificationPresenter(); |
| 144 virtual WebKit::WebGeolocationClient* geolocationClient(); | 142 virtual WebKit::WebGeolocationClient* geolocationClient(); |
| 145 virtual WebKit::WebDeviceOrientationClient* deviceOrientationClient(); | 143 virtual WebKit::WebDeviceOrientationClient* deviceOrientationClient(); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 void Reset(); | 256 void Reset(); |
| 259 | 257 |
| 260 void SetSmartInsertDeleteEnabled(bool enabled); | 258 void SetSmartInsertDeleteEnabled(bool enabled); |
| 261 void SetSelectTrailingWhitespaceEnabled(bool enabled); | 259 void SetSelectTrailingWhitespaceEnabled(bool enabled); |
| 262 | 260 |
| 263 // Additional accessors | 261 // Additional accessors |
| 264 WebKit::WebFrame* top_loading_frame() { return top_loading_frame_; } | 262 WebKit::WebFrame* top_loading_frame() { return top_loading_frame_; } |
| 265 #if defined(OS_WIN) | 263 #if defined(OS_WIN) |
| 266 IDropTarget* drop_delegate() { return drop_delegate_.get(); } | 264 IDropTarget* drop_delegate() { return drop_delegate_.get(); } |
| 267 #endif | 265 #endif |
| 268 const CapturedContextMenuEvents& captured_context_menu_events() const { | |
| 269 return captured_context_menu_events_; | |
| 270 } | |
| 271 void clear_captured_context_menu_events() { | |
| 272 captured_context_menu_events_.clear(); | |
| 273 } | |
| 274 | 266 |
| 275 void set_pending_extra_data(TestShellExtraData* extra_data) { | 267 void set_pending_extra_data(TestShellExtraData* extra_data) { |
| 276 pending_extra_data_.reset(extra_data); | 268 pending_extra_data_.reset(extra_data); |
| 277 } | 269 } |
| 278 | 270 |
| 279 // Methods for modifying WebPreferences | 271 // Methods for modifying WebPreferences |
| 280 void SetUserStyleSheetEnabled(bool is_enabled); | 272 void SetUserStyleSheetEnabled(bool is_enabled); |
| 281 void SetUserStyleSheetLocation(const GURL& location); | 273 void SetUserStyleSheetLocation(const GURL& location); |
| 282 void SetAuthorAndUserStylesEnabled(bool is_enabled); | 274 void SetAuthorAndUserStylesEnabled(bool is_enabled); |
| 283 | 275 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 int page_id_; | 388 int page_id_; |
| 397 int last_page_id_updated_; | 389 int last_page_id_updated_; |
| 398 | 390 |
| 399 scoped_ptr<TestShellExtraData> pending_extra_data_; | 391 scoped_ptr<TestShellExtraData> pending_extra_data_; |
| 400 | 392 |
| 401 // Maps resource identifiers to a descriptive string. | 393 // Maps resource identifiers to a descriptive string. |
| 402 typedef std::map<uint32, std::string> ResourceMap; | 394 typedef std::map<uint32, std::string> ResourceMap; |
| 403 ResourceMap resource_identifier_map_; | 395 ResourceMap resource_identifier_map_; |
| 404 std::string GetResourceDescription(uint32 identifier); | 396 std::string GetResourceDescription(uint32 identifier); |
| 405 | 397 |
| 406 CapturedContextMenuEvents captured_context_menu_events_; | |
| 407 scoped_ptr<WebKit::WebContextMenuData> last_context_menu_data_; | 398 scoped_ptr<WebKit::WebContextMenuData> last_context_menu_data_; |
| 408 | 399 |
| 409 WebCursor current_cursor_; | 400 WebCursor current_cursor_; |
| 410 | 401 |
| 411 WebKit::WebRect fake_rect_; | 402 WebKit::WebRect fake_rect_; |
| 412 bool using_fake_rect_; | 403 bool using_fake_rect_; |
| 413 | 404 |
| 414 #if defined(OS_WIN) | 405 #if defined(OS_WIN) |
| 415 // Classes needed by drag and drop. | 406 // Classes needed by drag and drop. |
| 416 scoped_refptr<TestDropDelegate> drop_delegate_; | 407 scoped_refptr<TestDropDelegate> drop_delegate_; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 447 std::string edit_command_name_; | 438 std::string edit_command_name_; |
| 448 std::string edit_command_value_; | 439 std::string edit_command_value_; |
| 449 | 440 |
| 450 // The mock spellchecker used in TestWebViewDelegate::spellCheck(). | 441 // The mock spellchecker used in TestWebViewDelegate::spellCheck(). |
| 451 MockSpellCheck mock_spellcheck_; | 442 MockSpellCheck mock_spellcheck_; |
| 452 | 443 |
| 453 DISALLOW_COPY_AND_ASSIGN(TestWebViewDelegate); | 444 DISALLOW_COPY_AND_ASSIGN(TestWebViewDelegate); |
| 454 }; | 445 }; |
| 455 | 446 |
| 456 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_WEBVIEW_DELEGATE_H_ | 447 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_WEBVIEW_DELEGATE_H_ |
| OLD | NEW |