Skip to content

Commit

Permalink
Add kAppInstallServiceUri feature flag to ChromeOS
Browse files Browse the repository at this point in the history
Bug: b/304680106
Change-Id: If7002cbe6c9c44938f965442af41e5d9c42d503c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4929534
Reviewed-by: Tim Sergeant <tsergeant@chromium.org>
Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
Commit-Queue: Alan Cutter <alancutter@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1211276}
  • Loading branch information
alancutter authored and Chromium LUCI CQ committed Oct 18, 2023
1 parent f0e37b8 commit ef4dbb8
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 8 deletions.
6 changes: 6 additions & 0 deletions chrome/browser/about_flags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10991,6 +10991,12 @@ const FeatureEntry kFeatureEntries[] = {
kUnifiedPasswordManagerLocalPasswordsAndroidNoMigration)},
#endif // BUILDFLAG(IS_ANDROID)

#if BUILDFLAG(IS_CHROMEOS_ASH)
{"app-install-service-uri", flag_descriptions::kAppInstallServiceUriName,
flag_descriptions::kAppInstallServiceUriDescription, kOsCrOS,
FEATURE_VALUE_TYPE(chromeos::features::kAppInstallServiceUri)},
#endif // BUILDFLAG(IS_CHROMEOS_ASH)

// NOTE: Adding a new flag requires adding a corresponding entry to enum
// "LoginCustomFlags" in tools/metrics/histograms/enums.xml. See "Flag
// Histograms" in tools/metrics/histograms/README.md (run the
Expand Down
3 changes: 3 additions & 0 deletions chrome/browser/ash/crosapi/crosapi_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,9 @@ void InjectBrowserInitParams(

params->is_cros_battery_saver_available =
ash::features::IsBatterySaverAvailable();

params->is_app_install_service_uri_enabled =
chromeos::features::IsAppInstallServiceUriEnabled();
}

