Skip to content

Commit

Permalink
[cherry pick][desktop ios promo] FET feature for iOS password promo on
Browse files Browse the repository at this point in the history
desktop

The FET feature used for the iOS password promo on desktop. This FET
feature is by default non-blocking or blocked, but is present to allow
FET control over the feature if needed, as requested by the user ed
team.

(cherry picked from commit b128b61)

Bug: 1435035
Change-Id: Ib8db8fb63f2db3962810390eb95c78508b613d18
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4627734
Commit-Queue: Nicolas MacBeth <nicolasmacbeth@google.com>
Reviewed-by: Tommy Nyquist <nyquist@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1160430}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4640480
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/branch-heads/5845@{#63}
Cr-Branched-From: 5a5dff6-refs/heads/main@{#1160321}
  • Loading branch information
Nicolas-MacBeth authored and Chromium LUCI CQ committed Jun 24, 2023
1 parent 1034b26 commit a1960c0
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 0 deletions.
1 change: 1 addition & 0 deletions components/feature_engagement/public/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ source_set("public") {

deps = [
"//base",
"//build:branding_buildflags",
"//components/feed:feature_list",
"//components/flags_ui",
"//components/keyed_service/core",
Expand Down
24 changes: 24 additions & 0 deletions components/feature_engagement/public/feature_configurations.cc
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,30 @@ absl::optional<FeatureConfig> GetClientSideFeatureConfig(
#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) ||
// BUILDFLAG(IS_CHROMEOS)

#if !BUILDFLAG(IS_ANDROID) && BUILDFLAG(GOOGLE_CHROME_BRANDING)
if (kIPHiOSPasswordPromoDesktopFeature.name == feature->name) {
// A config for allowing other IPH's to explicitly block the iOS password
// promo bubble on desktop if needed. By default it is non-blocking and
// non-blocked by other IPH due it being highly contextual, but this FET
// config and feature exist to allow some FET control over this promo if
// needed.

absl::optional<FeatureConfig> config = FeatureConfig();
config->valid = true;
config->availability = Comparator(ANY, 0);
config->session_rate = Comparator(ANY, 0);
config->session_rate_impact.type = SessionRateImpact::Type::NONE;
config->blocked_by.type = BlockedBy::Type::NONE;
config->blocking.type = Blocking::Type::NONE;
config->used =
EventConfig("ios_password_promo_bubble_on_desktop_interacted_with",
Comparator(ANY, 0), 0, 0);
config->trigger = EventConfig("ios_password_promo_bubble_on_desktop_shown",
Comparator(ANY, 0), 0, 0);
return config;
}
#endif // !BUILDFLAG(IS_ANDROID) && BUILDFLAG(GOOGLE_CHROME_BRANDING)

#if BUILDFLAG(IS_ANDROID)

constexpr int k10YearsInDays = 365 * 10;
Expand Down
7 changes: 7 additions & 0 deletions components/feature_engagement/public/feature_constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include "base/feature_list.h"
#include "base/metrics/field_trial_params.h"
#include "build/branding_buildflags.h"
#include "build/build_config.h"

namespace feature_engagement {
Expand Down Expand Up @@ -521,4 +522,10 @@ BASE_FEATURE(kIPHLauncherSearchHelpUiFeature,
base::FEATURE_DISABLED_BY_DEFAULT);
#endif

#if !BUILDFLAG(IS_ANDROID) && BUILDFLAG(GOOGLE_CHROME_BRANDING)
BASE_FEATURE(kIPHiOSPasswordPromoDesktopFeature,
"IPH_iOSPasswordPromoDesktop",
base::FEATURE_ENABLED_BY_DEFAULT);
#endif // !BUILDFLAG(IS_ANDROID) && BUILDFLAG(GOOGLE_CHROME_BRANDING)

} // namespace feature_engagement
5 changes: 5 additions & 0 deletions components/feature_engagement/public/feature_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#define COMPONENTS_FEATURE_ENGAGEMENT_PUBLIC_FEATURE_CONSTANTS_H_

#include "base/feature_list.h"
#include "build/branding_buildflags.h"
#include "build/build_config.h"

namespace feature_engagement {
Expand Down Expand Up @@ -215,6 +216,10 @@ BASE_DECLARE_FEATURE(kIPHGoogleOneOfferNotificationFeature);
BASE_DECLARE_FEATURE(kIPHLauncherSearchHelpUiFeature);
#endif

#if !BUILDFLAG(IS_ANDROID) && BUILDFLAG(GOOGLE_CHROME_BRANDING)
BASE_DECLARE_FEATURE(kIPHiOSPasswordPromoDesktopFeature);
#endif // !BUILDFLAG(IS_ANDROID) && BUILDFLAG(GOOGLE_CHROME_BRANDING)

} // namespace feature_engagement

#endif // COMPONENTS_FEATURE_ENGAGEMENT_PUBLIC_FEATURE_CONSTANTS_H_
5 changes: 5 additions & 0 deletions components/feature_engagement/public/feature_list.cc
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ const base::Feature* const kAllFeatures[] = {
&kIPHGoogleOneOfferNotificationFeature,
&kIPHLauncherSearchHelpUiFeature,
#endif // BUILDFLAG(IS_CHROMEOS_ASH)

#if !BUILDFLAG(IS_ANDROID) && BUILDFLAG(GOOGLE_CHROME_BRANDING)
&kIPHiOSPasswordPromoDesktopFeature,
#endif // !BUILDFLAG(IS_ANDROID) && BUILDFLAG(GOOGLE_CHROME_BRANDING)

};
} // namespace

Expand Down
10 changes: 10 additions & 0 deletions components/feature_engagement/public/feature_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,11 @@ DEFINE_VARIATION_PARAM(kIPHLauncherSearchHelpUiFeature,
"IPH_LauncherSearchHelpUi");
#endif // BUILDFLAG(IS_CHROMEOS_ASH)

#if !BUILDFLAG(IS_ANDROID) && BUILDFLAG(GOOGLE_CHROME_BRANDING)
DEFINE_VARIATION_PARAM(kIPHiOSPasswordPromoDesktopFeature,
"IPH_iOSPasswordPromoDesktop");
#endif // !BUILDFLAG(IS_ANDROID) && BUILDFLAG(GOOGLE_CHROME_BRANDING)

} // namespace

// Defines the array of which features should be listed in the chrome://flags
Expand Down Expand Up @@ -509,6 +514,11 @@ constexpr flags_ui::FeatureEntry::FeatureVariation
VARIATION_ENTRY(kIPHGoogleOneOfferNotificationFeature),
VARIATION_ENTRY(kIPHLauncherSearchHelpUiFeature),
#endif // BUILDFLAG(IS_CHROMEOS_ASH)

#if !BUILDFLAG(IS_ANDROID) && BUILDFLAG(GOOGLE_CHROME_BRANDING)
VARIATION_ENTRY(kIPHiOSPasswordPromoDesktopFeature),
#endif // !BUILDFLAG(IS_ANDROID) && BUILDFLAG(GOOGLE_CHROME_BRANDING)

};

#undef DEFINE_VARIATION_PARAM
Expand Down
2 changes: 2 additions & 0 deletions tools/metrics/actions/actions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38200,6 +38200,8 @@ should be able to be added at any place in this file.
label="For iOSHistoryOnOverflowMenuFeature feature"/>
<suffix name="iOSNewTabToolbarItemFeature"
label="For iOSNewTabToolbarItemFeature feature"/>
<suffix name="iOSPasswordPromoDesktop"
label="For iOSPasswordPromoDesktop feature"/>
<suffix name="iOSPromoAppStore" label="For iOSPromoAppStore feature"/>
<suffix name="iOSPromoCredentialProviderExtension"
label="For iOSPromoCredentialProviderExtension feature"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ chromium-metrics-reviews@google.com.
summary="history item on the overflow menu on iOS"/>
<variant name="IPH_iOSNewTabToolbarItemFeature"
summary="the new tab tool bar item (bottom on iPhone, top on iPad)"/>
<variant name="IPH_iOSPasswordPromoDesktop"
summary="showing the iOS password promo on desktop"/>
<variant name="IPH_iOSPromoAppStore"
summary="showing the App Store Promo on iOS"/>
<variant name="IPH_iOSPromoCredentialProviderExtension"
Expand Down

0 comments on commit a1960c0

Please sign in to comment.