OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/subresource_filter/content/browser/content_subresource_filt
er_driver_factory.h" | 5 #include "components/subresource_filter/content/browser/content_subresource_filt
er_driver_factory.h" |
6 | 6 |
7 #include "base/feature_list.h" | 7 #include "base/feature_list.h" |
8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
9 #include "base/rand_util.h" | 9 #include "base/rand_util.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 activation_level_ = configurations->the_one_and_only().activation_level; | 207 activation_level_ = configurations->the_one_and_only().activation_level; |
208 measure_performance_ = | 208 measure_performance_ = |
209 activation_level_ != ActivationLevel::DISABLED && | 209 activation_level_ != ActivationLevel::DISABLED && |
210 ShouldMeasurePerformanceForPageLoad( | 210 ShouldMeasurePerformanceForPageLoad( |
211 configurations->the_one_and_only().performance_measurement_rate); | 211 configurations->the_one_and_only().performance_measurement_rate); |
212 ActivationState state = ActivationState(activation_level_); | 212 ActivationState state = ActivationState(activation_level_); |
213 state.measure_performance = measure_performance_; | 213 state.measure_performance = measure_performance_; |
214 throttle_manager_->NotifyPageActivationComputed(navigation_handle, state); | 214 throttle_manager_->NotifyPageActivationComputed(navigation_handle, state); |
215 } | 215 } |
216 | 216 |
| 217 void ContentSubresourceFilterDriverFactory::OnPageActivated( |
| 218 const ActivationState& activation_state) { |
| 219 client_->OnPageActivated(activation_state); |
| 220 } |
| 221 |
217 void ContentSubresourceFilterDriverFactory::OnFirstSubresourceLoadDisallowed() { | 222 void ContentSubresourceFilterDriverFactory::OnFirstSubresourceLoadDisallowed() { |
218 const auto configurations = GetActiveConfigurations(); | 223 const auto configurations = GetActiveConfigurations(); |
219 if (configurations->the_one_and_only().should_suppress_notifications) | 224 if (configurations->the_one_and_only().should_suppress_notifications) |
220 return; | 225 return; |
221 | 226 |
222 client_->ToggleNotificationVisibility(activation_level_ == | 227 client_->ToggleNotificationVisibility(activation_level_ == |
223 ActivationLevel::ENABLED); | 228 ActivationLevel::ENABLED); |
224 } | 229 } |
225 | 230 |
226 bool ContentSubresourceFilterDriverFactory::ShouldSuppressActivation( | 231 bool ContentSubresourceFilterDriverFactory::ShouldSuppressActivation( |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 REPORT_REDIRECT_PATTERN_FOR_SUFFIX("SubresourceFilterOnly", hits_pattern, | 333 REPORT_REDIRECT_PATTERN_FOR_SUFFIX("SubresourceFilterOnly", hits_pattern, |
329 chain_size); | 334 chain_size); |
330 break; | 335 break; |
331 default: | 336 default: |
332 NOTREACHED(); | 337 NOTREACHED(); |
333 break; | 338 break; |
334 } | 339 } |
335 } | 340 } |
336 | 341 |
337 } // namespace subresource_filter | 342 } // namespace subresource_filter |
OLD | NEW |