Commit b9c13dde authored by Thomas Lukaszewicz's avatar Thomas Lukaszewicz Committed by Commit Bot

Fixed activation bug for dialogs in BrowserViewLayout

Added an activation check to WebContentsModalDialogHostViews. This
check is necessary to ensure a created Dialog gets activation and
doesn't disappear behind the parent window.

Bug: 1058737
Change-Id: I4448e0c7334056a6c45120a675087ddf193b92b3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2098767
Commit-Queue: Thomas Lukaszewicz <tluk@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#753295}
parent 0aa64fa4
...@@ -89,6 +89,14 @@ class BrowserViewLayout::WebContentsModalDialogHostViews ...@@ -89,6 +89,14 @@ class BrowserViewLayout::WebContentsModalDialogHostViews
return gfx::Point(middle_x - size.width() / 2, top); return gfx::Point(middle_x - size.width() / 2, top);
} }
bool ShouldActivateDialog() const override {
// The browser Widget may be inactive if showing a bubble so instead check
// against the last active browser window when determining whether to
// activate the dialog.
return chrome::FindLastActive() ==
browser_view_layout_->browser_view_->browser();
}
gfx::Size GetMaximumDialogSize() override { gfx::Size GetMaximumDialogSize() override {
views::View* view = browser_view_layout_->contents_container_; views::View* view = browser_view_layout_->contents_container_;
gfx::Rect content_area = view->ConvertRectToWidget(view->GetLocalBounds()); gfx::Rect content_area = view->ConvertRectToWidget(view->GetLocalBounds());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment