OLD | NEW |
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 "content/browser/loader/navigation_resource_throttle.h" | 5 #include "content/browser/loader/navigation_resource_throttle.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "content/browser/frame_host/navigation_handle_impl.h" | 8 #include "content/browser/frame_host/navigation_handle_impl.h" |
9 #include "content/browser/frame_host/render_frame_host_impl.h" | 9 #include "content/browser/frame_host/render_frame_host_impl.h" |
10 #include "content/public/browser/resource_context.h" | 10 #include "content/public/browser/resource_context.h" |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 return "NavigationResourceThrottle"; | 247 return "NavigationResourceThrottle"; |
248 } | 248 } |
249 | 249 |
250 void NavigationResourceThrottle::OnUIChecksPerformed( | 250 void NavigationResourceThrottle::OnUIChecksPerformed( |
251 NavigationThrottle::ThrottleCheckResult result) { | 251 NavigationThrottle::ThrottleCheckResult result) { |
252 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 252 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
253 if (result == NavigationThrottle::CANCEL_AND_IGNORE) { | 253 if (result == NavigationThrottle::CANCEL_AND_IGNORE) { |
254 controller()->CancelAndIgnore(); | 254 controller()->CancelAndIgnore(); |
255 } else if (result == NavigationThrottle::CANCEL) { | 255 } else if (result == NavigationThrottle::CANCEL) { |
256 controller()->Cancel(); | 256 controller()->Cancel(); |
| 257 } else if (result == NavigationThrottle::BLOCK_RESPONSE) { |
| 258 // TODO(mkwst): Replace this with something more specific, as the error |
| 259 // page for this code is meant for use with extensions. |
| 260 controller()->CancelWithError(net::ERR_BLOCKED_BY_CLIENT); |
257 } else { | 261 } else { |
258 controller()->Resume(); | 262 controller()->Resume(); |
259 } | 263 } |
260 } | 264 } |
261 | 265 |
262 } // namespace content | 266 } // namespace content |
OLD | NEW |