| 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 841 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   852 } |   852 } | 
|   853  |   853  | 
|   854 void TestWebViewDelegate::willSendRequest( |   854 void TestWebViewDelegate::willSendRequest( | 
|   855     WebFrame* frame, unsigned identifier, WebURLRequest& request, |   855     WebFrame* frame, unsigned identifier, WebURLRequest& request, | 
|   856     const WebURLResponse& redirect_response) { |   856     const WebURLResponse& redirect_response) { | 
|   857   GURL url = request.url(); |   857   GURL url = request.url(); | 
|   858   std::string request_url = url.possibly_invalid_spec(); |   858   std::string request_url = url.possibly_invalid_spec(); | 
|   859  |   859  | 
|   860   request.setExtraData( |   860   request.setExtraData( | 
|   861       new webkit_glue::WebURLRequestExtraDataImpl( |   861       new webkit_glue::WebURLRequestExtraDataImpl( | 
|   862           frame->document().referrerPolicy())); |   862           frame->document().referrerPolicy(), WebString())); | 
|   863  |   863  | 
|   864   if (!redirect_response.isNull() && block_redirects_) { |   864   if (!redirect_response.isNull() && block_redirects_) { | 
|   865     printf("Returning null for this redirect\n"); |   865     printf("Returning null for this redirect\n"); | 
|   866  |   866  | 
|   867     // To block the request, we set its URL to an empty one. |   867     // To block the request, we set its URL to an empty one. | 
|   868     request.setURL(WebURL()); |   868     request.setURL(WebURL()); | 
|   869     return; |   869     return; | 
|   870   } |   870   } | 
|   871  |   871  | 
|   872   if (request_return_null_) { |   872   if (request_return_null_) { | 
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1139 } |  1139 } | 
|  1140  |  1140  | 
|  1141 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { |  1141 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { | 
|  1142   fake_rect_ = rect; |  1142   fake_rect_ = rect; | 
|  1143   using_fake_rect_ = true; |  1143   using_fake_rect_ = true; | 
|  1144 } |  1144 } | 
|  1145  |  1145  | 
|  1146 WebRect TestWebViewDelegate::fake_window_rect() { |  1146 WebRect TestWebViewDelegate::fake_window_rect() { | 
|  1147   return fake_rect_; |  1147   return fake_rect_; | 
|  1148 } |  1148 } | 
| OLD | NEW |