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

Unified Diff: chrome/browser/history/top_sites_impl.cc

Issue 23181006: Add UMA stats to allow computing the average size of the TopSites blacklist per user. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/top_sites_impl.cc
diff --git a/chrome/browser/history/top_sites_impl.cc b/chrome/browser/history/top_sites_impl.cc
index c8f04660663ed1d5af5023a1a69a25c9d0876523..ed9739267bc2843af6ae559e136fca4fcb5c2f0b 100644
--- a/chrome/browser/history/top_sites_impl.cc
+++ b/chrome/browser/history/top_sites_impl.cc
@@ -9,6 +9,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
+#include "base/metrics/histogram.h"
#include "base/logging.h"
#include "base/md5.h"
#include "base/memory/ref_counted_memory.h"
@@ -691,6 +692,13 @@ bool TopSitesImpl::AddPrepopulatedPages(MostVisitedURLList* urls) {
void TopSitesImpl::ApplyBlacklist(const MostVisitedURLList& urls,
MostVisitedURLList* out) {
+ // Log the number of times ApplyBlacklist is called so we can compute the
+ // average number of blacklisted items per user.
+ const DictionaryValue* blacklist =
+ profile_->GetPrefs()->GetDictionary(prefs::kNtpMostVisitedURLsBlacklist);
+ UMA_HISTOGRAM_BOOLEAN("TopSites.NumberOfApplyBlacklist", true);
+ UMA_HISTOGRAM_COUNTS_100("TopSites.NumberOfBlacklistedItems",
+ (blacklist ? blacklist->size() : 0));
for (size_t i = 0; i < urls.size() && i < kTopSitesNumber; ++i) {
if (!IsBlacklisted(urls[i].url))
out->push_back(urls[i]);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698