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

Unified Diff: components/previews/core/previews_black_list.cc

Issue 2760063002: Add support to previews/ for Server LoFi and LitePages (Closed)
Patch Set: comment fix Created 3 years, 7 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 | « components/previews/core/previews_black_list.h ('k') | components/previews/core/previews_decider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/previews/core/previews_black_list.cc
diff --git a/components/previews/core/previews_black_list.cc b/components/previews/core/previews_black_list.cc
index ea5de7d822f6ebb8cf9d5504a500ad896895303a..3baccd5e3e9fd9a00704f9535eb5d6e941945415 100644
--- a/components/previews/core/previews_black_list.cc
+++ b/components/previews/core/previews_black_list.cc
@@ -6,8 +6,9 @@
#include "base/bind.h"
#include "base/memory/ptr_util.h"
-#include "base/metrics/histogram_macros.h"
+#include "base/metrics/histogram.h"
#include "base/optional.h"
+#include "base/strings/stringprintf.h"
#include "base/time/clock.h"
#include "components/previews/core/previews_black_list_item.h"
#include "components/previews/core/previews_experiments.h"
@@ -74,13 +75,12 @@ void PreviewsBlackList::AddPreviewNavigation(const GURL& url,
PreviewsType type) {
DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(url.has_host());
- switch (type) {
- case PreviewsType::OFFLINE:
- UMA_HISTOGRAM_BOOLEAN("Previews.OptOut.UserOptedOut.Offline", opt_out);
- break;
- default:
- NOTREACHED();
- }
+
+ base::BooleanHistogram::FactoryGet(
+ base::StringPrintf("Previews.OptOut.UserOptedOut.%s",
+ GetStringNameForType(type).c_str()),
+ base::HistogramBase::kUmaTargetedHistogramFlag)
+ ->Add(opt_out);
if (opt_out) {
last_opt_out_time_ = clock_->Now();
}
« no previous file with comments | « components/previews/core/previews_black_list.h ('k') | components/previews/core/previews_decider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698