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

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

Issue 2760063002: Add support to previews/ for Server LoFi and LitePages (Closed)
Patch Set: rebase and previews_service_unittest.cc Created 3 years, 8 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
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..ffd35cc71e52cb52aabdb3ac76e0befdec502f10 100644
--- a/components/previews/core/previews_black_list.cc
+++ b/components/previews/core/previews_black_list.cc
@@ -6,7 +6,7 @@
#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/time/clock.h"
#include "components/previews/core/previews_black_list_item.h"
@@ -74,13 +74,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();
- }
+ std::string histogram_name("Previews.OptOut.UserOptedOut.");
tbansal1 2017/05/02 21:49:31 Use StringPiece or base::StringPrintf to reduce
RyanSturm 2017/05/02 22:57:18 Done.
+ histogram_name.append(GetStringNameForType(type));
+
+ base::BooleanHistogram::FactoryGet(
+ histogram_name, base::HistogramBase::kUmaTargetedHistogramFlag)
+ ->Add(opt_out);
if (opt_out) {
last_opt_out_time_ = clock_->Now();
}

Powered by Google App Engine
This is Rietveld 408576698