fix: HTML fullscreen request for sub frames (#18736)

Don't re-enter fullscreen if there is a pending operation,
for subframe fullscreen request `EnterFullScreenModeForTab`
will be called for both the frame in question as well as
the outer webContents hosting it.
This commit is contained in:
Robo 2019-06-13 14:02:56 -07:00 committed by Shelley Vohr
parent 9856e5df3b
commit 5e320291b4
4 changed files with 16 additions and 2 deletions

View file

@ -68,6 +68,10 @@ class CommonWebContentsDelegate : public content::WebContentsDelegate,
bool is_html_fullscreen() const { return html_fullscreen_; }
void set_fullscreen_frame(content::RenderFrameHost* rfh) {
fullscreen_frame_ = rfh;
}
protected:
#if BUILDFLAG(ENABLE_OSR)
virtual OffScreenWebContentsView* GetOffScreenWebContentsView() const;
@ -201,6 +205,9 @@ class CommonWebContentsDelegate : public content::WebContentsDelegate,
scoped_refptr<base::SequencedTaskRunner> file_task_runner_;
// Stores the frame thats currently in fullscreen, nullptr if there is none.
content::RenderFrameHost* fullscreen_frame_ = nullptr;
base::WeakPtrFactory<CommonWebContentsDelegate> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(CommonWebContentsDelegate);