#include "chrome/browser/ui/views/global_media_controls/media_notification_device_entry_ui.h"
#include "base/functional/bind.h"
#include "base/functional/callback_forward.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/app/vector_icons/vector_icons.h"
#include "chrome/browser/ui/views/global_media_controls/media_item_ui_helper.h"
#include "chrome/browser/ui/views/media_router/cast_dialog_helper.h"
#include "components/global_media_controls/public/mojom/device_service.mojom.h"
#include "components/vector_icons/vector_icons.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/base/models/image_model.h"
#include "ui/gfx/paint_vector_icon.h"
#include "ui/views/animation/ink_drop.h"
#include "ui/views/background.h"
#include "ui/views/border.h"
#include "ui/views/controls/styled_label.h"
namespace {
constexpr int kDeviceIconSize = …;
constexpr auto kDeviceIconBorder = …;
void ChangeEntryColor(views::ImageView* image_view,
views::StyledLabel* title_view,
views::Label* subtitle_view,
const gfx::VectorIcon* icon,
SkColor foreground_color,
SkColor background_color) { … }
std::unique_ptr<views::ImageView> CreateIconView(
const gfx::VectorIcon& icon,
std::optional<ui::ColorId> foreground_color_id = std::nullopt) { … }
std::unique_ptr<views::View> CreateIconView(
global_media_controls::mojom::IconType icon,
std::optional<ui::ColorId> foreground_color_id = std::nullopt) { … }
std::unique_ptr<views::ImageView> GetAudioDeviceIcon() { … }
}
DeviceEntryUI::DeviceEntryUI(const std::string& raw_device_id,
const std::string& device_name,
const gfx::VectorIcon& icon,
const std::string& subtext)
: … { … }
AudioDeviceEntryView::AudioDeviceEntryView(PressedCallback callback,
SkColor foreground_color,
SkColor background_color,
const std::string& raw_device_id,
const std::string& device_name)
: … { … }
void AudioDeviceEntryView::SetHighlighted(bool highlighted) { … }
bool AudioDeviceEntryView::GetHighlighted() const { … }
void AudioDeviceEntryView::OnColorsChanged(SkColor foreground_color,
SkColor background_color) { … }
DeviceEntryUIType AudioDeviceEntryView::GetType() const { … }
CastDeviceEntryView::CastDeviceEntryView(
base::RepeatingClosure callback,
SkColor foreground_color,
SkColor background_color,
const global_media_controls::mojom::DevicePtr& device)
: … { … }
CastDeviceEntryView::~CastDeviceEntryView() = default;
void CastDeviceEntryView::OnColorsChanged(SkColor foreground_color,
SkColor background_color) { … }
DeviceEntryUIType CastDeviceEntryView::GetType() const { … }
void CastDeviceEntryView::ChangeCastEntryColor(SkColor foreground_color,
SkColor background_color) { … }
std::string CastDeviceEntryView::GetStatusTextForTest() const { … }
CastDeviceEntryViewAsh::CastDeviceEntryViewAsh(
PressedCallback callback,
ui::ColorId foreground_color_id,
ui::ColorId background_color_id,
const global_media_controls::mojom::DevicePtr& device)
: … { … }
CastDeviceEntryViewAsh::~CastDeviceEntryViewAsh() = default;
DeviceEntryUIType CastDeviceEntryViewAsh::GetType() const { … }
BEGIN_METADATA(…)
BEGIN_METADATA(…)
BEGIN_METADATA(…)