Commit b17195f7 authored by Chris Lu's avatar Chris Lu Committed by Chromium LUCI CQ

Add Default Browser Fullscreeen promo experiment flag

Remove the now launched default browser fullscreen promo experiment
and add a new feature flag for fullscreen promo UI experimenting.

Bug: 1155778
Change-Id: Id5177c59cb02f355df5e5e806da33d5d9ee51c3d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2575902
Commit-Queue: Chris Lu <thegreenfrog@chromium.org>
Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#835801}
parent 489deba0
......@@ -815,9 +815,9 @@
"expiry_milestone": 92
},
{
"name": "default-browser-fullscreen-promo",
"name": "default-browser-fullscreen-promo-experiment",
"owners": [ "thegreenfrog", "bling-team@google.com" ],
"expiry_milestone": 89
"expiry_milestone": 91
},
{
"name": "default-browser-setting",
......
......@@ -536,10 +536,6 @@ const flags_ui::FeatureEntry kFeatureEntries[] = {
flag_descriptions::kMobileIdentityConsistencyName,
flag_descriptions::kMobileIdentityConsistencyDescription, flags_ui::kOsIos,
FEATURE_VALUE_TYPE(signin::kMobileIdentityConsistency)},
{"default-browser-fullscreen-promo",
flag_descriptions::kDefaultBrowserFullscreenPromoName,
flag_descriptions::kDefaultBrowserFullscreenPromoDescription,
flags_ui::kOsIos, FEATURE_VALUE_TYPE(kDefaultBrowserFullscreenPromo)},
{"default-browser-setting", flag_descriptions::kDefaultBrowserSettingsName,
flag_descriptions::kDefaultBrowserSettingsDescription, flags_ui::kOsIos,
FEATURE_VALUE_TYPE(kDefaultBrowserSettings)},
......@@ -589,6 +585,11 @@ const flags_ui::FeatureEntry kFeatureEntries[] = {
{"record-snapshot-size", flag_descriptions::kRecordSnapshotSizeName,
flag_descriptions::kRecordSnapshotSizeDescription, flags_ui::kOsIos,
FEATURE_VALUE_TYPE(web::features::kRecordSnapshotSize)},
{"default-browser-fullscreen-promo-experiment",
flag_descriptions::kDefaultBrowserFullscreenPromoExperimentName,
flag_descriptions::kDefaultBrowserFullscreenPromoExperimentDescription,
flags_ui::kOsIos,
FEATURE_VALUE_TYPE(kDefaultBrowserFullscreenPromoExperiment)},
};
bool SkipConditionalFeatureEntry(const flags_ui::FeatureEntry& entry) {
......
......@@ -131,12 +131,11 @@ const char kDefaultToDesktopOnIPadDescription[] =
"By default, on iPad, the desktop version of the web sites will be "
"requested";
const char kDefaultBrowserFullscreenPromoName[] =
"Fullscreen modal promo about the default browser feature";
const char kDefaultBrowserFullscreenPromoDescription[] =
"When enabled, will allow for a fullscreen modal promo to be shown to "
"users informing them about the default browser feature and providing a "
"button that takes users to Settings.app to update their default browser.";
const char kDefaultBrowserFullscreenPromoExperimentName[] =
"Default Browser Fullscreen modal experiment";
const char kDefaultBrowserFullscreenPromoExperimentDescription[] =
"When enabled, will show a modified default browser fullscreen modal promo "
"UI.";
const char kDelayThresholdMinutesToUpdateGaiaCookieName[] =
"Delay for polling (in minutes) to verify the existence of GAIA cookies.";
......
......@@ -117,12 +117,6 @@ extern const char kDefaultBrowserSettingsDescription[];
extern const char kDefaultToDesktopOnIPadName[];
extern const char kDefaultToDesktopOnIPadDescription[];
// Title and description for the flag to show a fullscreen modal promo with a
// button that would send the users in the Settings.app to update the default
// browser.
extern const char kDefaultBrowserFullscreenPromoName[];
extern const char kDefaultBrowserFullscreenPromoDescription[];
// Title and description for the flag to control the delay (in minutes) for
// polling for the existence of Gaia cookies for google.com.
extern const char kDelayThresholdMinutesToUpdateGaiaCookieName[];
......@@ -410,6 +404,12 @@ extern const char kRestoreGaiaCookiesIfDeletedDescription[];
extern const char kRecordSnapshotSizeName[];
extern const char kRecordSnapshotSizeDescription[];
// Title and description for the flag to show a modified fullscreen modal promo
// with a button that would send the users in the Settings.app to update the
// default browser.
extern const char kDefaultBrowserFullscreenPromoExperimentName[];
extern const char kDefaultBrowserFullscreenPromoExperimentDescription[];
// Please add names and descriptions above in alphabetical order.
} // namespace flag_descriptions
......
......@@ -4,13 +4,11 @@
#import "ios/chrome/browser/ui/main/default_browser_scene_agent.h"
#include "base/feature_list.h"
#include "base/ios/ios_util.h"
#include "base/version.h"
#import "ios/chrome/app/application_delegate/app_state.h"
#import "ios/chrome/browser/ui/commands/command_dispatcher.h"
#import "ios/chrome/browser/ui/commands/whats_new_commands.h"
#include "ios/chrome/browser/ui/ui_feature_flags.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
......@@ -35,38 +33,11 @@
- (void)sceneState:(SceneState*)sceneState
transitionedToActivationLevel:(SceneActivationLevel)level {
if (!base::FeatureList::IsEnabled(kDefaultBrowserFullscreenPromo)) {
// Do nothing if the Default Browser Fullscreen Promo feature flag is not
// on.
// Don't show Default Browser promo for users not on the stable 14.0.1 iOS
// version yet.
if (!base::ios::IsRunningOnOrLater(14, 0, 1)) {
return;
}
std::map<std::string, std::string> params;
if (!base::GetFieldTrialParamsByFeature(kDefaultBrowserFullscreenPromo,
&params)) {
// No FieldTrial in the Finch Config.
return;
} else {
base::Version min_os_version;
for (const auto& param : params) {
if (param.first == "min_os_version") {
min_os_version = base::Version(param.second);
}
}
if (min_os_version.components().size() != 3) {
return;
}
// Do not show fullscreen promo if the min_os_version set in the Finch
// Config is higher than the device os version. This is to protect users
// on 14.0.0 (which has the default browser reset bug) from seeing this
// promo.
std::vector<uint32_t> components = min_os_version.components();
if (!base::ios::IsRunningOnOrLater(components[0], components[1],
components[2])) {
return;
}
}
AppState* appState = self.sceneState.appState;
// Can only present UI when activation level is
// SceneActivationLevelForegroundActive. Show the UI if user has met the
......
......@@ -52,9 +52,6 @@ const base::Feature kSharedHighlightingIOS{"SharedHighlightingIOS",
const base::Feature kEnableFullPageScreenshot{
"EnableFullPageScreenshot", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kDefaultBrowserFullscreenPromo{
"DefaultBrowserFullscreenPromo", base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kDefaultBrowserSettings{"DefaultBrowserSettings",
base::FEATURE_ENABLED_BY_DEFAULT};
......@@ -68,3 +65,7 @@ const base::Feature kIncognitoAuthentication{
const base::Feature kLocationPermissionsPrompt{
"LocationPermissionsPrompt", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kDefaultBrowserFullscreenPromoExperiment{
"DefaultBrowserFullscreenPromoExperiment",
base::FEATURE_DISABLED_BY_DEFAULT};
......@@ -57,11 +57,6 @@ extern const base::Feature kSharedHighlightingIOS;
// Feature flag that enables taking fullpage screenshots of a webpage.
extern const base::Feature kEnableFullPageScreenshot;
// Feature flag that enables showing a fullscreen modal promo informing users
// about the default browser feature that also provides a button to send the
// users in the Settings.app to update the default browser.
extern const base::Feature kDefaultBrowserFullscreenPromo;
// Feature flag that enables the button in the settings to send the users in the
// Settings.app to update the default browser.
extern const base::Feature kDefaultBrowserSettings;
......@@ -76,4 +71,7 @@ extern const base::Feature kIncognitoAuthentication;
// Feature flag that experiments with new location permissions user experiences.
extern const base::Feature kLocationPermissionsPrompt;
// Feature flag that experiments with the default browser fullscreen promo UI.
extern const base::Feature kDefaultBrowserFullscreenPromoExperiment;
#endif // IOS_CHROME_BROWSER_UI_UI_FEATURE_FLAGS_H_
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