Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Side by Side Diff: chrome/browser/extensions/active_script_controller.cc

Issue 292313006: Improve activity log ad metrics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 if (list.size() == 1u) 100 if (list.size() == 1u)
101 LocationBarController::NotifyChange(web_contents()); 101 LocationBarController::NotifyChange(web_contents());
102 } 102 }
103 103
104 void ActiveScriptController::OnActiveTabPermissionGranted( 104 void ActiveScriptController::OnActiveTabPermissionGranted(
105 const Extension* extension) { 105 const Extension* extension) {
106 RunPendingForExtension(extension); 106 RunPendingForExtension(extension);
107 } 107 }
108 108
109 void ActiveScriptController::OnAdInjectionDetected( 109 void ActiveScriptController::OnAdInjectionDetected(
110 const std::vector<std::string> ad_injectors) { 110 const std::set<std::string> ad_injectors) {
111 // We're only interested in data if there are ad injectors detected. 111 // We're only interested in data if there are ad injectors detected.
112 if (ad_injectors.empty()) 112 if (ad_injectors.empty())
113 return; 113 return;
114 114
115 size_t num_preventable_ad_injectors = 115 size_t num_preventable_ad_injectors =
116 base::STLSetIntersection<std::set<std::string> >( 116 base::STLSetIntersection<std::set<std::string> >(
117 ad_injectors, permitted_extensions_).size(); 117 ad_injectors, permitted_extensions_).size();
118 118
119 UMA_HISTOGRAM_COUNTS_100( 119 UMA_HISTOGRAM_COUNTS_100(
120 "Extensions.ActiveScriptController.PreventableAdInjectors", 120 "Extensions.ActiveScriptController.PreventableAdInjectors",
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 UMA_HISTOGRAM_COUNTS_100( 254 UMA_HISTOGRAM_COUNTS_100(
255 "Extensions.ActiveScriptController.PermittedExtensions", 255 "Extensions.ActiveScriptController.PermittedExtensions",
256 permitted_extensions_.size()); 256 permitted_extensions_.size());
257 UMA_HISTOGRAM_COUNTS_100( 257 UMA_HISTOGRAM_COUNTS_100(
258 "Extensions.ActiveScriptController.DeniedExtensions", 258 "Extensions.ActiveScriptController.DeniedExtensions",
259 pending_requests_.size()); 259 pending_requests_.size());
260 } 260 }
261 } 261 }
262 262
263 } // namespace extensions 263 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/active_script_controller.h ('k') | chrome/browser/extensions/activity_log/activity_actions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698