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

#ifndef CHROME_BROWSER_DEFAULT_BROWSER_DEFAULT_BROWSER_FEATURES_H_
#define CHROME_BROWSER_DEFAULT_BROWSER_DEFAULT_BROWSER_FEATURES_H_

#include <string>

#include "base/feature_list.h"
#include "base/metrics/field_trial_params.h"
#include "build/build_config.h"
#include "chrome/browser/default_browser/default_browser_setter.h"
#include "url/gurl.h"

namespace default_browser {

enum class DefaultBrowserPromptSurface {
  kInfobar = 0,
  kBubbleDialog = 1,
  kModalDialogWithSettingsIllustration = 2,
  kModalDialogWithoutSettingsIllustration = 3,
};

// Returns whether the default browser framework feature flag is enabled.
bool IsDefaultBrowserFrameworkEnabled();

// Returns whether the default browser changed os notification feature flag is
// enabled.
bool IsDefaultBrowserChangedOsNotificationEnabled();

// Returns whether the experimental default browser prompt surfaces are enabled.
bool IsDefaultBrowserPromptSurfacesEnabled();

// Returns whether the visual guided setter docking feature flag is enabled.
bool IsVisualGuidedSetterDockingEnabled();

// Returns the UI surface to use for Default Browser Prompt. Defaults to Infobar
// if the `kDefaultBrowserFramework` feature is disabled.
DefaultBrowserPromptSurface GetDefaultBrowserPromptSurface();

// Returns the type of setter to use for the Default Browser interaction. It
// will default to `kShellIntegration` when the feature is disabled.
DefaultBrowserSetterType GetDefaultBrowserSetterType();

// Returns the URL for the visual guided setter.
GURL GetDefaultBrowserVisualGuideURL();

BASE_DECLARE_FEATURE(kDefaultBrowserFramework);

// Enables the default browser prompt surfaces (e.g. invalidation, reprompt).
BASE_DECLARE_FEATURE(kDefaultBrowserPromptSurfaces);

BASE_DECLARE_FEATURE_PARAM(DefaultBrowserPromptSurface,
                           kDefaultBrowserPromptSurfaceParam);

// Enables the framework to perform additional checks when detecting default
// browser.
BASE_DECLARE_FEATURE(kPerformDefaultBrowserCheckValidations);

// Enables the framework to show Os Notification when Chrome is no longer the
// default browser.
// NOTE: This flag expect that `kDefaultBrowserFramework` is enabled first.
BASE_DECLARE_FEATURE(kDefaultBrowserChangedOsNotification);

// Enables the framework to support multiple setter. When disabled, the setter
// will default to the the `DefaultBrowserSetterType::kShellIntegration`.
BASE_DECLARE_FEATURE(kDefaultBrowserSetterSelection);

// Enables continuous docking in the visual guided setter.
BASE_DECLARE_FEATURE(kVisualGuidedSetterDocking);

// Switch linked to the flag `kDefaultBrowserSetterSelection` that help to set a
// given setter (e.g. shell_integration, visual_guide).
BASE_DECLARE_FEATURE_PARAM(DefaultBrowserSetterType,
                           kDefaultBrowserSetterParam);

#if BUILDFLAG(IS_WIN)
// Parameter for the URL used by the visual guided setter.
BASE_DECLARE_FEATURE_PARAM(std::string, kDefaultBrowserVisualGuideUrlParam);

// Parameter for the maximum amount of time we should wait for the Settings
// window.
BASE_DECLARE_FEATURE_PARAM(base::TimeDelta, kFindSettingsTimeout);
#endif

}  // namespace default_browser

#endif  // CHROME_BROWSER_DEFAULT_BROWSER_DEFAULT_BROWSER_FEATURES_H_
