chromium/components/global_media_controls/public/media_session_notification_item.cc

// Copyright 2019 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/media_session_notification_item.h"

#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/i18n/rtl.h"
#include "base/metrics/histogram_macros.h"
#include "base/ranges/algorithm.h"
#include "base/time/time.h"
#include "components/global_media_controls/public/constants.h"
#include "components/media_message_center/media_notification_util.h"
#include "components/media_message_center/media_notification_view.h"
#include "components/vector_icons/vector_icons.h"
#include "media/base/media_switches.h"
#include "media/base/remoting_constants.h"
#include "services/media_session/public/cpp/util.h"
#include "services/media_session/public/mojom/media_controller.mojom.h"
#include "services/media_session/public/mojom/media_session.mojom.h"
#include "ui/gfx/favicon_size.h"
#include "ui/gfx/image/image.h"

MediaSessionAction;

namespace global_media_controls {

namespace {

media_message_center::Source GetSourceFromName(const std::string& name) {}

bool GetRemotePlaybackStarted(
    const media_session::mojom::MediaSessionInfoPtr& session_info) {}

// How long to wait (in milliseconds) for a new media session to begin.
constexpr base::TimeDelta kFreezeTimerDelay =;

}  // namespace

MediaSessionNotificationItem::MediaSessionNotificationItem(
    Delegate* delegate,
    const std::string& request_id,
    const std::string& source_name,
    const std::optional<base::UnguessableToken>& source_id,
    mojo::Remote<media_session::mojom::MediaController> controller,
    media_session::mojom::MediaSessionInfoPtr session_info)
    :{}

MediaSessionNotificationItem::~MediaSessionNotificationItem() {}

void MediaSessionNotificationItem::MediaSessionInfoChanged(
    media_session::mojom::MediaSessionInfoPtr session_info) {}

void MediaSessionNotificationItem::MediaSessionMetadataChanged(
    const std::optional<media_session::MediaMetadata>& metadata) {}

void MediaSessionNotificationItem::MediaSessionActionsChanged(
    const std::vector<MediaSessionAction>& actions) {}

void MediaSessionNotificationItem::MediaSessionPositionChanged(
    const std::optional<media_session::MediaPosition>& position) {}

void MediaSessionNotificationItem::UpdateDeviceName(
    const std::optional<std::string>& device_name) {}

void MediaSessionNotificationItem::UpdatePresentationRequestOrigin(
    const url::Origin& origin) {}

void MediaSessionNotificationItem::MediaControllerImageChanged(
    media_session::mojom::MediaSessionImageType type,
    const SkBitmap& bitmap) {}

void MediaSessionNotificationItem::MediaControllerChapterImageChanged(
    int chapter_index,
    const SkBitmap& bitmap) {}

void MediaSessionNotificationItem::SetView(
    media_message_center::MediaNotificationView* view) {}

void MediaSessionNotificationItem::OnMediaSessionActionButtonPressed(
    MediaSessionAction action) {}

void MediaSessionNotificationItem::SeekTo(base::TimeDelta time) {}

void MediaSessionNotificationItem::Dismiss() {}

void MediaSessionNotificationItem::Stop() {}

void MediaSessionNotificationItem::Raise() {}

void MediaSessionNotificationItem::SetMute(bool mute) {}

bool MediaSessionNotificationItem::RequestMediaRemoting() {}

media_message_center::Source MediaSessionNotificationItem::GetSource() const {}

media_message_center::SourceType MediaSessionNotificationItem::GetSourceType()
    const {}

std::optional<base::UnguessableToken>
MediaSessionNotificationItem::GetSourceId() const {}

void MediaSessionNotificationItem::SetController(
    mojo::Remote<media_session::mojom::MediaController> controller,
    media_session::mojom::MediaSessionInfoPtr session_info) {}

void MediaSessionNotificationItem::Freeze(base::OnceClosure unfrozen_callback) {}

media_session::mojom::RemotePlaybackMetadataPtr
MediaSessionNotificationItem::GetRemotePlaybackMetadata() const {}

bool MediaSessionNotificationItem::IsPlaying() const {}

void MediaSessionNotificationItem::FlushForTesting() {}

media_session::MediaMetadata MediaSessionNotificationItem::GetSessionMetadata()
    const {}

base::flat_set<MediaSessionAction>
MediaSessionNotificationItem::GetMediaSessionActions() const {}

bool MediaSessionNotificationItem::ShouldShowNotification() const {}

void MediaSessionNotificationItem::MaybeUnfreeze() {}

void MediaSessionNotificationItem::UnfreezeNonArtwork() {}

// The artwork is frozen separately so that the rest of the UI can unfreeze
// while we await new artwork. If we didn't separate them and just didn't wait
// for the new artwork, the UI would flash between having and not having
// artwork. If we didn't separate them and did wait for new artwork, the UI
// would be slow and unresponsive when trying to skip ahead multiple tracks.
void MediaSessionNotificationItem::UnfreezeArtwork() {}

bool MediaSessionNotificationItem::HasActions() const {}

bool MediaSessionNotificationItem::HasArtwork() const {}

bool MediaSessionNotificationItem::HasChapterArtwork(int index) const {}

void MediaSessionNotificationItem::OnFreezeTimerFired() {}

void MediaSessionNotificationItem::MaybeHideOrShowNotification() {}

void MediaSessionNotificationItem::UpdateViewCommon() {}

bool MediaSessionNotificationItem::FrozenWithChapterArtwork() {}
}  // namespace global_media_controls