| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/supervised_user/supervised_user_navigation_throttle.h" | 5 #include "chrome/browser/supervised_user/supervised_user_navigation_throttle.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 content::NavigationThrottle::ThrottleCheckResult | 193 content::NavigationThrottle::ThrottleCheckResult |
| 194 SupervisedUserNavigationThrottle::WillStartRequest() { | 194 SupervisedUserNavigationThrottle::WillStartRequest() { |
| 195 return CheckURL(); | 195 return CheckURL(); |
| 196 } | 196 } |
| 197 | 197 |
| 198 content::NavigationThrottle::ThrottleCheckResult | 198 content::NavigationThrottle::ThrottleCheckResult |
| 199 SupervisedUserNavigationThrottle::WillRedirectRequest() { | 199 SupervisedUserNavigationThrottle::WillRedirectRequest() { |
| 200 return CheckURL(); | 200 return CheckURL(); |
| 201 } | 201 } |
| 202 | 202 |
| 203 const char* SupervisedUserNavigationThrottle::GetNameForLogging() { |
| 204 return "SupervisedUserNavigationThrottle"; |
| 205 } |
| 206 |
| 203 void SupervisedUserNavigationThrottle::OnCheckDone( | 207 void SupervisedUserNavigationThrottle::OnCheckDone( |
| 204 const GURL& url, | 208 const GURL& url, |
| 205 SupervisedUserURLFilter::FilteringBehavior behavior, | 209 SupervisedUserURLFilter::FilteringBehavior behavior, |
| 206 supervised_user_error_page::FilteringBehaviorReason reason, | 210 supervised_user_error_page::FilteringBehaviorReason reason, |
| 207 bool uncertain) { | 211 bool uncertain) { |
| 208 DCHECK_EQ(SupervisedUserURLFilter::INVALID, behavior_); | 212 DCHECK_EQ(SupervisedUserURLFilter::INVALID, behavior_); |
| 209 // If we got a result synchronously, pass it back to ShowInterstitialIfNeeded. | 213 // If we got a result synchronously, pass it back to ShowInterstitialIfNeeded. |
| 210 if (!deferred_) | 214 if (!deferred_) |
| 211 behavior_ = behavior; | 215 behavior_ = behavior; |
| 212 | 216 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 240 DCHECK(deferred_); | 244 DCHECK(deferred_); |
| 241 deferred_ = false; | 245 deferred_ = false; |
| 242 navigation_handle()->Resume(); | 246 navigation_handle()->Resume(); |
| 243 } | 247 } |
| 244 | 248 |
| 245 void SupervisedUserNavigationThrottle::Cancel() { | 249 void SupervisedUserNavigationThrottle::Cancel() { |
| 246 DCHECK(deferred_); | 250 DCHECK(deferred_); |
| 247 deferred_ = false; | 251 deferred_ = false; |
| 248 navigation_handle()->CancelDeferredNavigation(CANCEL); | 252 navigation_handle()->CancelDeferredNavigation(CANCEL); |
| 249 } | 253 } |
| OLD | NEW |