#include "chrome/browser/ui/global_media_controls/cast_media_notification_producer.h"
#include <map>
#include "base/ranges/algorithm.h"
#include "chrome/browser/feature_engagement/tracker_factory.h"
#include "chrome/browser/media/router/media_router_feature.h"
#include "chrome/browser/profiles/profile.h"
#include "components/feature_engagement/public/tracker.h"
#include "components/global_media_controls/public/media_item_manager.h"
#include "components/media_message_center/media_notification_util.h"
#include "components/media_router/browser/media_router.h"
#include "components/media_router/browser/media_router_factory.h"
#include "components/media_router/common/pref_names.h"
#include "components/media_router/common/providers/cast/cast_media_source.h"
#include "components/prefs/pref_service.h"
#include "media/base/media_switches.h"
namespace {
bool ShouldHideNotification(Profile* profile,
const media_router::MediaRoute& route) { … }
}
CastMediaNotificationProducer::CastMediaNotificationProducer(
Profile* profile,
global_media_controls::MediaItemManager* item_manager)
: … { … }
CastMediaNotificationProducer::CastMediaNotificationProducer(
Profile* profile,
media_router::MediaRouter* router,
global_media_controls::MediaItemManager* item_manager)
: … { … }
CastMediaNotificationProducer::~CastMediaNotificationProducer() = default;
base::WeakPtr<media_message_center::MediaNotificationItem>
CastMediaNotificationProducer::GetMediaItem(const std::string& id) { … }
std::set<std::string>
CastMediaNotificationProducer::GetActiveControllableItemIds() const { … }
bool CastMediaNotificationProducer::HasFrozenItems() { … }
void CastMediaNotificationProducer::OnItemShown(
const std::string& id,
global_media_controls::MediaItemUI* item_ui) { … }
void CastMediaNotificationProducer::OnDialogDisplayed() { … }
bool CastMediaNotificationProducer::IsItemActivelyPlaying(
const std::string& id) { … }
void CastMediaNotificationProducer::OnMediaItemUIDismissed(
const std::string& id) { … }
void CastMediaNotificationProducer::OnRoutesUpdated(
const std::vector<media_router::MediaRoute>& routes) { … }
size_t CastMediaNotificationProducer::GetActiveItemCount() const { … }
bool CastMediaNotificationProducer::HasActiveItems() const { … }
bool CastMediaNotificationProducer::HasLocalMediaRoute() const { … }