Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: webkit/tools/test_shell/test_webview_delegate.cc

Issue 14188060: Change decidePolicyForNavigation() to takea WebDataSource::ExtraData (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/tools/test_shell/test_webview_delegate.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « webkit/tools/test_shell/test_webview_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698