| 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();
|
| }
|
|
|