| 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 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 863 } | 863 } |
| 864 | 864 |
| 865 void TestWebViewDelegate::willSendRequest( | 865 void TestWebViewDelegate::willSendRequest( |
| 866 WebFrame* frame, unsigned identifier, WebURLRequest& request, | 866 WebFrame* frame, unsigned identifier, WebURLRequest& request, |
| 867 const WebURLResponse& redirect_response) { | 867 const WebURLResponse& redirect_response) { |
| 868 GURL url = request.url(); | 868 GURL url = request.url(); |
| 869 std::string request_url = url.possibly_invalid_spec(); | 869 std::string request_url = url.possibly_invalid_spec(); |
| 870 | 870 |
| 871 request.setExtraData( | 871 request.setExtraData( |
| 872 new webkit_glue::WebURLRequestExtraDataImpl( | 872 new webkit_glue::WebURLRequestExtraDataImpl( |
| 873 frame->document().referrerPolicy())); | 873 frame->document().referrerPolicy(), WebString())); |
| 874 | 874 |
| 875 if (!redirect_response.isNull() && block_redirects_) { | 875 if (!redirect_response.isNull() && block_redirects_) { |
| 876 printf("Returning null for this redirect\n"); | 876 printf("Returning null for this redirect\n"); |
| 877 | 877 |
| 878 // To block the request, we set its URL to an empty one. | 878 // To block the request, we set its URL to an empty one. |
| 879 request.setURL(WebURL()); | 879 request.setURL(WebURL()); |
| 880 return; | 880 return; |
| 881 } | 881 } |
| 882 | 882 |
| 883 if (request_return_null_) { | 883 if (request_return_null_) { |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1152 } | 1152 } |
| 1153 | 1153 |
| 1154 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { | 1154 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { |
| 1155 fake_rect_ = rect; | 1155 fake_rect_ = rect; |
| 1156 using_fake_rect_ = true; | 1156 using_fake_rect_ = true; |
| 1157 } | 1157 } |
| 1158 | 1158 |
| 1159 WebRect TestWebViewDelegate::fake_window_rect() { | 1159 WebRect TestWebViewDelegate::fake_window_rect() { |
| 1160 return fake_rect_; | 1160 return fake_rect_; |
| 1161 } | 1161 } |
| OLD | NEW |