#include "chrome/browser/ui/views/media_preview/mic_preview/mic_coordinator.h"
#include <algorithm>
#include <memory>
#include <utility>
#include "base/functional/bind.h"
#include "base/ranges/algorithm.h"
#include "chrome/browser/media/prefs/capture_device_ranking.h"
#include "chrome/browser/ui/views/media_preview/media_preview_metrics.h"
#include "chrome/browser/ui/views/media_preview/media_view.h"
#include "components/media_effects/media_device_info.h"
#include "media/audio/audio_device_description.h"
#include "media/base/audio_parameters.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
MicCoordinator::MicCoordinator(
views::View& parent_view,
bool needs_borders,
const std::vector<std::string>& eligible_mic_ids,
PrefService& prefs,
bool allow_device_selection,
const media_preview_metrics::Context& metrics_context)
: … { … }
MicCoordinator::~MicCoordinator() { … }
void MicCoordinator::OnAudioSourceInfosReceived(
const std::vector<media::AudioDeviceDescription>& device_infos) { … }
void MicCoordinator::OnAudioSourceChanged(
std::optional<size_t> selected_index) { … }
void MicCoordinator::ConnectAudioStream(
const std::string& device_id,
const std::optional<media::AudioParameters>& device_params) { … }
void MicCoordinator::UpdateDevicePreferenceRanking() { … }
void MicCoordinator::ResetViewController() { … }