From ee1e6aab3ef6755b4e3f13edc64ca6df6e629553 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Wed, 3 May 2023 15:55:47 +0200 Subject: [PATCH] chore: implement `WebContentsDelegate::GetFullscreenState` (#38141) Refs https://chromium-review.googlesource.com/c/chromium/src/+/4255184 --- shell/browser/api/electron_api_web_contents.cc | 6 ++++++ shell/browser/api/electron_api_web_contents.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/shell/browser/api/electron_api_web_contents.cc b/shell/browser/api/electron_api_web_contents.cc index 9fe4cc882c72..b901e0793bf5 100644 --- a/shell/browser/api/electron_api_web_contents.cc +++ b/shell/browser/api/electron_api_web_contents.cc @@ -3759,6 +3759,12 @@ bool WebContents::IsFullscreenForTabOrPending( return is_html_fullscreen() || (in_transition && is_html_transition); } +content::FullscreenState WebContents::GetFullscreenState( + const content::WebContents* source) const { + return exclusive_access_manager_->fullscreen_controller()->GetFullscreenState( + source); +} + bool WebContents::TakeFocus(content::WebContents* source, bool reverse) { if (source && source->GetOutermostWebContents() == source) { // If this is the outermost web contents and the user has tabbed or diff --git a/shell/browser/api/electron_api_web_contents.h b/shell/browser/api/electron_api_web_contents.h index bcd01b9c3f51..e524bceda032 100644 --- a/shell/browser/api/electron_api_web_contents.h +++ b/shell/browser/api/electron_api_web_contents.h @@ -696,6 +696,8 @@ class WebContents : public ExclusiveAccessContext, // content::WebContentsDelegate bool IsFullscreenForTabOrPending(const content::WebContents* source) override; + content::FullscreenState GetFullscreenState( + const content::WebContents* web_contents) const override; bool TakeFocus(content::WebContents* source, bool reverse) override; content::PictureInPictureResult EnterPictureInPicture( content::WebContents* web_contents) override;