summaryrefslogtreecommitdiff
path: root/chromium/components/feature_engagement
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2022-05-17 17:24:03 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2022-06-22 07:51:41 +0000
commit774f54339e5db91f785733232d3950366db65d07 (patch)
tree068e1b47bd1af94d77094ed12b604a6b83d9c22a /chromium/components/feature_engagement
parentf7eaed5286974984ba5f9e3189d8f49d03e99f81 (diff)
downloadqtwebengine-chromium-774f54339e5db91f785733232d3950366db65d07.tar.gz
BASELINE: Update Chromium to 102.0.5005.57
Change-Id: I885f714bb40ee724c28f94ca6bd8dbdb39915158 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/components/feature_engagement')
-rw-r--r--chromium/components/feature_engagement/README.md18
-rw-r--r--chromium/components/feature_engagement/internal/event_model_impl.cc1
-rw-r--r--chromium/components/feature_engagement/internal/feature_config_condition_validator_unittest.cc1
-rw-r--r--chromium/components/feature_engagement/internal/tracker_impl_unittest.cc1
-rw-r--r--chromium/components/feature_engagement/public/event_constants.cc2
-rw-r--r--chromium/components/feature_engagement/public/event_constants.h7
-rw-r--r--chromium/components/feature_engagement/public/feature_configurations.cc15
-rw-r--r--chromium/components/feature_engagement/public/feature_constants.cc6
-rw-r--r--chromium/components/feature_engagement/public/feature_constants.h3
-rw-r--r--chromium/components/feature_engagement/public/feature_list.cc6
-rw-r--r--chromium/components/feature_engagement/public/feature_list.h10
11 files changed, 51 insertions, 19 deletions
diff --git a/chromium/components/feature_engagement/README.md b/chromium/components/feature_engagement/README.md
index a915d69fee9..1420c3eb5e4 100644
--- a/chromium/components/feature_engagement/README.md
+++ b/chromium/components/feature_engagement/README.md
@@ -35,9 +35,9 @@ before. However, that leads to a few issues that this component tries to solve:
might not want to show a different one.
* Whether we have shown a particular In-Product Help or not might be a
precondition for whether we should show different one.
-* Users should be able to use try out a feature on their own for some time
- before they see help.
- * We should show In-Product Help only if they don't seem use it, but we
+* Users should be able to try out a feature on their own for some time before
+ they see help.
+ * We should show In-Product Help only if they don't seem to use it, but we
believe it would be helpful to them.
* Share the same statistics framework across all of Chrome.
* Sharing a framework within Chrome makes it easier to track statistics
@@ -82,7 +82,7 @@ Lastly, some preconditions might require something to never have happened. The
first time a user has an IPH available, that will typically be true, since the
event just started being tracked so no interactions have been recorded yet. E.g.
if a precondition is "the user has never opened the menu", and this has not been
-tracked before, the number of times that we have so far have recorded that the
+tracked before, the number of times that we have so far recorded that the
user has opened the menu is 0, even if that is a common action for the user.
Therefore, the framework supports requiring the IPH to have been available for a
certain amount of days before being applicable. With the opening of menu
@@ -107,7 +107,7 @@ detail below.
by notifying about events, and checking whether In-Product Help should be
displayed.
* [Configure UMA](#Required-UMA-Changes).
-* [Add a local field trial testing configuration](#Adding-a-local-field-trial-testing-configuration).
+* [Add a field trial configuration](#field-trial-configuration).
### Declaring your feature
@@ -432,7 +432,7 @@ How to select a feature or features is described below.
### Enabling a single In-Product Help feature in demo-mode
1. Go to chrome://flags
-1. Find “In-Product Help Demo Mode” (#enable-iph-demo-choice)
+1. Find “In-Product Help Demo Mode” (#in-product-help-demo-mode-choice)
1. Select the feature you want with the "Enabled " prefix, for example for
`IPH_GoatTeleportationFeature` you would select:
* Enabled IPH_GoatTeleportationFeature
@@ -590,8 +590,8 @@ to trigger as long as no other IPH has been shown.
"availability": ">=0",
"session_rate": "<1",
"event_used": "name:shopping_list_track_price_from_menu;comparator:==0;window:360;storage:360",
- "event_trigger": "shopping_list_menu_item_iph_triggered;comparator:==0;window:7;storage:7",
- "event_trigger_1": "shopping_list_menu_item_iph_triggered;comparator:<3;window:36;storage:360"
+ "event_trigger": "name:shopping_list_menu_item_iph_triggered;comparator:==0;window:7;storage:7",
+ "event_trigger_1": "name:shopping_list_menu_item_iph_triggered;comparator:<3;window:360;storage:360"
}
```
@@ -757,7 +757,7 @@ Format: `[all|none]`
* `all` means this feature blocks every other feature regarding their
`IsBlocked` calculations. This is the default.
* `none` means that this feature does not block any other features regarding
- the `IsBlocked` calculation.
+ the `IsBlocked` calculation.
**Examples**
diff --git a/chromium/components/feature_engagement/internal/event_model_impl.cc b/chromium/components/feature_engagement/internal/event_model_impl.cc
index 296e5e6ebbd..24788fdcf23 100644
--- a/chromium/components/feature_engagement/internal/event_model_impl.cc
+++ b/chromium/components/feature_engagement/internal/event_model_impl.cc
@@ -223,6 +223,7 @@ int EventModelImpl::GetEventCountOrSnooze(const std::string& event_name,
}
Event& EventModelImpl::GetNonConstEvent(const std::string& event_name) {
+ DCHECK_NE("", event_name);
if (events_.find(event_name) == events_.end()) {
// Event does not exist yet, so create it.
events_[event_name].set_name(event_name);
diff --git a/chromium/components/feature_engagement/internal/feature_config_condition_validator_unittest.cc b/chromium/components/feature_engagement/internal/feature_config_condition_validator_unittest.cc
index bb10b170a02..87b79923eac 100644
--- a/chromium/components/feature_engagement/internal/feature_config_condition_validator_unittest.cc
+++ b/chromium/components/feature_engagement/internal/feature_config_condition_validator_unittest.cc
@@ -11,6 +11,7 @@
#include "base/feature_list.h"
#include "base/metrics/field_trial.h"
#include "base/test/scoped_feature_list.h"
+#include "base/time/time.h"
#include "components/feature_engagement/internal/availability_model.h"
#include "components/feature_engagement/internal/event_model.h"
#include "components/feature_engagement/internal/noop_display_lock_controller.h"
diff --git a/chromium/components/feature_engagement/internal/tracker_impl_unittest.cc b/chromium/components/feature_engagement/internal/tracker_impl_unittest.cc
index 0b407e602f3..6d659c850c3 100644
--- a/chromium/components/feature_engagement/internal/tracker_impl_unittest.cc
+++ b/chromium/components/feature_engagement/internal/tracker_impl_unittest.cc
@@ -21,6 +21,7 @@
#include "base/test/metrics/user_action_tester.h"
#include "base/test/task_environment.h"
#include "base/threading/thread_task_runner_handle.h"
+#include "base/time/time.h"
#include "components/feature_engagement/internal/availability_model_impl.h"
#include "components/feature_engagement/internal/display_lock_controller.h"
#include "components/feature_engagement/internal/editable_configuration.h"
diff --git a/chromium/components/feature_engagement/public/event_constants.cc b/chromium/components/feature_engagement/public/event_constants.cc
index 711103ea601..9598c4f0e4b 100644
--- a/chromium/components/feature_engagement/public/event_constants.cc
+++ b/chromium/components/feature_engagement/public/event_constants.cc
@@ -60,6 +60,8 @@ const char kBottomToolbarOpened[] = "bottom_toolbar_opened";
const char kDiscoverFeedLoaded[] = "discover_feed_loaded";
const char kDesktopVersionRequested[] = "desktop_version_requested";
const char kDefaultSiteViewShown[] = "default_site_view_shown";
+const char kPasswordSuggestionsShown[] = "password_suggestions_shown";
+const char kPasswordSuggestionSelected[] = "password_suggestion_selected";
#endif // BUILDFLAG(IS_IOS)
#if BUILDFLAG(IS_ANDROID)
diff --git a/chromium/components/feature_engagement/public/event_constants.h b/chromium/components/feature_engagement/public/event_constants.h
index 489f67ef0e5..546e945d217 100644
--- a/chromium/components/feature_engagement/public/event_constants.h
+++ b/chromium/components/feature_engagement/public/event_constants.h
@@ -105,6 +105,13 @@ extern const char kDesktopVersionRequested[];
// The default site view tip is shown.
extern const char kDefaultSiteViewShown[];
+
+// Autofill displayed password suggestions.
+extern const char kPasswordSuggestionsShown[];
+
+// The user has selected an Autofill password suggestion.
+extern const char kPasswordSuggestionSelected[];
+
#endif // BUILDFLAG(IS_IOS)
// Android.
diff --git a/chromium/components/feature_engagement/public/feature_configurations.cc b/chromium/components/feature_engagement/public/feature_configurations.cc
index e2a88b038d3..f9bfc199230 100644
--- a/chromium/components/feature_engagement/public/feature_configurations.cc
+++ b/chromium/components/feature_engagement/public/feature_configurations.cc
@@ -110,6 +110,21 @@ absl::optional<FeatureConfig> GetClientSideFeatureConfig(
return config;
}
+ if (kIPHIntentChipFeature.name == feature->name) {
+ absl::optional<FeatureConfig> config = FeatureConfig();
+ config->valid = true;
+ config->availability = Comparator(ANY, 0);
+ config->session_rate = Comparator(ANY, 0);
+
+ // Show the IPH once a month if the intent chip hasn't opened any app in
+ // a year.
+ config->trigger =
+ EventConfig("intent_chip_trigger", Comparator(EQUAL, 0), 30, 360);
+ config->used =
+ EventConfig("intent_chip_opened_app", Comparator(EQUAL, 0), 360, 360);
+ return config;
+ }
+
#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) ||
// BUILDFLAG(IS_CHROMEOS)
diff --git a/chromium/components/feature_engagement/public/feature_constants.cc b/chromium/components/feature_engagement/public/feature_constants.cc
index afa48650ef0..034172e2363 100644
--- a/chromium/components/feature_engagement/public/feature_constants.cc
+++ b/chromium/components/feature_engagement/public/feature_constants.cc
@@ -57,6 +57,8 @@ const base::Feature kIPHDesktopPwaInstallFeature{
"IPH_DesktopPwaInstall", base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kIPHProfileSwitchFeature{"IPH_ProfileSwitch",
base::FEATURE_ENABLED_BY_DEFAULT};
+const base::Feature kIPHIntentChipFeature{"IPH_IntentChip",
+ base::FEATURE_DISABLED_BY_DEFAULT};
#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) ||
// BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
@@ -179,8 +181,6 @@ const base::Feature kIPHFeedCardMenuFeature{"IPH_FeedCardMenu",
base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kIPHGenericAlwaysTriggerHelpUiFeature{
"IPH_GenericAlwaysTriggerHelpUiFeature", base::FEATURE_ENABLED_BY_DEFAULT};
-const base::Feature kIPHHomepagePromoCardFeature{
- "IPH_HomepagePromoCard", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kIPHIdentityDiscFeature{"IPH_IdentityDisc",
base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kIPHInstanceSwitcherFeature{
@@ -284,6 +284,8 @@ const base::Feature kIPHDiscoverFeedHeaderFeature{
"IPH_DiscoverFeedHeaderMenu", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kIPHDefaultSiteViewFeature{
"IPH_DefaultSiteView", base::FEATURE_DISABLED_BY_DEFAULT};
+const base::Feature kIPHPasswordSuggestionsFeature{
+ "IPH_PasswordSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
#endif // BUILDFLAG(IS_IOS)
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \
diff --git a/chromium/components/feature_engagement/public/feature_constants.h b/chromium/components/feature_engagement/public/feature_constants.h
index c7cfa79a1b7..fa255f73dff 100644
--- a/chromium/components/feature_engagement/public/feature_constants.h
+++ b/chromium/components/feature_engagement/public/feature_constants.h
@@ -40,6 +40,7 @@ extern const base::Feature kIPHTabAudioMutingFeature;
extern const base::Feature kIPHPasswordsAccountStorageFeature;
extern const base::Feature kIPHReadingListDiscoveryFeature;
extern const base::Feature kIPHReadingListEntryPointFeature;
+extern const base::Feature kIPHIntentChipFeature;
extern const base::Feature kIPHReadingListInSidePanelFeature;
extern const base::Feature kIPHReopenTabFeature;
extern const base::Feature kIPHSideSearchFeature;
@@ -112,7 +113,6 @@ extern const base::Feature kIPHFeedCardMenuFeature;
extern const base::Feature kIPHGenericAlwaysTriggerHelpUiFeature;
extern const base::Feature kIPHHomePageButtonFeature;
extern const base::Feature kIPHHomepageTileFeature;
-extern const base::Feature kIPHHomepagePromoCardFeature;
extern const base::Feature kIPHIdentityDiscFeature;
extern const base::Feature kIPHInstanceSwitcherFeature;
extern const base::Feature kIPHKeyboardAccessoryAddressFillingFeature;
@@ -172,6 +172,7 @@ extern const base::Feature kIPHReadingListMessagesFeature;
extern const base::Feature kIPHBadgedTranslateManualTriggerFeature;
extern const base::Feature kIPHDiscoverFeedHeaderFeature;
extern const base::Feature kIPHDefaultSiteViewFeature;
+extern const base::Feature kIPHPasswordSuggestionsFeature;
#endif // BUILDFLAG(IS_IOS)
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \
diff --git a/chromium/components/feature_engagement/public/feature_list.cc b/chromium/components/feature_engagement/public/feature_list.cc
index 35c9729e50d..e49b73c0d79 100644
--- a/chromium/components/feature_engagement/public/feature_list.cc
+++ b/chromium/components/feature_engagement/public/feature_list.cc
@@ -4,7 +4,6 @@
#include "components/feature_engagement/public/feature_list.h"
-#include "base/cxx17_backports.h"
#include "build/build_config.h"
#include "components/feature_engagement/public/feature_constants.h"
@@ -62,7 +61,6 @@ const base::Feature* const kAllFeatures[] = {
&kIPHFeatureNotificationGuideVoiceSearchUsedFeature,
&kIPHFeedCardMenuFeature,
&kIPHGenericAlwaysTriggerHelpUiFeature,
- &kIPHHomepagePromoCardFeature,
&kIPHIdentityDiscFeature,
&kIPHInstanceSwitcherFeature,
&kIPHKeyboardAccessoryAddressFillingFeature,
@@ -119,6 +117,7 @@ const base::Feature* const kAllFeatures[] = {
&kIPHBadgedTranslateManualTriggerFeature,
&kIPHDiscoverFeedHeaderFeature,
&kIPHDefaultSiteViewFeature,
+ &kIPHPasswordSuggestionsFeature,
#endif // BUILDFLAG(IS_IOS)
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \
BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
@@ -139,6 +138,7 @@ const base::Feature* const kAllFeatures[] = {
&kIPHProfileSwitchFeature,
&kIPHUpdatedConnectionSecurityIndicatorsFeature,
&kIPHDesktopSharedHighlightingFeature,
+ &kIPHIntentChipFeature,
#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) ||
// BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
@@ -155,7 +155,7 @@ const char kIPHDemoModeFeatureChoiceParam[] = "chosen_feature";
std::vector<const base::Feature*> GetAllFeatures() {
return std::vector<const base::Feature*>(
- kAllFeatures, kAllFeatures + base::size(kAllFeatures));
+ kAllFeatures, kAllFeatures + std::size(kAllFeatures));
}
} // namespace feature_engagement
diff --git a/chromium/components/feature_engagement/public/feature_list.h b/chromium/components/feature_engagement/public/feature_list.h
index fc2071604f8..4cf31930470 100644
--- a/chromium/components/feature_engagement/public/feature_list.h
+++ b/chromium/components/feature_engagement/public/feature_list.h
@@ -7,7 +7,6 @@
#include <vector>
-#include "base/cxx17_backports.h"
#include "base/feature_list.h"
#include "build/build_config.h"
#include "components/feature_engagement/public/feature_constants.h"
@@ -40,7 +39,7 @@ namespace {
#define VARIATION_ENTRY(base_feature) \
{ \
base_feature##Variation[0].param_value, base_feature##Variation, \
- base::size(base_feature##Variation), nullptr \
+ std::size(base_feature##Variation), nullptr \
}
// Defines a flags_ui::FeatureEntry::FeatureParam for each feature.
@@ -130,7 +129,6 @@ DEFINE_VARIATION_PARAM(kIPHFeatureNotificationGuideVoiceSearchHelpBubbleFeature,
DEFINE_VARIATION_PARAM(kIPHFeedCardMenuFeature, "IPH_FeedCardMenu");
DEFINE_VARIATION_PARAM(kIPHGenericAlwaysTriggerHelpUiFeature,
"IPH_GenericAlwaysTriggerHelpUiFeature");
-DEFINE_VARIATION_PARAM(kIPHHomepagePromoCardFeature, "IPH_HomepagePromoCard");
DEFINE_VARIATION_PARAM(kIPHIdentityDiscFeature, "IPH_IdentityDisc");
DEFINE_VARIATION_PARAM(kIPHInstanceSwitcherFeature, "IPH_InstanceSwitcher");
DEFINE_VARIATION_PARAM(kIPHKeyboardAccessoryAddressFillingFeature,
@@ -221,6 +219,8 @@ DEFINE_VARIATION_PARAM(kIPHBadgedTranslateManualTriggerFeature,
DEFINE_VARIATION_PARAM(kIPHDiscoverFeedHeaderFeature,
"IPH_DiscoverFeedHeaderMenu");
DEFINE_VARIATION_PARAM(kIPHDefaultSiteViewFeature, "IPH_DefaultSiteView");
+DEFINE_VARIATION_PARAM(kIPHPasswordSuggestionsFeature,
+ "IPH_PasswordSuggestions");
#endif // BUILDFLAG(IS_IOS)
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \
@@ -250,6 +250,7 @@ DEFINE_VARIATION_PARAM(kIPHUpdatedConnectionSecurityIndicatorsFeature,
"IPH_UpdatedConnectionSecurityIndicators");
DEFINE_VARIATION_PARAM(kIPHDesktopSharedHighlightingFeature,
"IPH_DesktopSharedHighlighting");
+DEFINE_VARIATION_PARAM(kIPHIntentChipFeature, "IPH_IntentChip");
#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) ||
// BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
@@ -304,7 +305,6 @@ constexpr flags_ui::FeatureEntry::FeatureVariation
VARIATION_ENTRY(kIPHDownloadInfoBarDownloadsAreFasterFeature),
VARIATION_ENTRY(kIPHEphemeralTabFeature),
VARIATION_ENTRY(kIPHFeedCardMenuFeature),
- VARIATION_ENTRY(kIPHHomepagePromoCardFeature),
VARIATION_ENTRY(kIPHIdentityDiscFeature),
VARIATION_ENTRY(kIPHInstanceSwitcherFeature),
VARIATION_ENTRY(kIPHKeyboardAccessoryAddressFillingFeature),
@@ -358,6 +358,7 @@ constexpr flags_ui::FeatureEntry::FeatureVariation
VARIATION_ENTRY(kIPHBadgedTranslateManualTriggerFeature),
VARIATION_ENTRY(kIPHDiscoverFeedHeaderFeature),
VARIATION_ENTRY(kIPHDefaultSiteViewFeature),
+ VARIATION_ENTRY(kIPHPasswordSuggestionsFeature),
#elif BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
VARIATION_ENTRY(kIPHDesktopTabGroupsNewGroupFeature),
@@ -378,6 +379,7 @@ constexpr flags_ui::FeatureEntry::FeatureVariation
VARIATION_ENTRY(kIPHProfileSwitchFeature),
VARIATION_ENTRY(kIPHUpdatedConnectionSecurityIndicatorsFeature),
VARIATION_ENTRY(kIPHDesktopSharedHighlightingFeature),
+ VARIATION_ENTRY(kIPHIntentChipFeature),
#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) ||
// BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)