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 // 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 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
747 } | 747 } |
748 | 748 |
749 void TestWebViewDelegate::willSendRequest( | 749 void TestWebViewDelegate::willSendRequest( |
750 WebFrame* frame, unsigned identifier, WebURLRequest& request, | 750 WebFrame* frame, unsigned identifier, WebURLRequest& request, |
751 const WebURLResponse& redirect_response) { | 751 const WebURLResponse& redirect_response) { |
752 GURL url = request.url(); | 752 GURL url = request.url(); |
753 std::string request_url = url.possibly_invalid_spec(); | 753 std::string request_url = url.possibly_invalid_spec(); |
754 | 754 |
755 request.setExtraData( | 755 request.setExtraData( |
756 new webkit_glue::WebURLRequestExtraDataImpl( | 756 new webkit_glue::WebURLRequestExtraDataImpl( |
757 frame->document().referrerPolicy(), WebString())); | 757 frame->document().referrerPolicy(), WebString(), WebString())); |
758 | 758 |
759 if (!redirect_response.isNull() && block_redirects_) { | 759 if (!redirect_response.isNull() && block_redirects_) { |
760 printf("Returning null for this redirect\n"); | 760 printf("Returning null for this redirect\n"); |
761 | 761 |
762 // To block the request, we set its URL to an empty one. | 762 // To block the request, we set its URL to an empty one. |
763 request.setURL(WebURL()); | 763 request.setURL(WebURL()); |
764 return; | 764 return; |
765 } | 765 } |
766 | 766 |
767 if (request_return_null_) { | 767 if (request_return_null_) { |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1034 } | 1034 } |
1035 | 1035 |
1036 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { | 1036 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { |
1037 fake_rect_ = rect; | 1037 fake_rect_ = rect; |
1038 using_fake_rect_ = true; | 1038 using_fake_rect_ = true; |
1039 } | 1039 } |
1040 | 1040 |
1041 WebRect TestWebViewDelegate::fake_window_rect() { | 1041 WebRect TestWebViewDelegate::fake_window_rect() { |
1042 return fake_rect_; | 1042 return fake_rect_; |
1043 } | 1043 } |
OLD | NEW |