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