template <typename BrowserParams>
Expand Down
5 changes: 5 additions & 0 deletions chrome/browser/flag-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@
"owners": [ "tsergeant", "chromeos-apps-foundation-team@google.com" ],
"expiry_milestone": 125
},
{
"name": "app-install-service-uri",
"owners": [ "tsergeant", "chromeos-apps-foundation-team@google.com" ],
"expiry_milestone": 125
},
{
"name": "app-launch-automation",
"owners": [ "dandersson", "janetmac" ],
Expand Down
4 changes: 4 additions & 0 deletions chrome/browser/flag_descriptions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5354,6 +5354,10 @@ const char kApnRevampDescription[] =
"Enables the ChromeOS APN Revamp, which updates cellular network APN "
"system UI and related infrastructure.";

const char kAppInstallServiceUriName[] = "Enable app install service URI";
const char kAppInstallServiceUriDescription[] =
"Allows app installs to be invoked from a specific URI.";

const char kAppLaunchAutomationName[] = "Enable app launch automation";
const char kAppLaunchAutomationDescription[] =
"Allows groups of apps to be launched.";
Expand Down
3 changes: 3 additions & 0 deletions chrome/browser/flag_descriptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -3098,6 +3098,9 @@ extern const char kAmbientModeThrottleAnimationDescription[];
extern const char kApnRevampName[];
extern const char kApnRevampDescription[];

extern const char kAppInstallServiceUriName[];
extern const char kAppInstallServiceUriDescription[];

extern const char kAppLaunchAutomationName[];
extern const char kAppLaunchAutomationDescription[];

Expand Down
27 changes: 21 additions & 6 deletions chromeos/constants/chromeos_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@

namespace chromeos::features {

#if BUILDFLAG(IS_CHROMEOS_ASH)
// Enables triggering app installs from a specific URI.
BASE_FEATURE(kAppInstallServiceUri,
"AppInstallServiceUri",
base::FEATURE_ENABLED_BY_DEFAULT);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)

// Enables or disables more filtering out of phones from the Bluetooth UI.
BASE_FEATURE(kBluetoothPhoneFilter,
"BluetoothPhoneFilter",
Expand Down Expand Up @@ -122,6 +129,20 @@ BASE_FEATURE(kUploadOfficeToCloudForEnterprise,
"UploadOfficeToCloudForEnterprise",
base::FEATURE_DISABLED_BY_DEFAULT);

BASE_FEATURE(kRoundedWindows,
"RoundedWindows",
base::FEATURE_DISABLED_BY_DEFAULT);

const char kRoundedWindowsRadius[] = "window_radius";

bool IsAppInstallServiceUriEnabled() {
#if BUILDFLAG(IS_CHROMEOS_LACROS)
return chromeos::BrowserParamsProxy::Get()->IsAppInstallServiceUriEnabled();
#else
return base::FeatureList::IsEnabled(kAppInstallServiceUri);
#endif
}

bool IsClipboardHistoryRefreshEnabled() {
#if BUILDFLAG(IS_CHROMEOS_LACROS)
return chromeos::BrowserParamsProxy::Get()->EnableClipboardHistoryRefresh();
Expand All @@ -131,12 +152,6 @@ bool IsClipboardHistoryRefreshEnabled() {
#endif
}

BASE_FEATURE(kRoundedWindows,
"RoundedWindows",
base::FEATURE_DISABLED_BY_DEFAULT);

const char kRoundedWindowsRadius[] = "window_radius";

bool IsCloudGamingDeviceEnabled() {
#if BUILDFLAG(IS_CHROMEOS_LACROS)
return chromeos::BrowserParamsProxy::Get()->IsCloudGamingDevice();
Expand Down
6 changes: 6 additions & 0 deletions chromeos/constants/chromeos_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ namespace features {
// alongside the definition of their values in the .cc file. If a feature is
// being rolled out via Finch, add a comment in the .cc file.

#if BUILDFLAG(IS_CHROMEOS_ASH)
COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
BASE_DECLARE_FEATURE(kAppInstallServiceUri);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
BASE_DECLARE_FEATURE(kBluetoothPhoneFilter);
COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
Expand Down Expand Up @@ -57,6 +61,8 @@ COMPONENT_EXPORT(CHROMEOS_CONSTANTS) BASE_DECLARE_FEATURE(kRoundedWindows);

// Keep alphabetized.

COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
bool IsAppInstallServiceUriEnabled();
COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
bool IsClipboardHistoryRefreshEnabled();
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) bool IsCloudGamingDeviceEnabled();
Expand Down
8 changes: 6 additions & 2 deletions chromeos/crosapi/mojom/crosapi.mojom
Original file line number Diff line number Diff line change
Expand Up @@ -1039,8 +1039,8 @@ enum OpenUrlFrom {
// parameters here. If a new parameter is added and its value is only known
// after the user has logged in, please update BrowserPostLoginParams as well.
//
// Next version: 70
// Next id: 70
// Next version: 71
// Next id: 71
[Stable, RenamedFrom="crosapi.mojom.LacrosInitParams"]
struct BrowserInitParams {
// This is ash-chrome's version of the Crosapi interface. This is used by
Expand Down Expand Up @@ -1465,6 +1465,10 @@ struct BrowserInitParams {
// unavailable.
[MinVersion=69]
bool is_floss_availability_check_needed@69;

// Tells lacros whether the app install service URI is enabled.
[MinVersion=70]
bool is_app_install_service_uri_enabled@70;
};

// BrowserPostLoginParams is the subset of parameters in BrowserInitParams
Expand Down
4 changes: 4 additions & 0 deletions chromeos/startup/browser_params_proxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -339,4 +339,8 @@ bool BrowserParamsProxy::IsCrosBatterySaverAvailable() const {
return BrowserInitParams::Get()->is_cros_battery_saver_available;
}

bool BrowserParamsProxy::IsAppInstallServiceUriEnabled() const {
return BrowserInitParams::Get()->is_app_install_service_uri_enabled;
}

} // namespace chromeos
2 changes: 2 additions & 0 deletions chromeos/startup/browser_params_proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ class COMPONENT_EXPORT(CHROMEOS_STARTUP) BrowserParamsProxy {

bool IsCrosBatterySaverAvailable() const;

bool IsAppInstallServiceUriEnabled() const;

private:
friend base::NoDestructor<BrowserParamsProxy>;

Expand Down
2 changes: 2 additions & 0 deletions tools/metrics/histograms/enums.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65088,6 +65088,7 @@ from previous Chrome versions.
<int value="-102537270" label="extension-content-verification"/>
<int value="-102387656" label="FillingAcrossAffiliatedWebsites:disabled"/>
<int value="-102227288" label="PasswordExport:disabled"/>
<int value="-102008534" label="AppInstallServiceUri:disabled"/>
<int value="-100702864" label="PageInfoAboutThisSite:disabled"/>
<int value="-100148609" label="EvDetailsInPageInfo:disabled"/>
<int value="-99781021" label="disable-roboto-font-ui"/>
Expand Down Expand Up @@ -69433,6 +69434,7 @@ from previous Chrome versions.
<int value="1997347809" label="FedCmIdPregistration:enabled"/>
<int value="1997457877" label="RemotePageMetadata:disabled"/>
<int value="1997931863" label="OmniboxContextMenuShowFullUrls:enabled"/>
<int value="1998126494" label="AppInstallServiceUri:enabled"/>
<int value="1998568354" label="DocumentPictureInPictureAPI:enabled"/>
<int value="1998917160" label="AppServiceAdaptiveIcon:enabled"/>
<int value="2000091128" label="enable-touch-hover"/>
Expand Down

0 comments on commit ef4dbb8

Please sign in to comment.