| 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 // 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 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 WebFrame* frame, const WebString& message) { | 571 WebFrame* frame, const WebString& message) { |
| 572 return true; // Allow window closure. | 572 return true; // Allow window closure. |
| 573 } | 573 } |
| 574 | 574 |
| 575 void TestWebViewDelegate::showContextMenu( | 575 void TestWebViewDelegate::showContextMenu( |
| 576 WebFrame* frame, const WebContextMenuData& data) { | 576 WebFrame* frame, const WebContextMenuData& data) { |
| 577 CapturedContextMenuEvent context(data.mediaType, | 577 CapturedContextMenuEvent context(data.mediaType, |
| 578 data.mousePosition.x, | 578 data.mousePosition.x, |
| 579 data.mousePosition.y); | 579 data.mousePosition.y); |
| 580 captured_context_menu_events_.push_back(context); | 580 captured_context_menu_events_.push_back(context); |
| 581 last_context_menu_data_.reset(new WebContextMenuData(data)); | |
| 582 } | 581 } |
| 583 | 582 |
| 584 void TestWebViewDelegate::ClearContextMenuData() { | |
| 585 last_context_menu_data_.reset(); | |
| 586 } | |
| 587 | |
| 588 | |
| 589 | |
| 590 | 583 |
| 591 void TestWebViewDelegate::setStatusText(const WebString& text) { | 584 void TestWebViewDelegate::setStatusText(const WebString& text) { |
| 592 if (WebKit::layoutTestMode() && | 585 if (WebKit::layoutTestMode() && |
| 593 shell_->layout_test_controller()->ShouldDumpStatusCallbacks()) { | 586 shell_->layout_test_controller()->ShouldDumpStatusCallbacks()) { |
| 594 // When running tests, write to stdout. | 587 // When running tests, write to stdout. |
| 595 printf("UI DELEGATE STATUS CALLBACK: setStatusText:%s\n", | 588 printf("UI DELEGATE STATUS CALLBACK: setStatusText:%s\n", |
| 596 text.utf8().data()); | 589 text.utf8().data()); |
| 597 } | 590 } |
| 598 } | 591 } |
| 599 | 592 |
| (...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1352 } | 1345 } |
| 1353 | 1346 |
| 1354 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { | 1347 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { |
| 1355 fake_rect_ = rect; | 1348 fake_rect_ = rect; |
| 1356 using_fake_rect_ = true; | 1349 using_fake_rect_ = true; |
| 1357 } | 1350 } |
| 1358 | 1351 |
| 1359 WebRect TestWebViewDelegate::fake_window_rect() { | 1352 WebRect TestWebViewDelegate::fake_window_rect() { |
| 1360 return fake_rect_; | 1353 return fake_rect_; |
| 1361 } | 1354 } |
| OLD | NEW |