| 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/metrics/histogram_macros.h" | 7 #include "base/metrics/histogram_macros.h" |
| 8 #include "components/subresource_filter/content/browser/content_subresource_filt
er_driver.h" | 8 #include "components/subresource_filter/content/browser/content_subresource_filt
er_driver.h" |
| 9 #include "components/subresource_filter/content/common/subresource_filter_messag
es.h" | 9 #include "components/subresource_filter/content/common/subresource_filter_messag
es.h" |
| 10 #include "components/subresource_filter/core/browser/subresource_filter_client.h
" | 10 #include "components/subresource_filter/core/browser/subresource_filter_client.h
" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 DCHECK(driver); | 130 DCHECK(driver); |
| 131 driver->ActivateForProvisionalLoad(GetMaximumActivationState(), url, | 131 driver->ActivateForProvisionalLoad(GetMaximumActivationState(), url, |
| 132 measure_performance); | 132 measure_performance); |
| 133 } | 133 } |
| 134 } | 134 } |
| 135 | 135 |
| 136 void ContentSubresourceFilterDriverFactory::OnReloadRequested() { | 136 void ContentSubresourceFilterDriverFactory::OnReloadRequested() { |
| 137 UMA_HISTOGRAM_BOOLEAN("SubresourceFilter.Prompt.NumReloads", true); | 137 UMA_HISTOGRAM_BOOLEAN("SubresourceFilter.Prompt.NumReloads", true); |
| 138 const GURL whitelist_url(web_contents()->GetLastCommittedURL()); | 138 const GURL whitelist_url(web_contents()->GetLastCommittedURL()); |
| 139 AddHostOfURLToWhitelistSet(whitelist_url); | 139 AddHostOfURLToWhitelistSet(whitelist_url); |
| 140 web_contents()->GetController().Reload(true); | 140 web_contents()->GetController().Reload(content::ReloadType::NORMAL, true); |
| 141 } | 141 } |
| 142 | 142 |
| 143 void ContentSubresourceFilterDriverFactory::SetDriverForFrameHostForTesting( | 143 void ContentSubresourceFilterDriverFactory::SetDriverForFrameHostForTesting( |
| 144 content::RenderFrameHost* render_frame_host, | 144 content::RenderFrameHost* render_frame_host, |
| 145 std::unique_ptr<ContentSubresourceFilterDriver> driver) { | 145 std::unique_ptr<ContentSubresourceFilterDriver> driver) { |
| 146 auto iterator_and_inserted = | 146 auto iterator_and_inserted = |
| 147 frame_drivers_.insert(std::make_pair(render_frame_host, nullptr)); | 147 frame_drivers_.insert(std::make_pair(render_frame_host, nullptr)); |
| 148 iterator_and_inserted.first->second = std::move(driver); | 148 iterator_and_inserted.first->second = std::move(driver); |
| 149 } | 149 } |
| 150 | 150 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 if (!hits_pattern) | 262 if (!hits_pattern) |
| 263 return; | 263 return; |
| 264 UMA_HISTOGRAM_ENUMERATION( | 264 UMA_HISTOGRAM_ENUMERATION( |
| 265 "SubresourceFilter.PageLoad.RedirectChainMatchPattern", hits_pattern, | 265 "SubresourceFilter.PageLoad.RedirectChainMatchPattern", hits_pattern, |
| 266 0x10 /* max value */); | 266 0x10 /* max value */); |
| 267 UMA_HISTOGRAM_COUNTS("SubresourceFilter.PageLoad.RedirectChainLength", | 267 UMA_HISTOGRAM_COUNTS("SubresourceFilter.PageLoad.RedirectChainLength", |
| 268 navigation_chain_.size()); | 268 navigation_chain_.size()); |
| 269 } | 269 } |
| 270 | 270 |
| 271 } // namespace subresource_filter | 271 } // namespace subresource_filter |
| OLD | NEW |