chrome: win: Fix taskbar grouping of PiP and DevTools windows (fixes #3641)

This commit is contained in:
Marshall Greenblatt
2024-02-06 13:55:01 -05:00
parent 7dbf26919a
commit 1bfee76f5f
5 changed files with 46 additions and 1 deletions

View File

@ -141,6 +141,10 @@ class BrowserDelegate : public content::WebContentsDelegate {
// Called at the end of a fullscreen transition.
virtual void WindowFullscreenStateChanged() {}
// Returns true if this browser has a Views-hosted opener. Only
// applicable for Browsers of type picture_in_picture and devtools.
virtual bool HasViewsHostedOpener() const { return false; }
};
} // namespace cef

View File

@ -426,6 +426,12 @@ void ChromeBrowserDelegate::WindowFullscreenStateChanged() {
#endif
}
bool ChromeBrowserDelegate::HasViewsHostedOpener() const {
DCHECK(browser_->is_type_picture_in_picture() ||
browser_->is_type_devtools());
return opener_host_ && opener_host_->is_views_hosted();
}
void ChromeBrowserDelegate::WebContentsCreated(
content::WebContents* source_contents,
int opener_render_process_id,

View File

@ -81,6 +81,7 @@ class ChromeBrowserDelegate : public cef::BrowserDelegate {
const std::optional<SkRegion> GetDraggableRegion() const override;
void UpdateDraggableRegion(const SkRegion& region) override;
void WindowFullscreenStateChanged() override;
bool HasViewsHostedOpener() const override;
// WebContentsDelegate methods:
void WebContentsCreated(content::WebContents* source_contents,