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

Side by Side Diff: components/navigation_interception/intercept_navigation_throttle.cc

Issue 2745033002: Fix LoadDataWithBaseUrlTest#testloadDataWithBaseUrlCallsOnPageStarted with PlzNavigate. (Closed)
Patch Set: fix unittest Created 3 years, 9 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "components/navigation_interception/intercept_navigation_throttle.h" 5 #include "components/navigation_interception/intercept_navigation_throttle.h"
6 6
7 #include "components/navigation_interception/navigation_params.h" 7 #include "components/navigation_interception/navigation_params.h"
8 #include "content/public/browser/browser_thread.h" 8 #include "content/public/browser/browser_thread.h"
9 #include "content/public/browser/navigation_handle.h" 9 #include "content/public/browser/navigation_handle.h"
10 10
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 return CheckIfShouldIgnoreNavigation(true); 62 return CheckIfShouldIgnoreNavigation(true);
63 } 63 }
64 64
65 content::NavigationThrottle::ThrottleCheckResult 65 content::NavigationThrottle::ThrottleCheckResult
66 InterceptNavigationThrottle::CheckIfShouldIgnoreNavigation(bool is_redirect) { 66 InterceptNavigationThrottle::CheckIfShouldIgnoreNavigation(bool is_redirect) {
67 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 67 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
68 NavigationParams navigation_params( 68 NavigationParams navigation_params(
69 navigation_handle()->GetURL(), navigation_handle()->GetReferrer(), 69 navigation_handle()->GetURL(), navigation_handle()->GetReferrer(),
70 navigation_handle()->HasUserGesture(), navigation_handle()->IsPost(), 70 navigation_handle()->HasUserGesture(), navigation_handle()->IsPost(),
71 navigation_handle()->GetPageTransition(), is_redirect, 71 navigation_handle()->GetPageTransition(), is_redirect,
72 navigation_handle()->IsExternalProtocol(), true); 72 navigation_handle()->IsExternalProtocol(), true,
73 navigation_handle()->GetBaseURLForDataURL());
73 74
74 if (run_callback_synchronously_) { 75 if (run_callback_synchronously_) {
75 bool should_ignore_navigation = should_ignore_callback_.Run( 76 bool should_ignore_navigation = should_ignore_callback_.Run(
76 navigation_handle()->GetWebContents(), navigation_params); 77 navigation_handle()->GetWebContents(), navigation_params);
77 return should_ignore_navigation 78 return should_ignore_navigation
78 ? content::NavigationThrottle::CANCEL_AND_IGNORE 79 ? content::NavigationThrottle::CANCEL_AND_IGNORE
79 : content::NavigationThrottle::PROCEED; 80 : content::NavigationThrottle::PROCEED;
80 } 81 }
81 82
82 // When the callback can potentially destroy the WebContents, along with the 83 // When the callback can potentially destroy the WebContents, along with the
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 CHECK(handle); 123 CHECK(handle);
123 if (should_ignore_navigation) { 124 if (should_ignore_navigation) {
124 navigation_handle()->CancelDeferredNavigation( 125 navigation_handle()->CancelDeferredNavigation(
125 content::NavigationThrottle::CANCEL_AND_IGNORE); 126 content::NavigationThrottle::CANCEL_AND_IGNORE);
126 } else { 127 } else {
127 handle->Resume(); 128 handle->Resume();
128 } 129 }
129 } 130 }
130 131
131 } // namespace navigation_interception 132 } // namespace navigation_interception
OLDNEW
« no previous file with comments | « chrome/browser/ui/android/external_protocol_dialog_android.cc ('k') | components/navigation_interception/navigation_params.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698