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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 return "NavigationResourceThrottle"; | 228 return "NavigationResourceThrottle"; |
229 } | 229 } |
230 | 230 |
231 void NavigationResourceThrottle::OnUIChecksPerformed( | 231 void NavigationResourceThrottle::OnUIChecksPerformed( |
232 NavigationThrottle::ThrottleCheckResult result) { | 232 NavigationThrottle::ThrottleCheckResult result) { |
233 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 233 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
234 if (result == NavigationThrottle::CANCEL_AND_IGNORE) { | 234 if (result == NavigationThrottle::CANCEL_AND_IGNORE) { |
235 controller()->CancelAndIgnore(); | 235 controller()->CancelAndIgnore(); |
236 } else if (result == NavigationThrottle::CANCEL) { | 236 } else if (result == NavigationThrottle::CANCEL) { |
237 controller()->Cancel(); | 237 controller()->Cancel(); |
| 238 } else if (result == NavigationThrottle::BLOCK_RESPONSE) { |
| 239 // TODO(mkwst): Replace this with something more specific, as the error |
| 240 // page for this code is meant for use with extensions. |
| 241 controller()->CancelWithError(net::ERR_BLOCKED_BY_CLIENT); |
238 } else { | 242 } else { |
239 controller()->Resume(); | 243 controller()->Resume(); |
240 } | 244 } |
241 } | 245 } |
242 | 246 |
243 } // namespace content | 247 } // namespace content |
OLD | NEW |