chromium/components/search/ntp_features.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 "components/search/ntp_features.h"

#include <string>

#include "base/feature_list.h"
#include "base/metrics/field_trial_params.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/time/time.h"
#include "build/build_config.h"

namespace ntp_features {

// If enabled, shows a confirm dialog before removing search suggestions from
// the New Tab page real search box ("realbox").
BASE_FEATURE();

// If enabled, Chrome theme color will be set to match the NTP background
// on NTP Customize Chrome background change.
BASE_FEATURE();

// If enabled, shows an extension card within the Customize Chrome Side
// Panel for access to the Chrome Web Store extensions.
BASE_FEATURE();

// If enabled, shows wallpaper search within the Customize Chrome Side Panel.
// This is a kill switch. Keep indefinitely.
BASE_FEATURE();

// If enabled, shows entry point on Customize Chrome Side Panel's Appearance
// page for Wallpaper Search.";
BASE_FEATURE();

// If enabled, shows inspiration card in Customize Chrome Side Panel Wallpaper
// Search.
BASE_FEATURE();

// If enabled, NTP "realbox" will be themed for CR23. Includes realbox
// matching omnibox theme and increased realbox shadow.
BASE_FEATURE();

// If enabled, the NTP "realbox" will have same border/drop shadow in hover
// state as searchbox.
BASE_FEATURE();

// If enabled, the real search box ("realbox") on the New Tab page will show a
// Google (g) icon instead of the typical magnifying glass (aka loupe).
BASE_FEATURE();

// If enabled, alpha NTP backgrounds will show in Customize Chrome.
// This is a development switch. Keep indefinitely.
BASE_FEATURE();

// If enabled, NTP background image links will be checked for HTTP status
// errors."
BASE_FEATURE();

// If enabled, calendar module will be shown.
BASE_FEATURE();

// If enabled, chrome cart module will be shown.
BASE_FEATURE();

#if !defined(OFFICIAL_BUILD)
// If enabled, dummy modules will be shown.
// This is a development switch. Keep indefinitely.
BASE_FEATURE();
#endif

// If enabled, Google Drive module will be shown.
// This is a kill switch. Keep indefinitely.
BASE_FEATURE();

// If enabled, segmentation data will be collected to decide whether or not to
// show the Drive module.
BASE_FEATURE();

// If enabled, six files show in the NTP Drive module, instead of three.
BASE_FEATURE();

// If enabled, logo will be shown.
// This is a kill switch. Keep indefinitely.
BASE_FEATURE();

// If enabled, middle slot promo will be shown.
// This is a kill switch. Keep indefinitely.
BASE_FEATURE();

// If enabled, middle slot promo will be dismissed from New Tab Page until new
// promo message is populated
BASE_FEATURE();

// Dummy feature to set param "NtpModulesLoadTimeoutMillisecondsParam".
// This is used for an emergency Finch param. Keep indefinitely.
BASE_FEATURE();

// If true, extends width of modules if space allows.
BASE_FEATURE();

// Dummy feature to set param "NtpModulesOrderParam".
// This is used for an emergency Finch param. Keep indefinitely.
BASE_FEATURE();

// Dummy feature to set param "NtpModulesMaxColumnCountParam".
// This is used for an emergency Finch param. Keep indefinitely.
BASE_FEATURE();

// Dummy feature to set param "NtpModulesLoadedWithOtherModulesMaxInstanceCount"
// This is used for an emergency Finch param. Keep indefinitely.
BASE_FEATURE();

// If true, displays a horizontal scrollbar on overflowing modules.
BASE_FEATURE();

// If enabled, modules will be able to be reordered via dragging and dropping
BASE_FEATURE();

// If enabled, modules will be loaded but not shown. This is useful to determine
// if a user would have seen modules in order to counterfactually log or
// trigger.
BASE_FEATURE();

// If enabled, redesigned NTP launchpad + modules will be shown.
BASE_FEATURE();

// If enabled, OneGoogleBar will be shown.
// This is a kill switch. Keep indefinitely.
BASE_FEATURE();

// If enabled, outlook calendar module will be shown.
BASE_FEATURE();

// If enabled, Google Photos module will be shown.
BASE_FEATURE();

// If enabled, a customized title will be shown on the opt-in card.
BASE_FEATURE();

// If enabled, a customized art work will be shown on the opt-in card.
BASE_FEATURE();

// If enabled, Google Photos opt-in card will show a button to soft opt-out.
BASE_FEATURE();

// If enabled, the single svg image show in Photos opt-in screen will be
// replaced by constituent images to support i18n.
BASE_FEATURE();

// If enabled, Following Feed module will be shown.
BASE_FEATURE();

// If enabled, Google Lens image search will call Lens v3 direct upload
// endpoint instead of uploading to Scotty.
BASE_FEATURE();

// If enabled, SafeBrowsing module will be shown to a target user.
BASE_FEATURE();

// If enabled, sharepoint module will be shown.
BASE_FEATURE();

// If enabled, shortcuts will be shown.
// This is a kill switch. Keep indefinitely.
BASE_FEATURE();

// If enabled, module headers will display an associated icon.
BASE_FEATURE();

// If enabled, the Tab Resumption module will be shown.
BASE_FEATURE();

// If enabled, the Tab Resumption module with the device icon will be shown.
BASE_FEATURE();

BASE_FEATURE();

// Dummy feature to set how recent tabs must be to be shown.
BASE_FEATURE();

// If enabled, shows entry point on New Tab Page for Customize Chrome Side Panel
// Wallpaper Search.
BASE_FEATURE();

// If enabled, animates New Tab Page's Wallpaper Search Button.
BASE_FEATURE();

// Dummy feature to set param "NtpWallpaperSearchButtonAnimationShownThreshold".
// This is used for an emergency Finch param. Keep indefinitely.
BASE_FEATURE();

const char kNtpModuleIgnoredCriteriaThreshold[] =;
const char kNtpModuleIgnoredHaTSDelayTimeParam[] =;
const char kNtpModulesEligibleForHappinessTrackingSurveyParam[] =;
const char kNtpModulesInteractionBasedSurveyEligibleIdsParam[] =;
const char kNtpModulesLoadTimeoutMillisecondsParam[] =;
const char kNtpModulesLoadedWithOtherModulesMaxInstanceCountParam[] =;
const char kNtpModulesMaxColumnCountParam[] =;
const char kNtpModulesOrderParam[] =;
const char kNtpCalendarModuleDataParam[] =;
const char kNtpChromeCartModuleDataParam[] =;
const char kNtpChromeCartModuleAbandonedCartDiscountParam[] =;
const char kNtpChromeCartModuleAbandonedCartDiscountUseUtmParam[] =;
const char kNtpChromeCartModuleHeuristicsImprovementParam[] =;
const char kNtpChromeCartModuleCouponParam[] =;
const char kNtpDriveModuleDataParam[] =;
const char kNtpDriveModuleManagedUsersOnlyParam[] =;
const char kNtpDriveModuleCacheMaxAgeSParam[] =;
const char kNtpDriveModuleExperimentGroupParam[] =;
const char kNtpMiddleSlotPromoDismissalParam[] =;
const char kNtpPhotosModuleDataParam[] =;
const char kNtpPhotosModuleOptInTitleParam[] =;
const char kNtpPhotosModuleOptInArtWorkParam[] =;
const char kNtpSafeBrowsingModuleCooldownPeriodDaysParam[] =;
const char kNtpSafeBrowsingModuleCountMaxParam[] =;
const char kNtpMostRelevantTabResumptionModuleDataParam[] =;
const char kNtpTabResumptionModuleCategoriesBlocklistParam[] =;
const char kNtpTabResumptionModuleDismissalDurationParam[] =;
const char kNtpTabResumptionModuleDataParam[] =;
const char kNtpTabResumptionModuleResultTypesParam[] =;
const char kNtpTabResumptionModuleTimeLimitParam[] =;
const char kNtpTabResumptionModuleVisibilityThresholdDataParam[] =;
const char kNtpWallpaperSearchButtonAnimationShownThresholdParam[] =;
const char kWallpaperSearchHatsDelayParam[] =;

const base::FeatureParam<std::string> kNtpCalendarModuleExperimentParam(
    &ntp_features::kNtpCalendarModule,
    "NtpCalendarModuleMaxExperimentParam",
    "ntp-calendar");
const base::FeatureParam<int> kNtpCalendarModuleMaxEventsParam(
    &ntp_features::kNtpCalendarModule,
    "NtpCalendarModuleMaxEventsParam",
    6);
const base::FeatureParam<base::TimeDelta> kNtpCalendarModuleWindowEndDeltaParam(
    &ntp_features::kNtpCalendarModule,
    "NtpCalendarModuleWindowEndDeltaParam",
    base::Hours(12));
const base::FeatureParam<base::TimeDelta>
    kNtpCalendarModuleWindowStartDeltaParam(
        &ntp_features::kNtpCalendarModule,
        "NtpCalendarModuleWindowStartDeltaParam",
        base::Minutes(-15));
const base::FeatureParam<bool> kNtpRealboxCr23ExpandedStateBgMatchesOmnibox(
    &ntp_features::kRealboxCr23Theming,
    "kNtpRealboxCr23ExpandedStateBgMatchesOmnibox",
    true);
const base::FeatureParam<bool> kNtpRealboxCr23SteadyStateShadow(
    &ntp_features::kRealboxCr23Theming,
    "kNtpRealboxCr23SteadyStateShadow",
    false);

base::TimeDelta GetModulesLoadTimeout() {}

int GetModulesMaxColumnCount() {}

int GetMultipleLoadedModulesMaxModuleInstanceCount() {}

std::vector<std::string> GetModulesOrder() {}

int GetWallpaperSearchButtonAnimationShownThreshold() {}
}  // namespace ntp_features