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/extensions/active_script_controller.h" | 5 #include "chrome/browser/extensions/active_script_controller.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 PendingRequestList& list = pending_requests_[extension->id()]; | 89 PendingRequestList& list = pending_requests_[extension->id()]; |
90 list.push_back(PendingRequest(callback, page_id)); | 90 list.push_back(PendingRequest(callback, page_id)); |
91 | 91 |
92 // If this was the first entry, notify the location bar that there's a new | 92 // If this was the first entry, notify the location bar that there's a new |
93 // icon. | 93 // icon. |
94 if (list.size() == 1u) | 94 if (list.size() == 1u) |
95 LocationBarController::NotifyChange(web_contents()); | 95 LocationBarController::NotifyChange(web_contents()); |
96 } | 96 } |
97 | 97 |
98 void ActiveScriptController::OnAdInjectionDetected( | 98 void ActiveScriptController::OnAdInjectionDetected( |
99 const std::vector<std::string> ad_injectors) { | 99 const std::set<std::string> ad_injectors) { |
100 // We're only interested in data if there are ad injectors detected. | 100 // We're only interested in data if there are ad injectors detected. |
101 if (ad_injectors.empty()) | 101 if (ad_injectors.empty()) |
102 return; | 102 return; |
103 | 103 |
104 size_t num_preventable_ad_injectors = | 104 size_t num_preventable_ad_injectors = |
105 base::STLSetIntersection<std::set<std::string> >( | 105 base::STLSetIntersection<std::set<std::string> >( |
106 ad_injectors, permitted_extensions_).size(); | 106 ad_injectors, permitted_extensions_).size(); |
107 | 107 |
108 UMA_HISTOGRAM_COUNTS_100( | 108 UMA_HISTOGRAM_COUNTS_100( |
109 "Extensions.ActiveScriptController.PreventableAdInjectors", | 109 "Extensions.ActiveScriptController.PreventableAdInjectors", |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 UMA_HISTOGRAM_COUNTS_100( | 230 UMA_HISTOGRAM_COUNTS_100( |
231 "Extensions.ActiveScriptController.PermittedExtensions", | 231 "Extensions.ActiveScriptController.PermittedExtensions", |
232 permitted_extensions_.size()); | 232 permitted_extensions_.size()); |
233 UMA_HISTOGRAM_COUNTS_100( | 233 UMA_HISTOGRAM_COUNTS_100( |
234 "Extensions.ActiveScriptController.DeniedExtensions", | 234 "Extensions.ActiveScriptController.DeniedExtensions", |
235 pending_requests_.size()); | 235 pending_requests_.size()); |
236 } | 236 } |
237 } | 237 } |
238 | 238 |
239 } // namespace extensions | 239 } // namespace extensions |
OLD | NEW |