// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/ui/ui_features.h"

#include "base/feature_list.h"
#include "base/metrics/field_trial_params.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
#include "chrome/common/chrome_features.h"
#include "components/search/ntp_features.h"
#include "components/variations/service/variations_service.h"
#include "components/webui/flags/feature_entry.h"
#include "content/public/common/content_features.h"
#include "ui/base/ui_base_features.h"

#if !BUILDFLAG(IS_ANDROID)
namespace {

bool IsProcessOverheadExperimentActive() {
  return base::FeatureList::IsEnabled(
      features::kWebUIToolbarProcessOverheadExperiment);
}

}  // namespace
#endif  // !BUILDFLAG(IS_ANDROID)

namespace features {

// Enables the migration of browser commands to Action API.
BASE_FEATURE(kUseActionsForBrowserCommands, base::FEATURE_DISABLED_BY_DEFAULT);

// Enables the use of WGC for the Eye Dropper screen capture.
BASE_FEATURE(kAllowEyeDropperWGCScreenCapture,
#if BUILDFLAG(IS_WIN)
             base::FEATURE_ENABLED_BY_DEFAULT
#else
             base::FEATURE_DISABLED_BY_DEFAULT
#endif  // BUILDFLAG(IS_WIN)
);

BASE_FEATURE(kCompositorLoadingThrobber, base::FEATURE_DISABLED_BY_DEFAULT);


BASE_FEATURE(kCtrlTabMru, base::FEATURE_DISABLED_BY_DEFAULT);

BASE_FEATURE(kImportExportFlags, base::FEATURE_DISABLED_BY_DEFAULT);

BASE_FEATURE(kInfoBarInlineLinks, base::FEATURE_DISABLED_BY_DEFAULT);

BASE_FEATURE(kTabStripDeclutter, base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kToolbarGlowUp, base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE_PARAM(bool,
                   kToolbarGlowUpReloadEnabled,
                   &kToolbarGlowUp,
                   "reload",
                   true);
BASE_FEATURE_PARAM(bool,
                   kToolbarGlowUpBackForwardEnabled,
                   &kToolbarGlowUp,
                   "back-forward",
                   true);
BASE_FEATURE(kMenuSimplification, base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kTabGroupColorRefresh, base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kWebuiRefresh2026, base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kAppMenuGlowUp, base::FEATURE_DISABLED_BY_DEFAULT);
// Enables the redesigned Settings 2026 refresh features and search UX.
BASE_FEATURE(kSettingsRefresh2026, base::FEATURE_DISABLED_BY_DEFAULT);
// Enables search in the app Chrome menu.
BASE_FEATURE(kChroMenuSearch, base::FEATURE_DISABLED_BY_DEFAULT);

bool IsTabStripDeclutterEnabled() {
  return base::FeatureList::IsEnabled(kDesktopGlowUp) ||
         base::FeatureList::IsEnabled(kTabStripDeclutter);
}

bool IsToolbarGlowUpEnabled() {
  return base::FeatureList::IsEnabled(kDesktopGlowUp) ||
         base::FeatureList::IsEnabled(kToolbarGlowUp);
}

bool IsToolbarGlowUpReloadEnabled() {
  return IsToolbarGlowUpEnabled() && kToolbarGlowUpReloadEnabled.Get();
}

bool IsToolbarGlowUpBackForwardEnabled() {
  return IsToolbarGlowUpEnabled() && kToolbarGlowUpBackForwardEnabled.Get();
}

bool IsMenuSimplificationEnabled() {
  return base::FeatureList::IsEnabled(kDesktopGlowUp) ||
         base::FeatureList::IsEnabled(kMenuSimplification);
}

bool IsTabGroupColorRefreshEnabled() {
  return base::FeatureList::IsEnabled(kDesktopGlowUp) ||
         base::FeatureList::IsEnabled(kTabGroupColorRefresh);
}

bool IsWebuiRefresh2026Enabled() {
  return base::FeatureList::IsEnabled(kDesktopGlowUp) ||
         base::FeatureList::IsEnabled(kWebuiRefresh2026);
}

#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
BASE_FEATURE(kDseIntegrity, base::FEATURE_ENABLED_BY_DEFAULT);
// Enables the feature to remove the last confirmation dialog when relaunching
// to update Chrome.
BASE_FEATURE(kFewerUpdateConfirmations, base::FEATURE_ENABLED_BY_DEFAULT);

BASE_FEATURE(kLegacySearchIntegrityCheck, base::FEATURE_DISABLED_BY_DEFAULT);
#endif

#if BUILDFLAG(ENABLE_EXTENSIONS_CORE)

BASE_FEATURE(kExtensionsCollapseMainMenu, base::FEATURE_DISABLED_BY_DEFAULT);

// When enabled, newly installed extensions are pinned to the toolbar by
// default.
BASE_FEATURE(kExtensionsPinnedByDefault, base::FEATURE_DISABLED_BY_DEFAULT);

#endif  // BUILDFLAG(ENABLE_EXTENSIONS_CORE)

#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
// Shows an infobar on PDFs offering to become the default PDF viewer if Chrome
// isn't the default already.
BASE_FEATURE(kPdfInfoBar, base::FEATURE_ENABLED_BY_DEFAULT);

BASE_FEATURE(kSeparateDefaultAndPinPrompt,
#if BUILDFLAG(IS_WIN)
             base::FEATURE_ENABLED_BY_DEFAULT
#else
             base::FEATURE_DISABLED_BY_DEFAULT
#endif  // BUILDFLAG(IS_WIN)
);
BASE_FEATURE_PARAM(int,
                   kSeparateDefaultAndPinPromptRandSeed,
                   &kSeparateDefaultAndPinPrompt,
                   "random_seed",
                   0);
BASE_FEATURE_PARAM(int,
                   kSeparateDefaultAndPinPromptPinMaxCount,
                   &kSeparateDefaultAndPinPrompt,
                   "pin_max_count",
                   10);
BASE_FEATURE_PARAM(int,
                   kSeparateDefaultAndPinPromptPinCooldownDays,
                   &kSeparateDefaultAndPinPrompt,
                   "pin_cooldown_days",
                   7);
BASE_FEATURE_PARAM(int,
                   kSeparateDefaultAndPinPromptDefaultMaxCount,
                   &kSeparateDefaultAndPinPrompt,
                   "default_max_count",
                   5);
BASE_FEATURE_PARAM(int,
                   kSeparateDefaultAndPinPromptDefaultCooldownDays,
                   &kSeparateDefaultAndPinPrompt,
                   "default_cooldown_days",
                   21);
BASE_FEATURE_PARAM(int,
                   kSeparateDefaultAndPinPromptMessageVersion,
                   &kSeparateDefaultAndPinPrompt,
                   "message_version",
                   0);
#endif  // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)


// Preloads a WebContents with a Top Chrome WebUI on BrowserView initialization,
// so that it can be shown instantly at a later time when necessary.
BASE_FEATURE(kPreloadTopChromeWebUI, base::FEATURE_ENABLED_BY_DEFAULT);

// An experiment to reduce the number of navigations when preloading WebUIs.
BASE_FEATURE(kPreloadTopChromeWebUILessNavigations,
             base::FEATURE_DISABLED_BY_DEFAULT);

// Enables exiting browser fullscreen (users putting the browser itself into the
// fullscreen mode via the browser UI or shortcuts) with press-and-hold Esc.
BASE_FEATURE(kPressAndHoldEscToExitBrowserFullscreen,
             base::FEATURE_ENABLED_BY_DEFAULT);

#if BUILDFLAG(IS_WIN)
// Enables the UI for Process Isolation in chrome://settings/system.
BASE_FEATURE(kProcessIsolationSettings, base::FEATURE_DISABLED_BY_DEFAULT);
#endif  // BUILDFLAG(IS_WIN)

BASE_FEATURE(kRealboxVirtualFocusNavigation, base::FEATURE_DISABLED_BY_DEFAULT);


BASE_FEATURE(kSplitViewTabDraggingUpdates, base::FEATURE_ENABLED_BY_DEFAULT);
BASE_FEATURE_PARAM(base::TimeDelta,
                   kShowDropTargetForTabDelay,
                   &kSplitViewTabDraggingUpdates,
                   "show_drop_target_for_tab_delay",
                   base::Milliseconds(1000));

BASE_FEATURE(kSplitViewDragAndDropVelocity, base::FEATURE_ENABLED_BY_DEFAULT);
BASE_FEATURE_PARAM(base::TimeDelta,
                   kSplitViewDragAndDropMinDelay,
                   &kSplitViewDragAndDropVelocity,
                   "min_delay",
                   base::Milliseconds(1000));
BASE_FEATURE_PARAM(base::TimeDelta,
                   kSplitViewDragAndDropMaxDelay,
                   &kSplitViewDragAndDropVelocity,
                   "max_delay",
                   base::Milliseconds(1000));
BASE_FEATURE_PARAM(int,
                   kSplitViewDragAndDropMinDistanceThreshold,
                   &kSplitViewDragAndDropVelocity,
                   "min_distance_threshold",
                   20);
BASE_FEATURE_PARAM(int,
                   kSplitViewDragAndDropMaxDistanceThreshold,
                   &kSplitViewDragAndDropVelocity,
                   "max_distance_threshold",
                   20);

BASE_FEATURE(kTabDuplicateMetrics, base::FEATURE_ENABLED_BY_DEFAULT);

// Enables collapsing a tab group programmatically during a drag.
BASE_FEATURE(kCollapseTabGroupDuringDrag, base::FEATURE_ENABLED_BY_DEFAULT);

#if !BUILDFLAG(IS_ANDROID)
BASE_FEATURE(kNewTabButtonContextMenu, base::FEATURE_ENABLED_BY_DEFAULT);

BASE_FEATURE(kTabGroupHoverCards, base::FEATURE_ENABLED_BY_DEFAULT);

bool IsTabGroupHoverCardsEnabled() {
  return base::FeatureList::IsEnabled(kTabGroupHoverCards);
}

#endif  // !BUILDFLAG(IS_ANDROID)

// Enables preview images in tab-hover cards.
// https://crbug.com/41439486
BASE_FEATURE(kTabHoverCardImages,
#if BUILDFLAG(IS_MAC)
             base::FEATURE_DISABLED_BY_DEFAULT
#else
             base::FEATURE_ENABLED_BY_DEFAULT
#endif
);

BASE_FEATURE(kTabModalUsesDesktopWidget, base::FEATURE_DISABLED_BY_DEFAULT);

// Enables creating a web app window when tearing off a tab with a url
// controlled by a web app.
BASE_FEATURE(kTearOffWebAppTabOpensWebAppWindow,
             base::FEATURE_DISABLED_BY_DEFAULT);

#if !BUILDFLAG(IS_ANDROID)
BASE_FEATURE(kThreeButtonPasswordSaveDialog, base::FEATURE_ENABLED_BY_DEFAULT);
BASE_FEATURE(kPasswordSaveUpdateDropdownMenuExperiment,
             base::FEATURE_DISABLED_BY_DEFAULT);
#endif

BASE_FEATURE(kSidePanelFlyoverAnimation,
#if BUILDFLAG(IS_MAC)
             base::FEATURE_DISABLED_BY_DEFAULT
#else
             base::FEATURE_ENABLED_BY_DEFAULT
#endif
);

bool UseSidePanelFlyoverAnimation() {
  return base::FeatureList::IsEnabled(kSidePanelFlyoverAnimation);
}

BASE_FEATURE_PARAM(int,
                   kSidePanelFlyoverDurationMs,
                   &kSidePanelFlyoverAnimation,
                   "flyover_animation_duration_ms",
                   350);

BASE_FEATURE(kUseDefaultDeadlineWhenAnimatingBounds,
#if BUILDFLAG(IS_MAC) && defined(ARCH_CPU_ARM64)
             base::FEATURE_ENABLED_BY_DEFAULT
#else
             base::FEATURE_DISABLED_BY_DEFAULT
#endif
);

// Enables enterprise profile badging for managed profiles on the toolbar avatar
// and in the profile menu. On managed profiles, a building icon will be used as
// a badge in the profile menu.
BASE_FEATURE(kEnterpriseProfileBadgingForMenu,
             base::FEATURE_ENABLED_BY_DEFAULT);

// Enables the management notice in the NTP footer if the custom policies are
// set. This acts as a kill switch for "EnterpriseCustomLabelForBrowser" and
// "EnterpriseLogoUrlForBrowser".
BASE_FEATURE(kNTPFooterBadgingPolicies, base::FEATURE_ENABLED_BY_DEFAULT);

// Enables showing the EnterpriseCustomLabel` instead of the cloud policy
// manager in the managed disclaimer "Managed by..." in the profile and app
// menus.
BASE_FEATURE(kEnterpriseManagementDisclaimerUsesCustomLabel,
             base::FEATURE_DISABLED_BY_DEFAULT);

BASE_FEATURE(kEnterpriseReleaseNotes, base::FEATURE_DISABLED_BY_DEFAULT);

BASE_FEATURE(kManagedProfileRequiredInterstitial,
             base::FEATURE_ENABLED_BY_DEFAULT);

BASE_FEATURE(kMigrateManagementPageToWebUIOnMobile,
             base::FEATURE_ENABLED_BY_DEFAULT);


#if BUILDFLAG(IS_MAC)
BASE_FEATURE(kViewsJSAppModalDialog, base::FEATURE_DISABLED_BY_DEFAULT);
#endif

BASE_FEATURE(kPageSpecificDataDialogRelatedInstalledAppsSection,
             base::FEATURE_ENABLED_BY_DEFAULT);

BASE_FEATURE(kEnableManagementPromotionBanner,
             base::FEATURE_ENABLED_BY_DEFAULT);

BASE_FEATURE(kLensOverlayHomeworkPageActionFocusOptimization,
             base::FEATURE_DISABLED_BY_DEFAULT);

BASE_FEATURE(kPageActionAnchoredMessageEasyDismiss,
             base::FEATURE_DISABLED_BY_DEFAULT);

BASE_FEATURE(kPageActionAnchoredMessageActiveTabOnly,
             base::FEATURE_DISABLED_BY_DEFAULT);

BASE_FEATURE(kAiModePageActionOptimization, base::FEATURE_DISABLED_BY_DEFAULT);

BASE_FEATURE(kPageActionsPrioritySelector, base::FEATURE_DISABLED_BY_DEFAULT);

BASE_FEATURE(kPageActionsElevatedToolbar, base::FEATURE_DISABLED_BY_DEFAULT);

bool IsPageActionsElevatedToolbarEnabled() {
  return base::FeatureList::IsEnabled(kPageActionsElevatedToolbar);
}

BASE_FEATURE(kByDateHistoryInSidePanel, base::FEATURE_DISABLED_BY_DEFAULT);

BASE_FEATURE(kTabsFromOtherDevicesSidePanel, base::FEATURE_DISABLED_BY_DEFAULT);

BASE_FEATURE(kTabsFromOtherDevicesSidePanelPinnedByDefault,
             base::FEATURE_DISABLED_BY_DEFAULT);

BASE_FEATURE(kNonMilestoneUpdateToast, base::FEATURE_ENABLED_BY_DEFAULT);


#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
BASE_FEATURE(kSessionRestoreInfobar, base::FEATURE_DISABLED_BY_DEFAULT);

BASE_FEATURE_PARAM(bool,
                   kSetDefaultToContinueSession,
                   &kSessionRestoreInfobar,
                   "continue_session",
                   false);
#endif

#if !BUILDFLAG(IS_ANDROID)

BASE_FEATURE(kWebUIAvatarButton, base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kWebUIMediaButton, base::FEATURE_DISABLED_BY_DEFAULT);

bool IsWebUIReloadButtonEnabled() {
  return !IsProcessOverheadExperimentActive() &&
         base::FeatureList::IsEnabled(features::kInitialWebUI) &&
         (base::FeatureList::IsEnabled(features::kWebUIToolbar) ||
          base::FeatureList::IsEnabled(features::kWebUIReloadButton));
}

bool IsWebUIHomeButtonEnabled() {
  return !IsProcessOverheadExperimentActive() &&
         base::FeatureList::IsEnabled(features::kInitialWebUI) &&
         (base::FeatureList::IsEnabled(features::kWebUIToolbar) ||
          base::FeatureList::IsEnabled(features::kWebUIHomeButton));
}

bool IsWebUIBatterySaverButtonEnabled() {
  return !IsProcessOverheadExperimentActive() &&
         base::FeatureList::IsEnabled(features::kInitialWebUI) &&
         (base::FeatureList::IsEnabled(features::kWebUIToolbar) ||
          base::FeatureList::IsEnabled(features::kWebUIBatterySaverButton));
}

bool IsWebUIAppMenuButtonEnabled() {
  return !IsProcessOverheadExperimentActive() &&
         base::FeatureList::IsEnabled(features::kInitialWebUI) &&
         (base::FeatureList::IsEnabled(features::kWebUIToolbar) ||
          base::FeatureList::IsEnabled(features::kWebUIAppMenuButton));
}

bool IsWebUIBackForwardButtonEnabled() {
  return !IsProcessOverheadExperimentActive() &&
         base::FeatureList::IsEnabled(features::kInitialWebUI) &&
         (base::FeatureList::IsEnabled(features::kWebUIToolbar) ||
          base::FeatureList::IsEnabled(features::kWebUIBackForwardButton));
}

bool IsWebUIPinnedToolbarActionsEnabled() {
  return !IsProcessOverheadExperimentActive() &&
         base::FeatureList::IsEnabled(features::kInitialWebUI) &&
         (base::FeatureList::IsEnabled(features::kWebUIToolbar) ||
          base::FeatureList::IsEnabled(features::kWebUIPinnedToolbarActions));
}

bool IsWebUIExtensionsContainerEnabled() {
  return !IsProcessOverheadExperimentActive() &&
         base::FeatureList::IsEnabled(features::kInitialWebUI) &&
         (base::FeatureList::IsEnabled(features::kWebUIToolbar) ||
          base::FeatureList::IsEnabled(features::kWebUIExtensionsContainer));
}

bool IsWebUISplitTabsButtonEnabled() {
  return !IsProcessOverheadExperimentActive() &&
         base::FeatureList::IsEnabled(features::kInitialWebUI) &&
         (base::FeatureList::IsEnabled(features::kWebUIToolbar) ||
          base::FeatureList::IsEnabled(features::kWebUISplitTabsButton));
}

bool IsWebUIAvatarButtonEnabled() {
  return !IsProcessOverheadExperimentActive() &&
         base::FeatureList::IsEnabled(features::kInitialWebUI) &&
         (base::FeatureList::IsEnabled(features::kWebUIToolbar) ||
          base::FeatureList::IsEnabled(features::kWebUIAvatarButton));
}

bool IsWebUIMediaButtonEnabled() {
  return !IsProcessOverheadExperimentActive() &&
         base::FeatureList::IsEnabled(features::kInitialWebUI) &&
         (base::FeatureList::IsEnabled(features::kWebUIToolbar) ||
          base::FeatureList::IsEnabled(features::kWebUIMediaButton));
}

bool IsWebUIPerformanceInterventionButtonEnabled() {
  return !IsProcessOverheadExperimentActive() &&
         base::FeatureList::IsEnabled(features::kInitialWebUI) &&
         (base::FeatureList::IsEnabled(features::kWebUIToolbar) ||
          base::FeatureList::IsEnabled(
              features::kWebUIPerformanceInterventionButton));
}

bool IsWebUILocationBarEnabled() {
  return !IsProcessOverheadExperimentActive() &&
         base::FeatureList::IsEnabled(features::kInitialWebUI) &&
         (base::FeatureList::IsEnabled(features::kWebUIToolbar) ||
          base::FeatureList::IsEnabled(features::kWebUILocationBar));
}

bool IsWebUIToolbarEnabled() {
  // Checking IsProcessOverheadExperimentActive() and features::kInitialWebUI
  // first is a minor optimization, since all other methods return false, if the
  // first is enabled or the second is disabled.
  return !IsProcessOverheadExperimentActive() &&
         base::FeatureList::IsEnabled(features::kInitialWebUI) &&
         (IsWebUIReloadButtonEnabled() || IsWebUISplitTabsButtonEnabled() ||
          IsWebUIHomeButtonEnabled() || IsWebUILocationBarEnabled() ||
          IsWebUIBackForwardButtonEnabled() ||
          IsWebUIPinnedToolbarActionsEnabled() ||
          IsWebUIExtensionsContainerEnabled() || IsWebUIAvatarButtonEnabled() ||
          IsWebUIMediaButtonEnabled() || IsWebUIAppMenuButtonEnabled() ||
          IsWebUIBatterySaverButtonEnabled() ||
          IsWebUIPerformanceInterventionButtonEnabled());
}

bool IsWebUIToolbarFullyEnabled() {
  // The first block is an optimization, and is not needed for correctness.
  return (base::FeatureList::IsEnabled(features::kWebUIToolbar) &&
          !IsProcessOverheadExperimentActive() &&
          base::FeatureList::IsEnabled(features::kInitialWebUI)) ||
         (IsWebUIReloadButtonEnabled() && IsWebUISplitTabsButtonEnabled() &&
          IsWebUIHomeButtonEnabled() && IsWebUILocationBarEnabled() &&
          IsWebUIBackForwardButtonEnabled() &&
          IsWebUIPinnedToolbarActionsEnabled() &&
          IsWebUIExtensionsContainerEnabled() && IsWebUIAvatarButtonEnabled() &&
          IsWebUIMediaButtonEnabled() && IsWebUIAppMenuButtonEnabled() &&
          IsWebUIBatterySaverButtonEnabled() &&
          IsWebUIPerformanceInterventionButtonEnabled());
}
#endif  // !BUILDFLAG(IS_ANDROID)

#if BUILDFLAG(IS_ANDROID)
BASE_FEATURE(kAndroidAnimatedProgressBarInBrowser,
             base::FEATURE_DISABLED_BY_DEFAULT);

bool IsAndroidAnimatedProgressBarInBrowserEnabled() {
  return base::FeatureList::IsEnabled(
      features::kAndroidAnimatedProgressBarInBrowser);
}
#endif  // BUILDFLAG(IS_ANDROID)

// Note: This feature is meant for prototyping and takes shortcuts that mean it
// cannot be put into production in its current state. Do not enable.
// crbug.com/502801064
BASE_FEATURE(kAiOverlayDialog, base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE_PARAM(std::string,
                   kAiOverlayDialogApiKey,
                   &kAiOverlayDialog,
                   "api_key",
                   "");
BASE_FEATURE_PARAM(std::string,
                   kAiOverlayDialogMockJsonPath,
                   &kAiOverlayDialog,
                   "mock_json_path",
                   "");

BASE_FEATURE(kTabGroupsFocusing, base::FEATURE_DISABLED_BY_DEFAULT);

BASE_FEATURE_PARAM(bool, kTabGroupsFocusFreezing, &kTabGroupsFocusing, true);

bool IsTabGroupsFocusFreezingEnabled() {
  return base::FeatureList::IsEnabled(kTabGroupsFocusing) &&
         kTabGroupsFocusFreezing.Get();
}

BASE_FEATURE(kTabGroupRibbon, base::FEATURE_DISABLED_BY_DEFAULT);

bool IsTabGroupRibbonEnabled() {
  return base::FeatureList::IsEnabled(kTabGroupsFocusing) &&
         base::FeatureList::IsEnabled(kTabGroupRibbon);
}

BASE_FEATURE(kOmniboxResizingPrioritization, base::FEATURE_ENABLED_BY_DEFAULT);

BASE_FEATURE(kToolbarAppMenuLabelResizing, base::FEATURE_ENABLED_BY_DEFAULT);

BASE_FEATURE(kToolbarProfileChipResizing, base::FEATURE_ENABLED_BY_DEFAULT);

BASE_FEATURE(kToolbarGlicButtonResizing, base::FEATURE_ENABLED_BY_DEFAULT);

BASE_FEATURE(kOSCryptAsyncAvailabilityInfoBar,
#if BUILDFLAG(IS_MAC)
             base::FEATURE_ENABLED_BY_DEFAULT
#else
             base::FEATURE_DISABLED_BY_DEFAULT
#endif
);

// Defer layout passes on BrowserView while the main browser window is still
// invisible during early startup. Asynchronous startup components (like the
// WebUI Toolbar) trigger multiple redundant layouts via Mojo updates while
// loading, which blocks the UI thread. Deferring and consolidating these
// layouts until the window is shown saves significant CPU cycles.
BASE_FEATURE(kDeferLayoutDuringBrowserStartup,
             base::FEATURE_DISABLED_BY_DEFAULT);

}  // namespace features
