chromium/components/global_media_controls/public/views/media_item_ui_updated_view.cc

// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/global_media_controls/public/views/media_item_ui_updated_view.h"

#include "base/metrics/histogram_functions.h"
#include "components/global_media_controls/media_view_utils.h"
#include "components/global_media_controls/public/media_item_ui_observer.h"
#include "components/media_message_center/media_notification_item.h"
#include "components/strings/grit/components_strings.h"
#include "components/vector_icons/vector_icons.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/gfx/geometry/skia_conversions.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/animation/ink_drop.h"
#include "ui/views/background.h"
#include "ui/views/controls/focus_ring.h"
#include "ui/views/controls/highlight_path_generator.h"
#include "ui/views/controls/image_view.h"
#include "ui/views/controls/label.h"
#include "ui/views/layout/box_layout_view.h"

namespace global_media_controls {

MediaSessionAction;

namespace {

constexpr int kFixedWidth =;

constexpr gfx::Insets kBackgroundInsets =;
constexpr gfx::Insets kInfoColumnInsets =;

constexpr int kBackgroundCornerRadius =;
constexpr int kArtworkCornerRadius =;
constexpr int kFaviconCornerRadius =;

constexpr int kBackgroundSeparator =;
constexpr int kArtworkRowSeparator =;
constexpr int kMediaInfoSeparator =;
constexpr int kSourceRowSeparator =;
constexpr int kMetadataRowSeparator =;
constexpr int kMetadataColumnSeparator =;
constexpr int kProgressRowSeparator =;

constexpr int kPlayPauseButtonIconSize =;
constexpr int kMediaActionButtonIconSize =;

constexpr float kFocusRingHaloInset =;

constexpr gfx::Size kArtworkSize =;
constexpr gfx::Size kFaviconSize =;
constexpr gfx::Size kPlayPauseButtonSize =;
constexpr gfx::Size kMediaActionButtonSize =;

// Buttons with the following media actions are in the progress row, on the two
// sides of the progress view.
const MediaSessionAction kProgressRowMediaActions[] =;

// Media actions for the replay and forward 10 seconds buttons.
const MediaSessionAction kProgressRowSeekMediaActions[] =;

}  // namespace

MediaItemUIUpdatedView::MediaItemUIUpdatedView(
    const std::string& id,
    base::WeakPtr<media_message_center::MediaNotificationItem> item,
    media_message_center::MediaColorTheme media_color_theme,
    std::unique_ptr<MediaItemUIDeviceSelector> device_selector_view,
    std::unique_ptr<MediaItemUIFooter> footer_view)
    :{}

MediaItemUIUpdatedView::~MediaItemUIUpdatedView() {}

///////////////////////////////////////////////////////////////////////////////
// views::View implementations:

gfx::Size MediaItemUIUpdatedView::CalculatePreferredSize(
    const views::SizeBounds& available_size) const {}

void MediaItemUIUpdatedView::AddedToWidget() {}

void MediaItemUIUpdatedView::UpdateAccessibleName() {}

bool MediaItemUIUpdatedView::OnKeyPressed(const ui::KeyEvent& event) {}

bool MediaItemUIUpdatedView::OnMousePressed(const ui::MouseEvent& event) {}

///////////////////////////////////////////////////////////////////////////////
// MediaItemUI implementations:

void MediaItemUIUpdatedView::AddObserver(MediaItemUIObserver* observer) {}

void MediaItemUIUpdatedView::RemoveObserver(MediaItemUIObserver* observer) {}

///////////////////////////////////////////////////////////////////////////////
// media_message_center::MediaNotificationView implementations:

void MediaItemUIUpdatedView::UpdateWithMediaSessionInfo(
    const media_session::mojom::MediaSessionInfoPtr& session_info) {}

void MediaItemUIUpdatedView::UpdateWithMediaMetadata(
    const media_session::MediaMetadata& metadata) {}

void MediaItemUIUpdatedView::UpdateWithMediaActions(
    const base::flat_set<media_session::mojom::MediaSessionAction>& actions) {}

void MediaItemUIUpdatedView::UpdateWithMediaPosition(
    const media_session::MediaPosition& position) {}

void MediaItemUIUpdatedView::UpdateWithMediaArtwork(
    const gfx::ImageSkia& image) {}

void MediaItemUIUpdatedView::UpdateWithFavicon(const gfx::ImageSkia& icon) {}

void MediaItemUIUpdatedView::UpdateDeviceSelectorVisibility(bool visible) {}

void MediaItemUIUpdatedView::UpdateDeviceSelectorAvailability(
    bool has_devices) {}

///////////////////////////////////////////////////////////////////////////////
// MediaItemUIUpdatedView implementations:

void MediaItemUIUpdatedView::UpdateDeviceSelectorView(
    std::unique_ptr<MediaItemUIDeviceSelector> device_selector_view) {}

void MediaItemUIUpdatedView::UpdateFooterView(
    std::unique_ptr<MediaItemUIFooter> footer_view) {}

void MediaItemUIUpdatedView::UpdateDeviceSelectorIssue(bool has_issue) {}

MediaActionButton* MediaItemUIUpdatedView::CreateMediaActionButton(
    views::View* parent,
    int button_id,
    const gfx::VectorIcon& vector_icon,
    int tooltip_text_id) {}

void MediaItemUIUpdatedView::MediaActionButtonPressed(views::Button* button) {}

void MediaItemUIUpdatedView::UpdateMediaActionButtonsVisibility() {}

void MediaItemUIUpdatedView::UpdateTimestampLabelsVisibility() {}

void MediaItemUIUpdatedView::OnProgressDragStateChange(DragState drag_state) {}

void MediaItemUIUpdatedView::OnPlaybackStateChangeForProgressDrag(
    PlaybackStateChangeForDragging change) {}

void MediaItemUIUpdatedView::SeekTo(double seek_progress) {}

void MediaItemUIUpdatedView::OnProgressViewUpdateProgress(
    base::TimeDelta current_timestamp) {}

void MediaItemUIUpdatedView::StartCastingButtonPressed() {}

void MediaItemUIUpdatedView::UpdateCastingState() {}

///////////////////////////////////////////////////////////////////////////////
// Helper functions for testing:

views::ImageView* MediaItemUIUpdatedView::GetArtworkViewForTesting() {}

views::ImageView* MediaItemUIUpdatedView::GetFaviconViewForTesting() {}

views::ImageView* MediaItemUIUpdatedView::GetCastingIndicatorViewForTesting() {}

views::Label* MediaItemUIUpdatedView::GetSourceLabelForTesting() {}

views::Label* MediaItemUIUpdatedView::GetTitleLabelForTesting() {}

views::Label* MediaItemUIUpdatedView::GetArtistLabelForTesting() {}

views::Label* MediaItemUIUpdatedView::GetCurrentTimestampLabelForTesting() {}

views::Label* MediaItemUIUpdatedView::GetDurationTimestampLabelForTesting() {}

MediaActionButton* MediaItemUIUpdatedView::GetMediaActionButtonForTesting(
    MediaSessionAction action) {}

MediaProgressView* MediaItemUIUpdatedView::GetProgressViewForTesting() {}

MediaLiveStatusView* MediaItemUIUpdatedView::GetLiveStatusViewForTesting() {}

MediaActionButton* MediaItemUIUpdatedView::GetStartCastingButtonForTesting() {}

MediaItemUIDeviceSelector*
MediaItemUIUpdatedView::GetDeviceSelectorForTesting() {}

MediaItemUIFooter* MediaItemUIUpdatedView::GetFooterForTesting() {}

BEGIN_METADATA()

}  // namespace global_media_controls