chromium/chrome/browser/ui/webui/welcome/helpers.cc

// Copyright 2018 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/webui/welcome/helpers.h"

#include <string>
#include <vector>

#include "base/containers/contains.h"
#include "base/feature_list.h"
#include "base/metrics/field_trial_params.h"
#include "base/ranges/algorithm.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/values.h"
#include "build/branding_buildflags.h"
#include "build/build_config.h"
#include "chrome/browser/policy/browser_signin_policy_handler.h"
#include "chrome/browser/policy/profile_policy_connector.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search/search.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/policy_constants.h"

namespace welcome {

// Available modules for both new and returning users.
const char kDefaultNewUserModules[] =;
const char kDefaultReturningUserModules[] =;

// Feature flag.
BASE_FEATURE();
// For testing purposes
BASE_FEATURE();

// The value of these FeatureParam values should be a comma-delimited list
// of element names allowlisted in the MODULES_WHITELIST list, defined in
// chrome/browser/resources/welcome/welcome_app.js
const base::FeatureParam<std::string> kNewUserModules{};
const base::FeatureParam<std::string> kReturningUserModules{};
// For testing purposes
const base::FeatureParam<std::string> kForceEnabledNewUserModules =;
const base::FeatureParam<std::string> kForceEnabledReturningUserModules =;

// FeatureParam for app variation.
const base::FeatureParam<bool> kShowGoogleApp{};
// For testing purposes
const base::FeatureParam<bool> kForceEnabledShowGoogleApp =;

bool IsPolicySetAndFalse(const policy::PolicyMap& policies,
                         const std::string& policy_name) {}

bool CanShowGoogleAppModule(const policy::PolicyMap& policies) {}

bool CanShowNTPBackgroundModule(const policy::PolicyMap& policies,
                                Profile* profile) {}

bool CanShowSetDefaultModule(const policy::PolicyMap& policies) {}

bool CanShowSigninModule(const policy::PolicyMap& policies) {}

// Welcome experiments depend on Google being the default search provider.
static bool CanExperimentWithVariations(Profile* profile) {}

bool IsEnabled(Profile* profile) {}

bool IsAppVariationEnabled() {}

const policy::PolicyMap& GetPoliciesFromProfile(Profile* profile) {}

std::vector<std::string> GetAvailableModules(Profile* profile) {}

std::string FilterModules(const std::string& requested_modules,
                          const std::vector<std::string>& available_modules) {}

base::Value::Dict GetModules(Profile* profile) {}

bool CanShowGoogleAppModuleForTesting(const policy::PolicyMap& policies) {}

bool CanShowNTPBackgroundModuleForTesting(const policy::PolicyMap& policies,
                                          Profile* profile) {}

bool CanShowSetDefaultModuleForTesting(const policy::PolicyMap& policies) {}

bool CanShowSigninModuleForTesting(const policy::PolicyMap& policies) {}
}  // namespace welcome