#ifndef ASH_SYSTEM_CAST_CAST_NOTIFICATION_CONTROLLER_H_
#define ASH_SYSTEM_CAST_CAST_NOTIFICATION_CONTROLLER_H_
#include <optional>
#include "ash/ash_export.h"
#include "ash/public/cpp/cast_config_controller.h"
#include "base/memory/weak_ptr.h"
#include "ui/views/widget/widget_observer.h"
namespace views {
class Widget;
}
namespace ash {
class ASH_EXPORT CastNotificationController
: public CastConfigController::Observer,
public views::WidgetObserver {
public:
CastNotificationController();
CastNotificationController(const CastNotificationController&) = delete;
CastNotificationController& operator=(const CastNotificationController&) =
delete;
~CastNotificationController() override;
void OnDevicesUpdated(const std::vector<SinkAndRoute>& devices) override;
void OnWidgetDestroyed(views::Widget* widget) override;
private:
void PressedCallback(std::optional<int> button_index);
void StopCasting();
void FreezePressed();
std::string displayed_route_id_;
std::optional<int> freeze_button_index_;
bool displayed_route_is_frozen_ = false;
bool freeze_on_tray_widget_destroyed_ = false;
base::WeakPtrFactory<CastNotificationController> weak_ptr_factory_{this};
};
}
#endif