chromium/chrome/browser/media/router/media_router_feature.cc

// Copyright 2015 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/media/router/media_router_feature.h"

#include <stdint.h>

#include <string>
#include <utility>

#include "base/base64.h"
#include "base/command_line.h"
#include "base/containers/flat_map.h"
#include "base/feature_list.h"
#include "base/no_destructor.h"
#include "base/strings/string_util.h"
#include "build/build_config.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
#include "components/media_router/common/pref_names.h"
#include "components/prefs/pref_service.h"
#include "components/user_prefs/user_prefs.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_features.h"
#include "crypto/random.h"
#include "media/base/media_switches.h"
#include "ui/base/buildflags.h"

#if !BUILDFLAG(IS_ANDROID)
#include "components/prefs/pref_registry_simple.h"
#endif

#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chromeos/ash/components/browser_context_helper/browser_context_types.h"
#endif

// NOTE: Consider separating out UI-only features that are not consumed by the
// Media Router itself into their own file in chrome/browser/ui/media_router.

namespace media_router {

#if !BUILDFLAG(IS_ANDROID)
BASE_FEATURE();
BASE_FEATURE();
BASE_FEATURE();
BASE_FEATURE();
BASE_FEATURE();
#endif  // BUILDFLAG(IS_CHROMEOS)
BASE_FEATURE();

// TODO(crbug.com/1486680): Remove once stopping mirroring routes in the global
// media controls is implemented on ChromeOS.
BASE_FEATURE();
#endif  // BUILDFLAG(IS_CHROMEOS)

BASE_FEATURE();
const base::FeatureParam<int> kCastMirroringPlayoutDelayMs{};

// TODO(b/202294946): Remove when enabled by default after a few milestones.
BASE_FEATURE();

BASE_FEATURE();

#endif  // !BUILDFLAG(IS_ANDROID)

#if BUILDFLAG(IS_MAC)
BASE_FEATURE(kUseNetworkFrameworkForLocalDiscovery,
             "UseNetworkFrameworkForLocalDiscovery",
             base::FEATURE_DISABLED_BY_DEFAULT);
#endif

namespace {
const PrefService::Preference* GetMediaRouterPref(
    content::BrowserContext* context) {}

base::flat_map<content::BrowserContext*, bool>& GetStoredPrefValues() {}

#if !BUILDFLAG(IS_ANDROID)
// TODO(mfoltz): Add full implementation for validating playout delay value.
bool IsValidMirroringPlayoutDelayMs(int delay_ms) {}
#endif  // !BUILDFLAG(IS_ANDROID)
}  // namespace

void ClearMediaRouterStoredPrefsForTesting() {}

bool MediaRouterEnabled(content::BrowserContext* context) {}

#if !BUILDFLAG(IS_ANDROID)
void RegisterLocalStatePrefs(PrefRegistrySimple* registry) {}

void RegisterProfilePrefs(PrefRegistrySimple* registry) {}

bool GetCastAllowAllIPsPref(PrefService* pref_service) {}

std::string GetReceiverIdHashToken(PrefService* pref_service) {}

bool DialMediaRouteProviderEnabled() {}

bool GlobalMediaControlsCastStartStopEnabled(content::BrowserContext* context) {}

std::optional<base::TimeDelta> GetCastMirroringPlayoutDelay() {}

#endif  // !BUILDFLAG(IS_ANDROID)

}  // namespace media_router