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 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 void TestWebViewDelegate::loadURLExternally( | 550 void TestWebViewDelegate::loadURLExternally( |
551 WebFrame* frame, const WebURLRequest& request, | 551 WebFrame* frame, const WebURLRequest& request, |
552 WebNavigationPolicy policy) { | 552 WebNavigationPolicy policy) { |
553 DCHECK_NE(policy, WebKit::WebNavigationPolicyCurrentTab); | 553 DCHECK_NE(policy, WebKit::WebNavigationPolicyCurrentTab); |
554 TestShell* shell = NULL; | 554 TestShell* shell = NULL; |
555 if (TestShell::CreateNewWindow(request.url(), &shell)) | 555 if (TestShell::CreateNewWindow(request.url(), &shell)) |
556 shell->Show(policy); | 556 shell->Show(policy); |
557 } | 557 } |
558 | 558 |
559 WebNavigationPolicy TestWebViewDelegate::decidePolicyForNavigation( | 559 WebNavigationPolicy TestWebViewDelegate::decidePolicyForNavigation( |
560 WebFrame* frame, WebDataSource* dataSource, const WebURLRequest& request, | 560 WebFrame* frame, WebDataSource::ExtraData* extraData, |
561 WebNavigationType type, WebNavigationPolicy default_policy, | 561 const WebURLRequest& request, WebNavigationType type, |
562 bool is_redirect) { | 562 WebNavigationPolicy default_policy, bool is_redirect) { |
563 WebNavigationPolicy result; | 563 WebNavigationPolicy result; |
564 if (policy_delegate_enabled_) { | 564 if (policy_delegate_enabled_) { |
565 printf("Policy delegate: attempt to load %s with navigation type '%s'\n", | 565 printf("Policy delegate: attempt to load %s with navigation type '%s'\n", |
566 GetURLDescription(request.url()).c_str(), | 566 GetURLDescription(request.url()).c_str(), |
567 WebNavigationTypeToString(type)); | 567 WebNavigationTypeToString(type)); |
568 if (policy_delegate_is_permissive_) { | 568 if (policy_delegate_is_permissive_) { |
569 result = WebKit::WebNavigationPolicyCurrentTab; | 569 result = WebKit::WebNavigationPolicyCurrentTab; |
570 } else { | 570 } else { |
571 result = WebKit::WebNavigationPolicyIgnore; | 571 result = WebKit::WebNavigationPolicyIgnore; |
572 } | 572 } |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1001 } | 1001 } |
1002 | 1002 |
1003 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { | 1003 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { |
1004 fake_rect_ = rect; | 1004 fake_rect_ = rect; |
1005 using_fake_rect_ = true; | 1005 using_fake_rect_ = true; |
1006 } | 1006 } |
1007 | 1007 |
1008 WebRect TestWebViewDelegate::fake_window_rect() { | 1008 WebRect TestWebViewDelegate::fake_window_rect() { |
1009 return fake_rect_; | 1009 return fake_rect_; |
1010 } | 1010 } |
OLD | NEW |