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

Side by Side Diff: extensions/browser/extension_navigation_throttle.cc

Issue 2867833002: NavigationThrottle: allow customization of net::Error when blocking
Patch Set: Rebase 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 unified diff | Download patch
« no previous file with comments | « content/public/test/navigation_simulator.cc ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "extensions/browser/extension_navigation_throttle.h" 5 #include "extensions/browser/extension_navigation_throttle.h"
6 6
7 #include "components/guest_view/browser/guest_view_base.h" 7 #include "components/guest_view/browser/guest_view_base.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 #include "content/public/browser/render_frame_host.h" 10 #include "content/public/browser/render_frame_host.h"
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 } 186 }
187 187
188 content::NavigationThrottle::ThrottleCheckResult 188 content::NavigationThrottle::ThrottleCheckResult
189 ExtensionNavigationThrottle::WillStartRequest() { 189 ExtensionNavigationThrottle::WillStartRequest() {
190 return WillStartOrRedirectRequest(); 190 return WillStartOrRedirectRequest();
191 } 191 }
192 192
193 content::NavigationThrottle::ThrottleCheckResult 193 content::NavigationThrottle::ThrottleCheckResult
194 ExtensionNavigationThrottle::WillRedirectRequest() { 194 ExtensionNavigationThrottle::WillRedirectRequest() {
195 ThrottleCheckResult result = WillStartOrRedirectRequest(); 195 ThrottleCheckResult result = WillStartOrRedirectRequest();
196 if (result == BLOCK_REQUEST) { 196 if (result.action() == BLOCK_REQUEST) {
197 // BLOCK_REQUEST is on redirect does not work without PlzNavigate, so 197 // BLOCK_REQUEST is on redirect does not work without PlzNavigate, so
198 // translate these errors into CANCEL. 198 // translate these errors into CANCEL.
199 return CANCEL; 199 return CANCEL;
200 } 200 }
201 return result; 201 return result;
202 } 202 }
203 203
204 const char* ExtensionNavigationThrottle::GetNameForLogging() { 204 const char* ExtensionNavigationThrottle::GetNameForLogging() {
205 return "ExtensionNavigationThrottle"; 205 return "ExtensionNavigationThrottle";
206 } 206 }
207 207
208 } // namespace extensions 208 } // namespace extensions
OLDNEW
« no previous file with comments | « content/public/test/navigation_simulator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698