Commit dfbfd505 authored by David Black's avatar David Black Committed by Commit Bot

Fix AssistantWebView.

AssistantWebView's child view for embedded WebContents was not being
sized during initialization due to a failed initialization condition
check.

Bug: b:135215741
Change-Id: I470daf60466baa3435c431f6256468c0cbc641ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1665776Reviewed-by: default avatarTao Wu <wutao@chromium.org>
Commit-Queue: David Black <dmblack@google.com>
Cr-Commit-Position: refs/heads/master@{#670278}
parent 6cd769a4
......@@ -145,6 +145,8 @@ void AssistantWebView::DidStopLoading() {
if (contents_view_initialized_)
return;
contents_view_initialized_ = true;
UpdateContentSize();
AddChildView(contents_->GetView()->view());
SetFocusBehavior(FocusBehavior::ALWAYS);
......@@ -153,8 +155,6 @@ void AssistantWebView::DidStopLoading() {
contents_->GetView()->native_view()->layer()->SetRoundedCornerRadius(
{/*top_left=*/0, /*top_right=*/0, /*bottom_right=*/kCornerRadiusDip,
/*bottom_left=*/kCornerRadiusDip});
contents_view_initialized_ = true;
}
void AssistantWebView::DidSuppressNavigation(const GURL& url,
......@@ -190,8 +190,7 @@ void AssistantWebView::OnUiVisibilityChanged(
void AssistantWebView::OnUsableWorkAreaChanged(
const gfx::Rect& usable_work_area) {
if (contents_)
UpdateContentSize();
UpdateContentSize();
}
void AssistantWebView::RemoveContents() {
......@@ -209,7 +208,7 @@ void AssistantWebView::RemoveContents() {
}
void AssistantWebView::UpdateContentSize() {
if (!contents_view_initialized_)
if (!contents_ || !contents_view_initialized_)
return;
const gfx::Size preferred_size = gfx::Size(
......
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