#include "chrome/browser/ui/toolbar/cast/cast_toolbar_button_controller.h"
#include "base/functional/bind.h"
#include "base/observer_list.h"
#include "base/ranges/algorithm.h"
#include "chrome/browser/media/router/media_router_feature.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/pref_names.h"
#include "components/media_router/browser/media_router.h"
#include "components/media_router/browser/media_router_factory.h"
#include "components/media_router/browser/media_router_metrics.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 "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
CastToolbarButtonController::CastToolbarButtonController(Profile* profile)
: … { … }
CastToolbarButtonController::~CastToolbarButtonController() = default;
bool CastToolbarButtonController::IsActionShownByPolicy(Profile* profile) { … }
bool CastToolbarButtonController::GetAlwaysShowActionPref(Profile* profile) { … }
void CastToolbarButtonController::SetAlwaysShowActionPref(Profile* profile,
bool always_show) { … }
void CastToolbarButtonController::OnIssue(const media_router::Issue& issue) { … }
void CastToolbarButtonController::OnIssuesCleared() { … }
void CastToolbarButtonController::OnRoutesUpdated(
const std::vector<media_router::MediaRoute>& routes) { … }
void CastToolbarButtonController::OnDialogShown() { … }
void CastToolbarButtonController::OnDialogHidden() { … }
void CastToolbarButtonController::OnContextMenuShown() { … }
void CastToolbarButtonController::OnContextMenuHidden() { … }
void CastToolbarButtonController::KeepIconShownOnPressed() { … }
void CastToolbarButtonController::MaybeHideIconOnReleased() { … }
void CastToolbarButtonController::AddObserver(Observer* observer) { … }
void CastToolbarButtonController::RemoveObserver(Observer* observer) { … }
bool CastToolbarButtonController::ShouldEnableAction() const { … }
CastToolbarButtonController::CastToolbarButtonController(
Profile* profile,
media_router::MediaRouter* router)
: … { … }
void CastToolbarButtonController::MaybeAddOrRemoveAction() { … }