Commit d288c3f8 authored by Jochen Eisinger's avatar Jochen Eisinger Committed by Commit Bot

Mark the HaTS dialog as child of the browser frame

Bug: 1051415
Change-Id: I2b535953f2fc90a755bd784ceeae2fb86dc9ba32
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2063002
Commit-Queue: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: default avatarWei Li <weili@chromium.org>
Cr-Commit-Position: refs/heads/master@{#743225}
parent 69cc020a
...@@ -105,6 +105,7 @@ gfx::NativeWindow CreateWebDialogWithBounds(gfx::NativeView parent, ...@@ -105,6 +105,7 @@ gfx::NativeWindow CreateWebDialogWithBounds(gfx::NativeView parent,
params.delegate = view; params.delegate = view;
params.bounds = bounds; params.bounds = bounds;
params.parent = parent; params.parent = parent;
params.child = true;
if (use_dialog_frame) { if (use_dialog_frame) {
params.opacity = views::Widget::InitParams::WindowOpacity::kTranslucent; params.opacity = views::Widget::InitParams::WindowOpacity::kTranslucent;
params.remove_standard_frame = true; params.remove_standard_frame = true;
......
...@@ -201,8 +201,10 @@ void HatsWebDialog::CreateWebDialog(Browser* browser) { ...@@ -201,8 +201,10 @@ void HatsWebDialog::CreateWebDialog(Browser* browser) {
BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser); BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser);
LocationBarView* location_bar = browser_view->GetLocationBarView(); LocationBarView* location_bar = browser_view->GetLocationBarView();
DCHECK(location_bar); DCHECK(location_bar);
gfx::Rect bounds(location_bar->bounds()); gfx::Point origin(location_bar->origin());
views::View::ConvertRectToScreen(browser_view->toolbar(), &bounds); views::View::ConvertPointToTarget(location_bar->parent(), browser_view,
&origin);
gfx::Rect bounds(origin, location_bar->size());
bounds = gfx::Rect( bounds = gfx::Rect(
bounds.x() + bounds.x() +
std::max(0, bounds.width() / 2 - kDefaultHatsDialogWidth / 2), std::max(0, bounds.width() / 2 - kDefaultHatsDialogWidth / 2),
......
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