Commit badd2ac3 authored by Sophie Chang's avatar Sophie Chang Committed by Commit Bot

Extend opt_out UKM metric definition (2 = omnibox opt out, 1 = infobar opt out)

Bug: 889621
Change-Id: Ibb038ec8ea75a75129dd9ccbfb20c86da750a901
Reviewed-on: https://chromium-review.googlesource.com/1255262Reviewed-by: default avatarSteven Holte <holte@chromium.org>
Reviewed-by: default avatarRyan Sturm <ryansturm@chromium.org>
Commit-Queue: Sophie Chang <sophiechang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595646}
parent 1b7451ab
......@@ -18,6 +18,7 @@
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_data.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.h"
#include "components/previews/content/previews_content_util.h"
#include "components/previews/core/previews_experiments.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/previews_state.h"
......@@ -129,7 +130,7 @@ void PreviewsUKMObserver::RecordPreviewsTypes(
if (resource_loading_hints_seen_)
builder.Setresource_loading_hints(1);
if (opt_out_occurred_)
builder.Setopt_out(1);
builder.Setopt_out(previews::params::IsPreviewsOmniboxUiEnabled() ? 2 : 1);
if (origin_opt_out_occurred_)
builder.Setorigin_opt_out(1);
if (save_data_enabled_)
......
......@@ -88,8 +88,7 @@ void PreviewsUITabHelper::ShowUIElement(
on_dismiss_callback_ = std::move(on_dismiss_callback);
#if defined(OS_ANDROID)
if (base::FeatureList::IsEnabled(
previews::features::kAndroidOmniboxPreviewsBadge)) {
if (previews::params::IsPreviewsOmniboxUiEnabled()) {
should_display_android_omnibox_badge_ = true;
return;
}
......
......@@ -229,6 +229,10 @@ bool ArePreviewsAllowed() {
return base::FeatureList::IsEnabled(features::kPreviews);
}
bool IsPreviewsOmniboxUiEnabled() {
return base::FeatureList::IsEnabled(features::kAndroidOmniboxPreviewsBadge);
}
bool IsOfflinePreviewsEnabled() {
return base::FeatureList::IsEnabled(features::kOfflinePreviews);
}
......
......@@ -123,6 +123,9 @@ net::EffectiveConnectionType GetECTThresholdForPreview(
// Whether any previews are allowed. Acts as a kill-switch or holdback check.
bool ArePreviewsAllowed();
// Whether the Previews UI is in the omnibox instead of an infobar.
bool IsPreviewsOmniboxUiEnabled();
// Whether the preview type is enabled.
bool IsOfflinePreviewsEnabled();
bool IsClientLoFiEnabled();
......
......@@ -3470,7 +3470,8 @@ be describing additional metrics about the same event.
<metric name="opt_out">
<summary>
Set to 1 when a user clicks &quot;Show Original&quot; on a preview page
load.
load using the infobar. Set to 2 when a user opts out of a Preview using
the omnibox.
</summary>
</metric>
<metric name="origin_opt_out">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment