| 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_resource_throttle.h" | 5 #include "chrome/browser/supervised_user/supervised_user_resource_throttle.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
| 10 #include "chrome/browser/supervised_user/supervised_user_interstitial.h" | 10 #include "chrome/browser/supervised_user/supervised_user_interstitial.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 return FILTERING_BEHAVIOR_BLOCK_BLACKLIST; | 64 return FILTERING_BEHAVIOR_BLOCK_BLACKLIST; |
| 65 case supervised_user_error_page::ASYNC_CHECKER: | 65 case supervised_user_error_page::ASYNC_CHECKER: |
| 66 return FILTERING_BEHAVIOR_BLOCK_SAFESITES; | 66 return FILTERING_BEHAVIOR_BLOCK_SAFESITES; |
| 67 case supervised_user_error_page::WHITELIST: | 67 case supervised_user_error_page::WHITELIST: |
| 68 NOTREACHED(); | 68 NOTREACHED(); |
| 69 break; | 69 break; |
| 70 case supervised_user_error_page::MANUAL: | 70 case supervised_user_error_page::MANUAL: |
| 71 return FILTERING_BEHAVIOR_BLOCK_MANUAL; | 71 return FILTERING_BEHAVIOR_BLOCK_MANUAL; |
| 72 case supervised_user_error_page::DEFAULT: | 72 case supervised_user_error_page::DEFAULT: |
| 73 return FILTERING_BEHAVIOR_BLOCK_DEFAULT; | 73 return FILTERING_BEHAVIOR_BLOCK_DEFAULT; |
| 74 case supervised_user_error_page::NOT_SIGNED_IN: |
| 75 // Should never happen, only used for requests from Webview |
| 76 NOTREACHED(); |
| 74 } | 77 } |
| 75 case SupervisedUserURLFilter::INVALID: | 78 case SupervisedUserURLFilter::INVALID: |
| 76 NOTREACHED(); | 79 NOTREACHED(); |
| 77 } | 80 } |
| 78 return 0; | 81 return 0; |
| 79 } | 82 } |
| 80 | 83 |
| 81 int GetHistogramValueForTransitionType(ui::PageTransition transition_type) { | 84 int GetHistogramValueForTransitionType(ui::PageTransition transition_type) { |
| 82 int value = | 85 int value = |
| 83 static_cast<int>(ui::PageTransitionStripQualifier(transition_type)); | 86 static_cast<int>(ui::PageTransitionStripQualifier(transition_type)); |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 Resume(); | 223 Resume(); |
| 221 } | 224 } |
| 222 | 225 |
| 223 void SupervisedUserResourceThrottle::OnInterstitialResult( | 226 void SupervisedUserResourceThrottle::OnInterstitialResult( |
| 224 bool continue_request) { | 227 bool continue_request) { |
| 225 if (continue_request) | 228 if (continue_request) |
| 226 Resume(); | 229 Resume(); |
| 227 else | 230 else |
| 228 Cancel(); | 231 Cancel(); |
| 229 } | 232 } |
| OLD | NEW |