chromium/content/browser/media/media_keys_listener_manager_impl.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 "content/browser/media/media_keys_listener_manager_impl.h"

#include <memory>
#include <utility>

#include "base/metrics/histogram_functions.h"
#include "base/observer_list.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "components/system_media_controls/system_media_controls.h"
#include "content/browser/browser_main_loop.h"
#include "content/browser/media/active_media_session_controller.h"
#include "content/browser/media/system_media_controls_notifier.h"
#include "content/browser/media/web_app_system_media_controls.h"
#include "content/public/common/content_features.h"
#include "media/audio/audio_manager.h"
#include "ui/base/accelerators/accelerator.h"
#include "ui/base/idle/idle.h"

#if USE_INSTANCED_SYSTEM_MEDIA_CONTROLS_FOR_WEB_APPS
#include "content/browser/media/web_app_system_media_controls_manager.h"
#endif  // USE_INSTANCED_SYSTEM_MEDIA_CONTROLS_FOR_WEB_APPS

namespace content {

MediaKeysListenerManagerImpl::ListeningData::ListeningData() = default;

MediaKeysListenerManagerImpl::ListeningData::~ListeningData() = default;

// static
MediaKeysListenerManager* MediaKeysListenerManager::GetInstance() {}

MediaKeysListenerManagerImpl::MediaKeysListenerManagerImpl() {}

MediaKeysListenerManagerImpl::~MediaKeysListenerManagerImpl() = default;

bool MediaKeysListenerManagerImpl::StartWatchingMediaKey(
    ui::KeyboardCode key_code,
    ui::MediaKeysListener::Delegate* delegate,
    base::UnguessableToken web_app_request_id) {}

void MediaKeysListenerManagerImpl::StopWatchingMediaKey(
    ui::KeyboardCode key_code,
    ui::MediaKeysListener::Delegate* delegate,
    base::UnguessableToken web_app_request_id) {}

void MediaKeysListenerManagerImpl::DisableInternalMediaKeyHandling() {}

void MediaKeysListenerManagerImpl::EnableInternalMediaKeyHandling() {}

void MediaKeysListenerManagerImpl::OnMediaKeysAccelerator(
    const ui::Accelerator& accelerator) {}

void MediaKeysListenerManagerImpl::SetIsMediaPlaying(bool is_playing) {}

void MediaKeysListenerManagerImpl::OnNext(
    system_media_controls::SystemMediaControls* sender) {}

void MediaKeysListenerManagerImpl::OnPrevious(
    system_media_controls::SystemMediaControls* sender) {}

void MediaKeysListenerManagerImpl::OnPlay(
    system_media_controls::SystemMediaControls* sender) {}

void MediaKeysListenerManagerImpl::OnPause(
    system_media_controls::SystemMediaControls* sender) {}

void MediaKeysListenerManagerImpl::OnPlayPause(
    system_media_controls::SystemMediaControls* sender) {}

void MediaKeysListenerManagerImpl::OnStop(
    system_media_controls::SystemMediaControls* sender) {}

void MediaKeysListenerManagerImpl::OnSeek(
    system_media_controls::SystemMediaControls* sender,
    const base::TimeDelta& time) {}

void MediaKeysListenerManagerImpl::OnSeekTo(
    system_media_controls::SystemMediaControls* sender,
    const base::TimeDelta& time) {}

void MediaKeysListenerManagerImpl::MaybeSendKeyCode(ui::KeyboardCode key_code) {}

void MediaKeysListenerManagerImpl::EnsureAuxiliaryServices() {}

void MediaKeysListenerManagerImpl::StartListeningForMediaKeysIfNecessary() {}

MediaKeysListenerManagerImpl::ListeningData*
MediaKeysListenerManagerImpl::GetOrCreateListeningData(
    ui::KeyboardCode key_code) {}

void MediaKeysListenerManagerImpl::UpdateWhichKeysAreListenedFor() {}

void MediaKeysListenerManagerImpl::UpdateSystemMediaControlsEnabledControls() {}

void MediaKeysListenerManagerImpl::UpdateMediaKeysListener() {}

bool MediaKeysListenerManagerImpl::ShouldListenToKey(
    const ListeningData& listening_data) const {}

bool MediaKeysListenerManagerImpl::AnyDelegatesListening() const {}

bool MediaKeysListenerManagerImpl::
    CanActiveMediaSessionControllerReceiveEvents() const {}

bool MediaKeysListenerManagerImpl::ShouldActiveMediaSessionControllerReceiveKey(
    ui::KeyboardCode key_code) const {}

bool MediaKeysListenerManagerImpl::ShouldUseWebAppSystemMediaControls() const {}

bool MediaKeysListenerManagerImpl::IsDelegateForWebAppSession(
    ui::MediaKeysListener::Delegate* delegate) {}

#if USE_INSTANCED_SYSTEM_MEDIA_CONTROLS_FOR_WEB_APPS
void MediaKeysListenerManagerImpl::MaybeSendWebAppControlsEvent(
    WebAppSystemMediaControlsEvent event,
    system_media_controls::SystemMediaControls* sender) {
  if (web_app_system_media_controls_manager_ &&
      web_app_system_media_controls_manager_
          ->GetWebAppSystemMediaControlsForSystemMediaControls(sender)) {
    // Since the sender is registered with the
    // web_app_system_media_controls_manager we're good to go ahead and fire the
    // histogram for instanced pwa controls.
    base::UmaHistogramEnumeration("WebApp.Media.SystemMediaControls", event);
  }
}
#endif  // USE_INSTANCED_SYSTEM_MEDIA_CONTROLS_FOR_WEB_APPS

ActiveMediaSessionController*
MediaKeysListenerManagerImpl::GetControllerForSystemMediaControls(
    system_media_controls::SystemMediaControls* system_media_controls) {}

}  // namespace content