Update ui_features.cc

This commit is contained in:
Alexander David Frick 2022-10-14 20:14:45 -05:00 committed by GitHub
parent b9fd67e3f3
commit 70ce75d7e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,4 @@
// Copyright 2022 The Chromium Authors and Alex313031.
// Copyright 2022 The Chromium Authors and Alex313031
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -13,119 +13,132 @@ namespace features {
// Enables the tab dragging fallback when full window dragging is not supported
// by the platform (e.g. Wayland). See https://crbug.com/896640
const base::Feature kAllowWindowDragUsingSystemDragDrop{
"AllowWindowDragUsingSystemDragDrop", base::FEATURE_ENABLED_BY_DEFAULT};
BASE_FEATURE(kAllowWindowDragUsingSystemDragDrop,
"AllowWindowDragUsingSystemDragDrop",
base::FEATURE_ENABLED_BY_DEFAULT);
#if !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_ANDROID)
const base::Feature kDesktopPWAsAppHomePage{"DesktopPWAsAppHomePage",
base::FEATURE_DISABLED_BY_DEFAULT};
BASE_FEATURE(kDesktopPWAsAppHomePage,
"DesktopPWAsAppHomePage",
base::FEATURE_DISABLED_BY_DEFAULT);
#endif // !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_ANDROID)
// Enables Chrome Labs menu in the toolbar. See https://crbug.com/1145666
const base::Feature kChromeLabs{"ChromeLabs",
base::FEATURE_ENABLED_BY_DEFAULT};
BASE_FEATURE(kChromeLabs, "ChromeLabs", base::FEATURE_ENABLED_BY_DEFAULT);
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
// Enables "Tips for Chrome" in Main Chrome Menu | Help.
const base::Feature kChromeTipsInMainMenu{"ChromeTipsInMainMenu",
base::FEATURE_DISABLED_BY_DEFAULT};
BASE_FEATURE(kChromeTipsInMainMenu,
"ChromeTipsInMainMenu",
base::FEATURE_DISABLED_BY_DEFAULT);
// Enables "Tips for Chrome" in Main Chrome Menu | Help.
const base::Feature kChromeTipsInMainMenuNewBadge{
"ChromeTipsInMainMenuNewBadge", base::FEATURE_DISABLED_BY_DEFAULT};
BASE_FEATURE(kChromeTipsInMainMenuNewBadge,
"ChromeTipsInMainMenuNewBadge",
base::FEATURE_DISABLED_BY_DEFAULT);
#endif
// Enables "Chrome What's New" UI.
const base::Feature kChromeWhatsNewUI {
"ChromeWhatsNewUI",
BASE_FEATURE(kChromeWhatsNewUI,
"ChromeWhatsNewUI",
#if BUILDFLAG(GOOGLE_CHROME_BRANDING) && !defined(ANDROID) && \
!BUILDFLAG(IS_CHROMEOS_LACROS) && !BUILDFLAG(IS_CHROMEOS_ASH)
base::FEATURE_ENABLED_BY_DEFAULT
base::FEATURE_ENABLED_BY_DEFAULT
#else
base::FEATURE_DISABLED_BY_DEFAULT
base::FEATURE_DISABLED_BY_DEFAULT
#endif
};
);
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
// Enables "new" badge for "Chrome What's New" in Main Chrome Menu | Help.
const base::Feature kChromeWhatsNewInMainMenuNewBadge{
"ChromeWhatsNewInMainMenuNewBadge", base::FEATURE_DISABLED_BY_DEFAULT};
BASE_FEATURE(kChromeWhatsNewInMainMenuNewBadge,
"ChromeWhatsNewInMainMenuNewBadge",
base::FEATURE_DISABLED_BY_DEFAULT);
#endif
#if !defined(ANDROID)
// Enables "Access Code Cast" UI.
const base::Feature kAccessCodeCastUI{"AccessCodeCastUI",
base::FEATURE_ENABLED_BY_DEFAULT};
BASE_FEATURE(kAccessCodeCastUI,
"AccessCodeCastUI",
base::FEATURE_ENABLED_BY_DEFAULT);
#endif
// Enables displaying the submenu to open a link with a different profile
// even if there is no other profile opened in a separate window
const base::Feature kDisplayOpenLinkAsProfile{
"DisplayOpenLinkAsProfile", base::FEATURE_ENABLED_BY_DEFAULT};
BASE_FEATURE(kDisplayOpenLinkAsProfile,
"DisplayOpenLinkAsProfile",
base::FEATURE_ENABLED_BY_DEFAULT);
// Enables showing the EV certificate details in the Page Info bubble.
const base::Feature kEvDetailsInPageInfo{"EvDetailsInPageInfo",
base::FEATURE_ENABLED_BY_DEFAULT};
BASE_FEATURE(kEvDetailsInPageInfo,
"EvDetailsInPageInfo",
base::FEATURE_ENABLED_BY_DEFAULT);
#if BUILDFLAG(ENABLE_EXTENSIONS)
// Controls whether we use a different UX for simple extensions overriding
// settings.
const base::Feature kLightweightExtensionOverrideConfirmations{
"LightweightExtensionOverrideConfirmations",
base::FEATURE_ENABLED_BY_DEFAULT};
BASE_FEATURE(kLightweightExtensionOverrideConfirmations,
"LightweightExtensionOverrideConfirmations",
base::FEATURE_ENABLED_BY_DEFAULT);
#endif
// Enables the reauth flow for authenticated profiles with invalid credentials
// when the force sign-in policy is enabled.
const base::Feature kForceSignInReauth{"ForceSignInReauth",
base::FEATURE_ENABLED_BY_DEFAULT};
// Enables Bookmarks++ Side Panel UI.
BASE_FEATURE(kPowerBookmarksSidePanel,
"PowerBookmarksSidePanel",
base::FEATURE_ENABLED_BY_DEFAULT);
// Enables a more prominent active tab title in dark mode to aid with
// accessibility.
const base::Feature kProminentDarkModeActiveTabTitle{
"ProminentDarkModeActiveTabTitle", base::FEATURE_ENABLED_BY_DEFAULT};
BASE_FEATURE(kProminentDarkModeActiveTabTitle,
"ProminentDarkModeActiveTabTitle",
base::FEATURE_ENABLED_BY_DEFAULT);
// Enables the QuickCommands UI surface. See https://crbug.com/1014639
const base::Feature kQuickCommands{"QuickCommands",
base::FEATURE_ENABLED_BY_DEFAULT};
BASE_FEATURE(kQuickCommands,
"QuickCommands",
base::FEATURE_ENABLED_BY_DEFAULT);
// Enables the side search feature for Google Search. Presents recent Google
// search results in a browser side panel.
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Enable by default as the ChromeOS iteration of Side Search has launched (See
// crbug.com/1242730).
const base::Feature kSideSearch{"SideSearch", base::FEATURE_ENABLED_BY_DEFAULT};
BASE_FEATURE(kSideSearch, "SideSearch", base::FEATURE_ENABLED_BY_DEFAULT);
#else
// Disable by default on remaining desktop platforms until desktop UX has
// launched (See crbug.com/1279696).
const base::Feature kSideSearch{"SideSearch",
base::FEATURE_ENABLED_BY_DEFAULT};
BASE_FEATURE(kSideSearch, "SideSearch", base::FEATURE_ENABLED_BY_DEFAULT);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
const base::Feature kSideSearchFeedback{"SideSearchFeedback",
base::FEATURE_ENABLED_BY_DEFAULT};
BASE_FEATURE(kSideSearchFeedback,
"SideSearchFeedback",
base::FEATURE_ENABLED_BY_DEFAULT);
// Controls whether the Side Search feature is configured to support any
// participating Chrome search engine. This should always be enabled with
// kSideSearch on non-ChromeOS platforms.
const base::Feature kSideSearchDSESupport{"SideSearchDSESupport",
base::FEATURE_ENABLED_BY_DEFAULT};
BASE_FEATURE(kSideSearchDSESupport,
"SideSearchDSESupport",
base::FEATURE_ENABLED_BY_DEFAULT);
// Displays right-click search results of a highlighted text in side panel,
// So users are not forced to switch to a new tab to view the search results
const base::Feature kSearchWebInSidePanel{"SearchWebInSidePanel",
base::FEATURE_ENABLED_BY_DEFAULT};
BASE_FEATURE(kSearchWebInSidePanel,
"SearchWebInSidePanel",
base::FEATURE_DISABLED_BY_DEFAULT);
// Whether to clobber all side search side panels in the current browser window
// or only the side search in the current tab before read later or lens side
// panel is open.
const base::Feature kClobberAllSideSearchSidePanels{
"ClobberAllSideSearchSidePanels", base::FEATURE_ENABLED_BY_DEFAULT};
BASE_FEATURE(kClobberAllSideSearchSidePanels,
"ClobberAllSideSearchSidePanels",
base::FEATURE_ENABLED_BY_DEFAULT);
// Feature that controls whether or not feature engagement configurations can be
// used to control automatic triggering for side search.
const base::Feature kSideSearchAutoTriggering{"SideSearchAutoTriggering",
base::FEATURE_ENABLED_BY_DEFAULT};
BASE_FEATURE(kSideSearchAutoTriggering,
"SideSearchAutoTriggering",
base::FEATURE_ENABLED_BY_DEFAULT);
// Feature param that determines how many times a user has to return to a given
// SRP before we automatically trigger the side search side panel for that SRP
@ -136,51 +149,62 @@ const base::FeatureParam<int> kSideSearchAutoTriggeringReturnCount{
// Adds improved support for handling multiple contextual and global RHS browser
// side panels. Designed specifically to handle the interim state before the v2
// side panel project launches.
const base::Feature kSidePanelImprovedClobbering{
"SidePanelImprovedClobbering", base::FEATURE_DISABLED_BY_DEFAULT};
BASE_FEATURE(kSidePanelImprovedClobbering,
"SidePanelImprovedClobbering",
base::FEATURE_ENABLED_BY_DEFAULT);
const base::Feature kSidePanelWebView{"SidePanelWebView",
base::FEATURE_ENABLED_BY_DEFAULT};
BASE_FEATURE(kSidePanelWebView,
"SidePanelWebView",
base::FEATURE_ENABLED_BY_DEFAULT);
const base::Feature kSidePanelJourneys{"SidePanelJourneys",
base::FEATURE_ENABLED_BY_DEFAULT};
BASE_FEATURE(kSidePanelJourneys,
"SidePanelJourneys",
base::FEATURE_ENABLED_BY_DEFAULT);
// If enabled, and the main flag is also enabled, the Journeys omnibox
// entrypoints open Journeys in Side Panel rather than the History WebUI.
const base::FeatureParam<bool> kSidePanelJourneysOpensFromOmnibox{
&kSidePanelJourneys, "SidePanelJourneysOpensFromOmnibox", false};
BASE_FEATURE(kSidePanelJourneysQueryless,
"SidePanelJourneysQueryless",
base::FEATURE_DISABLED_BY_DEFAULT);
// Enables tabs to scroll in the tabstrip. https://crbug.com/951078
const base::Feature kScrollableTabStrip{"ScrollableTabStrip",
base::FEATURE_DISABLED_BY_DEFAULT};
BASE_FEATURE(kScrollableTabStrip,
"ScrollableTabStrip",
base::FEATURE_DISABLED_BY_DEFAULT);
const char kMinimumTabWidthFeatureParameterName[] = "minTabWidth";
// Splits pinned and unpinned tabs into separate TabStrips.
// https://crbug.com/1346019
const base::Feature kSplitTabStrip("SplitTabStrip",
base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kSplitTabStrip,
"SplitTabStrip",
base::FEATURE_DISABLED_BY_DEFAULT);
// Directly controls the "new" badge (as opposed to old "master switch"; see
// https://crbug.com/1169907 for master switch deprecation and
// https://crbug.com/968587 for the feature itself)
// https://crbug.com/1173792
const base::Feature kTabGroupsNewBadgePromo{"TabGroupsNewBadgePromo",
base::FEATURE_DISABLED_BY_DEFAULT};
BASE_FEATURE(kTabGroupsNewBadgePromo,
"TabGroupsNewBadgePromo",
base::FEATURE_DISABLED_BY_DEFAULT);
// Enables users to explicitly save and recall tab groups.
// https://crbug.com/1223929
const base::Feature kTabGroupsSave{"TabGroupsSave",
base::FEATURE_ENABLED_BY_DEFAULT};
BASE_FEATURE(kTabGroupsSave,
"TabGroupsSave",
base::FEATURE_ENABLED_BY_DEFAULT);
// Enables preview images in tab-hover cards.
// https://crbug.com/928954
const base::Feature kTabHoverCardImages {
"TabHoverCardImages",
BASE_FEATURE(kTabHoverCardImages,
"TabHoverCardImages",
#if BUILDFLAG(IS_MAC)
base::FEATURE_DISABLED_BY_DEFAULT
base::FEATURE_DISABLED_BY_DEFAULT
#else
base::FEATURE_ENABLED_BY_DEFAULT
base::FEATURE_ENABLED_BY_DEFAULT
#endif
};
);
const char kTabHoverCardImagesNotReadyDelayParameterName[] =
"page_not_ready_delay";
@ -194,19 +218,23 @@ const char kTabHoverCardAdditionalMaxWidthDelay[] =
const char kTabHoverCardAlternateFormat[] = "alternate_format";
// Enables tab outlines in additional situations for accessibility.
const base::Feature kTabOutlinesInLowContrastThemes{
"TabOutlinesInLowContrastThemes", base::FEATURE_ENABLED_BY_DEFAULT};
BASE_FEATURE(kTabOutlinesInLowContrastThemes,
"TabOutlinesInLowContrastThemes",
base::FEATURE_ENABLED_BY_DEFAULT);
const base::Feature kTabSearchChevronIcon{"TabSearchChevronIcon",
base::FEATURE_ENABLED_BY_DEFAULT};
BASE_FEATURE(kTabSearchChevronIcon,
"TabSearchChevronIcon",
base::FEATURE_ENABLED_BY_DEFAULT);
// Enables the tab search submit feedback button.
const base::Feature kTabSearchFeedback{"TabSearchFeedback",
base::FEATURE_DISABLED_BY_DEFAULT};
BASE_FEATURE(kTabSearchFeedback,
"TabSearchFeedback",
base::FEATURE_DISABLED_BY_DEFAULT);
// Controls whether or not to use fuzzy search for tab search.
const base::Feature kTabSearchFuzzySearch{"TabSearchFuzzySearch",
base::FEATURE_DISABLED_BY_DEFAULT};
BASE_FEATURE(kTabSearchFuzzySearch,
"TabSearchFuzzySearch",
base::FEATURE_DISABLED_BY_DEFAULT);
const char kTabSearchSearchThresholdName[] = "TabSearchSearchThreshold";
@ -237,8 +265,9 @@ const base::FeatureParam<bool> kTabSearchMoveActiveTabToBottom{
&kTabSearchFuzzySearch, "TabSearchMoveActiveTabToBottom", true};
// Controls feature parameters for Tab Search's `Recently Closed` entries.
const base::Feature kTabSearchRecentlyClosed{"TabSearchRecentlyClosed",
base::FEATURE_ENABLED_BY_DEFAULT};
BASE_FEATURE(kTabSearchRecentlyClosed,
"TabSearchRecentlyClosed",
base::FEATURE_ENABLED_BY_DEFAULT);
const base::FeatureParam<int> kTabSearchRecentlyClosedDefaultItemDisplayCount{
&kTabSearchRecentlyClosed, "TabSearchRecentlyClosedDefaultItemDisplayCount",
@ -247,60 +276,66 @@ const base::FeatureParam<int> kTabSearchRecentlyClosedDefaultItemDisplayCount{
const base::FeatureParam<int> kTabSearchRecentlyClosedTabCountThreshold{
&kTabSearchRecentlyClosed, "TabSearchRecentlyClosedTabCountThreshold", 100};
const base::Feature kTabSearchUseMetricsReporter{
"TabSearchUseMetricsReporter", base::FEATURE_DISABLED_BY_DEFAULT};
BASE_FEATURE(kTabSearchUseMetricsReporter,
"TabSearchUseMetricsReporter",
base::FEATURE_DISABLED_BY_DEFAULT);
const base::Feature kToolbarUseHardwareBitmapDraw{
"ToolbarUseHardwareBitmapDraw", base::FEATURE_DISABLED_BY_DEFAULT};
BASE_FEATURE(kToolbarUseHardwareBitmapDraw,
"ToolbarUseHardwareBitmapDraw",
base::FEATURE_DISABLED_BY_DEFAULT);
// Controls whether top chrome pages will use the spare renderer if no top
// chrome renderers are present.
const base::Feature kTopChromeWebUIUsesSpareRenderer{
"TopChromeWebUIUsesSpareRenderer", base::FEATURE_DISABLED_BY_DEFAULT};
BASE_FEATURE(kTopChromeWebUIUsesSpareRenderer,
"TopChromeWebUIUsesSpareRenderer",
base::FEATURE_DISABLED_BY_DEFAULT);
const base::Feature kUnifiedSidePanel{"UnifiedSidePanel",
base::FEATURE_DISABLED_BY_DEFAULT};
BASE_FEATURE(kUnifiedSidePanel,
"UnifiedSidePanel",
base::FEATURE_DISABLED_BY_DEFAULT);
// This enables enables persistence of a WebContents in a 1-to-1 association
// with the current Profile for WebUI bubbles. See https://crbug.com/1177048.
const base::Feature kWebUIBubblePerProfilePersistence{
"WebUIBubblePerProfilePersistence", base::FEATURE_DISABLED_BY_DEFAULT};
BASE_FEATURE(kWebUIBubblePerProfilePersistence,
"WebUIBubblePerProfilePersistence",
base::FEATURE_DISABLED_BY_DEFAULT);
// Enables a web-based tab strip. See https://crbug.com/989131. Note this
// feature only works when the ENABLE_WEBUI_TAB_STRIP buildflag is enabled.
const base::Feature kWebUITabStrip {
"WebUITabStrip",
BASE_FEATURE(kWebUITabStrip,
"WebUITabStrip",
#if BUILDFLAG(IS_CHROMEOS)
base::FEATURE_ENABLED_BY_DEFAULT
};
base::FEATURE_ENABLED_BY_DEFAULT
#else
base::FEATURE_ENABLED_BY_DEFAULT
};
base::FEATURE_ENABLED_BY_DEFAULT
#endif
);
// The default value of this flag is aligned with platform behavior to handle
// context menu with touch.
// TODO(crbug.com/1257626): Enable this flag for all platforms after launch.
const base::Feature kWebUITabStripContextMenuAfterTap {
"WebUITabStripContextMenuAfterTap",
BASE_FEATURE(kWebUITabStripContextMenuAfterTap,
"WebUITabStripContextMenuAfterTap",
#if BUILDFLAG(IS_CHROMEOS_ASH)
base::FEATURE_DISABLED_BY_DEFAULT
base::FEATURE_DISABLED_BY_DEFAULT
#else
base::FEATURE_ENABLED_BY_DEFAULT
base::FEATURE_ENABLED_BY_DEFAULT
#endif
};
);
#if BUILDFLAG(IS_CHROMEOS)
const base::Feature kChromeOSTabSearchCaptionButton{
"ChromeOSTabSearchCaptionButton", base::FEATURE_ENABLED_BY_DEFAULT};
BASE_FEATURE(kChromeOSTabSearchCaptionButton,
"ChromeOSTabSearchCaptionButton",
base::FEATURE_ENABLED_BY_DEFAULT);
#endif
#if BUILDFLAG(IS_MAC)
// Enabled an experiment which increases the prominence to grant MacOS system
// location permission to Chrome when location permissions have already been
// approved. https://crbug.com/1211052
const base::Feature kLocationPermissionsExperiment{
"LocationPermissionsExperiment", base::FEATURE_DISABLED_BY_DEFAULT};
BASE_FEATURE(kLocationPermissionsExperiment,
"LocationPermissionsExperiment",
base::FEATURE_DISABLED_BY_DEFAULT);
constexpr base::FeatureParam<int>
kLocationPermissionsExperimentBubblePromptLimit{
&kLocationPermissionsExperiment, "bubble_prompt_count", 3};
@ -308,14 +343,17 @@ constexpr base::FeatureParam<int>
kLocationPermissionsExperimentLabelPromptLimit{
&kLocationPermissionsExperiment, "label_prompt_count", 5};
const base::Feature kViewsFirstRunDialog{"ViewsFirstRunDialog",
base::FEATURE_DISABLED_BY_DEFAULT};
BASE_FEATURE(kViewsFirstRunDialog,
"ViewsFirstRunDialog",
base::FEATURE_DISABLED_BY_DEFAULT);
const base::Feature kViewsTaskManager{"ViewsTaskManager",
base::FEATURE_DISABLED_BY_DEFAULT};
BASE_FEATURE(kViewsTaskManager,
"ViewsTaskManager",
base::FEATURE_DISABLED_BY_DEFAULT);
const base::Feature kViewsJSAppModalDialog{"ViewsJSAppModalDialog",
base::FEATURE_DISABLED_BY_DEFAULT};
BASE_FEATURE(kViewsJSAppModalDialog,
"ViewsJSAppModalDialog",
base::FEATURE_DISABLED_BY_DEFAULT);
int GetLocationPermissionsExperimentBubblePromptLimit() {
return kLocationPermissionsExperimentBubblePromptLimit.Get();
@ -329,9 +367,15 @@ int GetLocationPermissionsExperimentLabelPromptLimit() {
// Moves the Tab Search button into the browser frame's caption button area on
// Windows 10 (crbug.com/1223847).
const base::Feature kWin10TabSearchCaptionButton{
"Win10TabSearchCaptionButton", base::FEATURE_ENABLED_BY_DEFAULT};
BASE_FEATURE(kWin10TabSearchCaptionButton,
"Win10TabSearchCaptionButton",
base::FEATURE_ENABLED_BY_DEFAULT);
#endif
// Reduce resource usage when view is hidden by not rendering loading animation.
BASE_FEATURE(kStopLoadingAnimationForHiddenWindow,
"StopLoadingAnimationForHiddenWindow",
base::FEATURE_ENABLED_BY_DEFAULT);
} // namespace features