| 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 // 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 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 //const DWORD ok_effect = DROPEFFECT_COPY | DROPEFFECT_LINK | DROPEFFECT_MOV
E; | 463 //const DWORD ok_effect = DROPEFFECT_COPY | DROPEFFECT_LINK | DROPEFFECT_MOV
E; |
| 464 //DWORD effect; | 464 //DWORD effect; |
| 465 //HRESULT res = DoDragDrop(drop_data.data_object, drag_delegate_.get(), | 465 //HRESULT res = DoDragDrop(drop_data.data_object, drag_delegate_.get(), |
| 466 // ok_effect, &effect); | 466 // ok_effect, &effect); |
| 467 //DCHECK(DRAGDROP_S_DROP == res || DRAGDROP_S_CANCEL == res); | 467 //DCHECK(DRAGDROP_S_DROP == res || DRAGDROP_S_CANCEL == res); |
| 468 } | 468 } |
| 469 webview->DragSourceSystemDragEnded(); | 469 webview->DragSourceSystemDragEnded(); |
| 470 } | 470 } |
| 471 | 471 |
| 472 void TestWebViewDelegate::ShowContextMenu(WebView* webview, | 472 void TestWebViewDelegate::ShowContextMenu(WebView* webview, |
| 473 ContextNode::Type type, | 473 ContextNode node, |
| 474 int x, | 474 int x, |
| 475 int y, | 475 int y, |
| 476 const GURL& link_url, | 476 const GURL& link_url, |
| 477 const GURL& image_url, | 477 const GURL& image_url, |
| 478 const GURL& page_url, | 478 const GURL& page_url, |
| 479 const GURL& frame_url, | 479 const GURL& frame_url, |
| 480 const std::wstring& selection_text, | 480 const std::wstring& selection_text, |
| 481 const std::wstring& misspelled_word, | 481 const std::wstring& misspelled_word, |
| 482 int edit_flags, | 482 int edit_flags, |
| 483 const std::string& security_info) { | 483 const std::string& security_info) { |
| 484 CapturedContextMenuEvent context(type, x, y); | 484 CapturedContextMenuEvent context(node, x, y); |
| 485 captured_context_menu_events_.push_back(context); | 485 captured_context_menu_events_.push_back(context); |
| 486 } | 486 } |
| 487 | 487 |
| 488 // The output from these methods in layout test mode should match that | 488 // The output from these methods in layout test mode should match that |
| 489 // expected by the layout tests. See EditingDelegate.m in DumpRenderTree. | 489 // expected by the layout tests. See EditingDelegate.m in DumpRenderTree. |
| 490 bool TestWebViewDelegate::ShouldBeginEditing(WebView* webview, | 490 bool TestWebViewDelegate::ShouldBeginEditing(WebView* webview, |
| 491 std::wstring range) { | 491 std::wstring range) { |
| 492 if (shell_->ShouldDumpEditingCallbacks()) { | 492 if (shell_->ShouldDumpEditingCallbacks()) { |
| 493 std::string utf8 = WideToUTF8(range); | 493 std::string utf8 = WideToUTF8(range); |
| 494 printf("EDITING DELEGATE: shouldBeginEditingInDOMRange:%s\n", | 494 printf("EDITING DELEGATE: shouldBeginEditingInDOMRange:%s\n", |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 847 else | 847 else |
| 848 return L"main frame"; | 848 return L"main frame"; |
| 849 } else { | 849 } else { |
| 850 if (name.length()) | 850 if (name.length()) |
| 851 return L"frame \"" + name + L"\""; | 851 return L"frame \"" + name + L"\""; |
| 852 else | 852 else |
| 853 return L"frame (anonymous)"; | 853 return L"frame (anonymous)"; |
| 854 } | 854 } |
| 855 } | 855 } |
| 856 | 856 |
| OLD | NEW |