Commit 34503306 authored by Chris Lu's avatar Chris Lu Committed by Commit Bot

[ios] Add Default Browser Fullscreen Promo feature flag

This flag will be used as a killswitch for the default browser
fullscreen promo UI.

Bug: 1107489
Change-Id: I47159e1a1e1d4a8466b598d4d8236b41e942c6c6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2405892
Commit-Queue: Chris Lu <thegreenfrog@chromium.org>
Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#806359}
parent 22fb8e89
...@@ -773,6 +773,11 @@ ...@@ -773,6 +773,11 @@
"owners": [ "andrescj", "chromeos-gfx@google.com" ], "owners": [ "andrescj", "chromeos-gfx@google.com" ],
"expiry_milestone": 88 "expiry_milestone": 88
}, },
{
"name": "default-browser-fullscreen-promo",
"owners": [ "thegreenfrog", "bling-team@google.com" ],
"expiry_milestone": 89
},
{ {
"name": "delay-async-script-execution", "name": "delay-async-script-execution",
"owners": [ "dom", "chrome-loading@google.com" ], "owners": [ "dom", "chrome-loading@google.com" ],
......
...@@ -691,6 +691,10 @@ const flags_ui::FeatureEntry kFeatureEntries[] = { ...@@ -691,6 +691,10 @@ const flags_ui::FeatureEntry kFeatureEntries[] = {
flag_descriptions::kMobileIdentityConsistencyName, flag_descriptions::kMobileIdentityConsistencyName,
flag_descriptions::kMobileIdentityConsistencyDescription, flags_ui::kOsIos, flag_descriptions::kMobileIdentityConsistencyDescription, flags_ui::kOsIos,
FEATURE_VALUE_TYPE(signin::kMobileIdentityConsistency)}, FEATURE_VALUE_TYPE(signin::kMobileIdentityConsistency)},
{"default-browser-fullscreen-promo",
flag_descriptions::kDefaultBrowserFullscreenPromoName,
flag_descriptions::kDefaultBrowserFullscreenPromoDescription,
flags_ui::kOsIos, FEATURE_VALUE_TYPE(kDefaultBrowserFullscreenPromo)},
}; };
bool SkipConditionalFeatureEntry(const flags_ui::FeatureEntry& entry) { bool SkipConditionalFeatureEntry(const flags_ui::FeatureEntry& entry) {
......
...@@ -187,6 +187,13 @@ const char kDefaultToDesktopOnIPadDescription[] = ...@@ -187,6 +187,13 @@ const char kDefaultToDesktopOnIPadDescription[] =
"By default, on iPad, the desktop version of the web sites will be " "By default, on iPad, the desktop version of the web sites will be "
"requested"; "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 kDetectMainThreadFreezeName[] = "Detect freeze in the main thread."; const char kDetectMainThreadFreezeName[] = "Detect freeze in the main thread.";
const char kDetectMainThreadFreezeDescription[] = const char kDetectMainThreadFreezeDescription[] =
"A crash report will be uploaded if the main thread is frozen more than " "A crash report will be uploaded if the main thread is frozen more than "
......
...@@ -151,6 +151,12 @@ extern const char kDcheckIsFatalDescription[]; ...@@ -151,6 +151,12 @@ extern const char kDcheckIsFatalDescription[];
extern const char kDefaultToDesktopOnIPadName[]; extern const char kDefaultToDesktopOnIPadName[];
extern const char kDefaultToDesktopOnIPadDescription[]; 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 if a crash report is generated // Title and description for the flag to control if a crash report is generated
// on main thread freeze. // on main thread freeze.
extern const char kDetectMainThreadFreezeName[]; extern const char kDetectMainThreadFreezeName[];
......
...@@ -4,9 +4,11 @@ ...@@ -4,9 +4,11 @@
#import "ios/chrome/browser/ui/main/default_browser_scene_agent.h" #import "ios/chrome/browser/ui/main/default_browser_scene_agent.h"
#include "base/feature_list.h"
#import "ios/chrome/app/application_delegate/app_state.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/command_dispatcher.h"
#import "ios/chrome/browser/ui/commands/whats_new_commands.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) #if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support." #error "This file requires ARC support."
...@@ -42,6 +44,11 @@ ...@@ -42,6 +44,11 @@
- (void)sceneState:(SceneState*)sceneState - (void)sceneState:(SceneState*)sceneState
transitionedToActivationLevel:(SceneActivationLevel)level { transitionedToActivationLevel:(SceneActivationLevel)level {
if (!base::FeatureList::IsEnabled(kDefaultBrowserFullscreenPromo)) {
// Do nothing if the Default Browser Fullscreen Promo feature flag is not
// on.
return;
}
AppState* appState = self.sceneState.appState; AppState* appState = self.sceneState.appState;
// Can only present UI when activation level is // Can only present UI when activation level is
// SceneActivationLevelForegroundActive. Show the UI if user has met the // SceneActivationLevelForegroundActive. Show the UI if user has met the
......
...@@ -62,3 +62,6 @@ const base::Feature kEnableFullPageScreenshot{ ...@@ -62,3 +62,6 @@ const base::Feature kEnableFullPageScreenshot{
const base::Feature kEnableAutofillPasswordReauthIOS{ const base::Feature kEnableAutofillPasswordReauthIOS{
"EnableAutofillPasswordReauthIOS", base::FEATURE_DISABLED_BY_DEFAULT}; "EnableAutofillPasswordReauthIOS", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kDefaultBrowserFullscreenPromo{
"DefaultBrowserFullscreenPromo", base::FEATURE_DISABLED_BY_DEFAULT};
...@@ -68,4 +68,9 @@ extern const base::Feature kEnableFullPageScreenshot; ...@@ -68,4 +68,9 @@ extern const base::Feature kEnableFullPageScreenshot;
// Feature flag that enables reauth for filling passwords; // Feature flag that enables reauth for filling passwords;
extern const base::Feature kEnableAutofillPasswordReauthIOS; extern const base::Feature kEnableAutofillPasswordReauthIOS;
// 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;
#endif // IOS_CHROME_BROWSER_UI_UI_FEATURE_FLAGS_H_ #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