#include "chrome/browser/picture_in_picture/auto_picture_in_picture_tab_helper.h"
#include "base/feature_list.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h"
#include "chrome/browser/media/webrtc/media_stream_capture_indicator.h"
#include "chrome/browser/permissions/permission_decision_auto_blocker_factory.h"
#include "chrome/browser/picture_in_picture/auto_picture_in_picture_tab_strip_observer_helper.h"
#include "chrome/browser/picture_in_picture/auto_pip_setting_helper.h"
#include "chrome/browser/picture_in_picture/picture_in_picture_window_manager.h"
#include "chrome/browser/profiles/profile.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/permissions/permission_decision_auto_blocker.h"
#include "content/public/browser/media_session.h"
#include "content/public/browser/media_session_service.h"
#include "media/base/media_switches.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "third_party/blink/public/common/frame/user_activation_state.h"
AutoPictureInPictureTabHelper::AutoPictureInPictureTabHelper(
content::WebContents* web_contents)
: … { … }
AutoPictureInPictureTabHelper::~AutoPictureInPictureTabHelper() = default;
bool AutoPictureInPictureTabHelper::HasAutoPictureInPictureBeenRegistered()
const { … }
void AutoPictureInPictureTabHelper::PrimaryPageChanged(content::Page& page) { … }
void AutoPictureInPictureTabHelper::MediaPictureInPictureChanged(
bool is_in_picture_in_picture) { … }
void AutoPictureInPictureTabHelper::MediaSessionCreated(
content::MediaSession* media_session) { … }
void AutoPictureInPictureTabHelper::OnTabActivatedChanged(
bool is_tab_activated) { … }
void AutoPictureInPictureTabHelper::OnFocusGained(
media_session::mojom::AudioFocusRequestStatePtr session) { … }
void AutoPictureInPictureTabHelper::OnFocusLost(
media_session::mojom::AudioFocusRequestStatePtr session) { … }
void AutoPictureInPictureTabHelper::MediaSessionInfoChanged(
media_session::mojom::MediaSessionInfoPtr session_info) { … }
void AutoPictureInPictureTabHelper::MediaSessionActionsChanged(
const std::vector<media_session::mojom::MediaSessionAction>& actions) { … }
void AutoPictureInPictureTabHelper::MaybeEnterAutoPictureInPicture() { … }
void AutoPictureInPictureTabHelper::EnterAutoPictureInPicture() { … }
void AutoPictureInPictureTabHelper::MaybeExitAutoPictureInPicture() { … }
void AutoPictureInPictureTabHelper::MaybeStartOrStopObservingTabStrip() { … }
bool AutoPictureInPictureTabHelper::IsEligibleForAutoPictureInPicture(
HasSufficientlyVisibleVideo has_sufficiently_visible_video) { … }
bool AutoPictureInPictureTabHelper::MeetsVideoPlaybackConditions(
HasSufficientlyVisibleVideo has_sufficiently_visible_video) const { … }
bool AutoPictureInPictureTabHelper::IsUsingCameraOrMicrophone() const { … }
ContentSetting AutoPictureInPictureTabHelper::GetCurrentContentSetting() const { … }
void AutoPictureInPictureTabHelper::MaybeGetVisibility() { … }
void AutoPictureInPictureTabHelper::GetVideoVisibility(
bool has_sufficiently_visible_video) { … }
void AutoPictureInPictureTabHelper::EnsureAutoPipSettingHelper() { … }
bool AutoPictureInPictureTabHelper::IsInAutoPictureInPicture() const { … }
bool AutoPictureInPictureTabHelper::AreAutoPictureInPicturePreconditionsMet()
const { … }
std::unique_ptr<AutoPipSettingOverlayView>
AutoPictureInPictureTabHelper::CreateOverlayPermissionViewIfNeeded(
base::OnceClosure close_pip_cb,
const gfx::Rect& browser_view_overridden_bounds,
views::View* anchor_view,
views::BubbleBorder::Arrow arrow) { … }
void AutoPictureInPictureTabHelper::OnUserClosedWindow() { … }
WEB_CONTENTS_USER_DATA_KEY_IMPL(AutoPictureInPictureTabHelper);