blob: b4d0dc77a193d2dcc3a994bcc723e2cdbdd20525 [file] [log] [blame]
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/previews/core/previews_features.h"
#include "build/build_config.h"
namespace previews {
namespace features {
// Kill switch (or holdback) for all previews. No previews will be allowed
// if this feature is disabled. If enabled, which specific previews that
// are enabled are controlled by other features.
const base::Feature kPreviews {
#if defined(OS_ANDROID) || defined(OS_LINUX)
// Previews allowed for Android (but also allow on Linux for dev/debug).
#else // !defined(OS_ANDROID) || defined(OS_LINUX)
#endif // defined(OS_ANDROID) || defined(OS_LINUX)
// Enables the Offline previews on android slow connections.
const base::Feature kOfflinePreviews{"OfflinePreviews",
// Enables the Client Lo-Fi previews.
const base::Feature kClientLoFi {
#if defined(OS_ANDROID)
#else // !defined(OS_ANDROID)
#endif // defined(OS_ANDROID)
// Enables the NoScript previews for Android.
const base::Feature kNoScriptPreviews {
#if defined(OS_ANDROID)
#else // !defined(OS_ANDROID)
#endif // defined(OS_ANDROID)
// Enables the Stale Previews timestamp on Previews infobars.
const base::Feature kStalePreviewsTimestamp{"StalePreviewsTimestamp",
// Enables the syncing of the Optimization Hints component, which provides
// hints for what Previews can be applied on a page load.
const base::Feature kOptimizationHints {
#if defined(OS_ANDROID)
#else // !defined(OS_ANDROID)
#endif // defined(OS_ANDROID)
// Enables Optimization Hints that are marked as experimental. Optimizations are
// marked experimental by setting an experiment name in the "experiment_name"
// field of the Optimization proto. This allows experiments at the granularity
// of a single PreviewType for a single host (or host suffix). The intent is
// that optimizations that may not work properly for certain sites can be tried
// at a small scale via Finch experiments. Experimental optimizations can be
// activated by enabling this feature and passing an experiment name as a
// parameter called "experiment_name" that matches the experiment name in the
// Optimization proto.
const base::Feature kOptimizationHintsExperiments{
"OptimizationHintsExperiments", base::FEATURE_DISABLED_BY_DEFAULT};
// Enables the application of the resource loading hints when loading resources.
const base::Feature kResourceLoadingHints{"ResourceLoadingHints",
// Enables client redirects to a server-rendered lite page preview.
const base::Feature kLitePageServerPreviews{"LitePageServerPreviews",
// Shows a Previews icon and string in the Android Omnibox instead of an Infobar
// when enabled. Only works and is honored on Android..
const base::Feature kAndroidOmniboxPreviewsBadge{
"AndroidOmniboxPreviewsBadge", base::FEATURE_DISABLED_BY_DEFAULT};
// Provides slow page triggering parameters.
const base::Feature kSlowPageTriggering{"PreviewsSlowPageTriggering",
// A feature to prevent previews on all reloads.
const base::Feature kPreviewsDisallowedOnReloads{
"PreviewsDisallowedOnReloads", base::FEATURE_DISABLED_BY_DEFAULT};
// Allows HTTPS previews to be served via a URLLoader when network service is
// enabled.
const base::Feature kHTTPSServerPreviewsUsingURLLoader{
"HTTPSServerPreviewsUsingURLLoader", base::FEATURE_DISABLED_BY_DEFAULT};
} // namespace features
} // namespace previews