Commit afee794e authored by Meilin Wang's avatar Meilin Wang Committed by Commit Bot

Fix DCHECK failure caused by no width restriction on Assistant UI.

Temporarily fix the Assistant UI flyout off the screen to the left
when the container width grows larger than the screen width by explicitly
setting x-axis value of container to be positive. But the side effect
is when the screen is not wide enough, inside views will be clipped.
Since it doesn't always make sense to apply a width restriction on
Assistant UI to be less than the usable work area width (the workarea
could be extremely narrow depending on the physical size and resolution
combination), also the server side has assumptions about the card size,
we may need a more comprehensive solution to resize the views correctly.
In this CL, we just keep the 640 dip width assumption unchanged.

Test: local compile and manually test.
Bug: b:116807989
Change-Id: I257ac26cd28672ec284ff2555e46db5ab6a46246
Reviewed-on: https://chromium-review.googlesource.com/c/1250087Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
Commit-Queue: Meilin Wang <meilinw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604010}
parent b76d671a
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "ash/assistant/ui/assistant_container_view_animator_legacy_impl.h" #include "ash/assistant/ui/assistant_container_view_animator_legacy_impl.h"
#include <algorithm>
#include "ash/assistant/assistant_controller.h" #include "ash/assistant/assistant_controller.h"
#include "ash/assistant/assistant_ui_controller.h" #include "ash/assistant/assistant_ui_controller.h"
#include "ash/assistant/ui/assistant_container_view.h" #include "ash/assistant/ui/assistant_container_view.h"
...@@ -126,7 +128,7 @@ void AssistantContainerViewAnimatorLegacyImpl::AnimationProgressed( ...@@ -126,7 +128,7 @@ void AssistantContainerViewAnimatorLegacyImpl::AnimationProgressed(
bounds.set_size(gfx::Size(size.width(), size.height())); bounds.set_size(gfx::Size(size.width(), size.height()));
// Maintain original |center_x| and |bottom| positions. // Maintain original |center_x| and |bottom| positions.
bounds.set_x(center_x - (bounds.width() / 2)); bounds.set_x(std::max(center_x - (bounds.width() / 2), 0));
bounds.set_y(bottom - bounds.height()); bounds.set_y(bottom - bounds.height());
// Interpolate the correct corner radius. // Interpolate the correct corner radius.
......
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