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

Unified Diff: extensions/browser/extension_navigation_throttle.cc

Issue 2881733006: ExtensionNavigationThrottle: Enforce the same rules on redirect as we (Closed)
Patch Set: Fix compile. Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/browser/extension_navigation_throttle.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/extension_navigation_throttle.cc
diff --git a/extensions/browser/extension_navigation_throttle.cc b/extensions/browser/extension_navigation_throttle.cc
index 37ead6b0182a5c7869ac4802805a5671b8542f09..9412f16d6ef98f342a477e7b81046a69956b38f6 100644
--- a/extensions/browser/extension_navigation_throttle.cc
+++ b/extensions/browser/extension_navigation_throttle.cc
@@ -32,7 +32,7 @@ ExtensionNavigationThrottle::ExtensionNavigationThrottle(
ExtensionNavigationThrottle::~ExtensionNavigationThrottle() {}
content::NavigationThrottle::ThrottleCheckResult
-ExtensionNavigationThrottle::WillStartRequest() {
+ExtensionNavigationThrottle::WillStartOrRedirectRequest() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
content::WebContents* web_contents = navigation_handle()->GetWebContents();
ExtensionRegistry* registry =
@@ -153,6 +153,22 @@ ExtensionNavigationThrottle::WillStartRequest() {
return content::NavigationThrottle::PROCEED;
}
+content::NavigationThrottle::ThrottleCheckResult
+ExtensionNavigationThrottle::WillStartRequest() {
+ return WillStartOrRedirectRequest();
+}
+
+content::NavigationThrottle::ThrottleCheckResult
+ExtensionNavigationThrottle::WillRedirectRequest() {
+ ThrottleCheckResult result = WillStartOrRedirectRequest();
+ if (result == BLOCK_REQUEST) {
+ // TODO(nick): https://crbug.com/695421 means that BLOCK_REQUEST does not
+ // work here. Once PlzNavigate is enabled 100%, just return |result|.
+ return CANCEL;
+ }
+ return result;
+}
+
const char* ExtensionNavigationThrottle::GetNameForLogging() {
return "ExtensionNavigationThrottle";
}
« no previous file with comments | « extensions/browser/extension_navigation_throttle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698