chromium/chrome/browser/web_applications/preinstalled_app_install_features.cc

// Copyright 2020 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/web_applications/preinstalled_app_install_features.h"

#include <string>
#include <string_view>

#include "base/feature_list.h"
#include "base/memory/raw_ref.h"
#include "build/build_config.h"

#if BUILDFLAG(IS_CHROMEOS)
#include "chrome/browser/enterprise/browser_management/management_service_factory.h"
#include "chromeos/constants/chromeos_features.h"
#include "components/policy/core/common/management/management_service.h"
#endif  // BUILDFLAG(IS_CHROMEOS)

namespace web_app {

namespace {

constexpr const std::string_view kShippedPreinstalledAppInstallFeatures[] =;

bool g_always_enabled_for_testing =;

struct FeatureWithEnabledFunction {};

// A hard coded list of features available for externally installed apps to
// gate their installation on via their config file settings. Each feature has a
// function to run to determine whether it is enabled. See |kFeatureName| in
// preinstalled_web_app_utils.h.
//
// After a feature flag has been shipped and should be cleaned up, move it into
// kShippedPreinstalledAppInstallFeatures to ensure any external installation
// configs that reference it continue to see it as enabled.
constexpr const FeatureWithEnabledFunction
    kPreinstalledAppInstallFeaturesWithEnabledFunctions[] =;

}  // namespace

#if BUILDFLAG(IS_CHROMEOS)
// Use `IsPreinstalledDocsSheetsSlidesDriveStandaloneTabbed` instead of checking
// this flag directly to correctly exclude managed devices.
BASE_FEATURE(kDocsSheetsSlidesDrivePreinstallStandaloneTabbed,
             "DocsSheetsSlidesDrivePreinstallStandaloneTabbed",
             base::FEATURE_DISABLED_BY_DEFAULT);
#endif  // BUILDFLAG(IS_CHROMEOS)

bool IsPreinstalledDocsSheetsSlidesDriveStandaloneTabbed(Profile& profile) {}

bool IsPreinstalledAppInstallFeatureEnabled(std::string_view feature_name,
                                            const Profile& profile) {}

base::AutoReset<bool>
SetPreinstalledAppInstallFeatureAlwaysEnabledForTesting() {}

}  // namespace web_app