#include "chrome/browser/ui/global_media_controls/presentation_request_notification_producer.h"
#include <utility>
#include "base/memory/raw_ptr.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "components/media_router/common/providers/cast/cast_media_source.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/media_session.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
namespace {
base::WeakPtr<media_router::WebContentsPresentationManager>
GetActiveWebContentsPresentationManager() { … }
content::WebContents* GetWebContentsFromPresentationRequest(
const content::PresentationRequest& request) { … }
}
class PresentationRequestNotificationProducer::
PresentationRequestWebContentsObserver
: public content::WebContentsObserver { … };
PresentationRequestNotificationProducer::
PresentationRequestNotificationProducer(
base::RepeatingCallback<bool(content::WebContents*)>
has_active_notifications_callback,
const base::UnguessableToken& source_id)
: … { … }
PresentationRequestNotificationProducer::
~PresentationRequestNotificationProducer() = default;
void PresentationRequestNotificationProducer::OnStartPresentationContextCreated(
std::unique_ptr<media_router::StartPresentationContext> context) { … }
content::WebContents*
PresentationRequestNotificationProducer::GetWebContents() { … }
base::WeakPtr<PresentationRequestNotificationItem>
PresentationRequestNotificationProducer::GetNotificationItem() { … }
void PresentationRequestNotificationProducer::BindProvider(
mojo::PendingRemote<global_media_controls::mojom::DevicePickerProvider>
pending_provider) { … }
void PresentationRequestNotificationProducer::SetTestPresentationManager(
base::WeakPtr<media_router::WebContentsPresentationManager>
presentation_manager) { … }
void PresentationRequestNotificationProducer::OnMediaUIOpened() { … }
void PresentationRequestNotificationProducer::OnMediaUIClosed() { … }
void PresentationRequestNotificationProducer::OnMediaUIUpdated() { … }
void PresentationRequestNotificationProducer::OnPickerDismissed() { … }
void PresentationRequestNotificationProducer::OnPresentationsChanged(
bool has_presentation) { … }
void PresentationRequestNotificationProducer::OnDefaultPresentationChanged(
const content::PresentationRequest* presentation_request) { … }
void PresentationRequestNotificationProducer::CreateItemForPresentationRequest(
const content::PresentationRequest& request,
std::unique_ptr<media_router::StartPresentationContext> context) { … }
void PresentationRequestNotificationProducer::DeleteItemForPresentationRequest(
const std::string& message) { … }
void PresentationRequestNotificationProducer::ShowOrHideItem() { … }