Commit af4d8a1c authored by David Roger's avatar David Roger Committed by Chromium LUCI CQ

[signin] Increase the height of signin interception bubble

The bubble height is increased in the specific case of kMultiUser
interception, as the text has one additional sentence in this case.

In the future it would be better to dynamically compute the height based
on the length of the text (which would also work in all languages).

Old bubble:
https://drive.google.com/file/d/1ilF544B5X60F5zLgUa4Divy12ht53-4q/view?usp=sharing&resourcekey=0-jQav6k6ls8agZTv-9xbArQ

New bubble:
https://drive.google.com/file/d/1Ky_GEO_XZOsLs1fN1dWBAxM-U6SFnHKC/view?usp=sharing&resourcekey=0-2ZpvsBvEK2GFUKIts-6vpA

New bubble with longer text (might happen in some languages)
https://drive.google.com/file/d/1ssDop-Ympon0SHk_hbKq0rrca1gztyus/view?usp=sharing&resourcekey=0-aZlWPRfaynk9UnP9nTpfpQ

New bubble with shorter title (might happen in some languages/experiments)
https://drive.google.com/file/d/1ThMu_Vs6TOXSm3F1pA6w1TtVhbIACrhm/view?usp=sharing&resourcekey=0-Aosni3qizrPn02mN1Q7fcw

Change-Id: I7f68106a4bf088301601d7a19294eb066125750c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2627422Reviewed-by: default avatarMonica Basta <msalama@chromium.org>
Commit-Queue: David Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#843170}
parent 49940ecb
......@@ -32,8 +32,9 @@
#include "ui/views/widget/widget.h"
namespace {
constexpr int kInterceptionBubbleWithGuestHeight = 362;
constexpr int kInterceptionBubbleWithoutGuestHeight = 326;
constexpr int kInterceptionBubbleGuestFooterHeight = 36;
constexpr int kInterceptionBubbleExtraTextHeight = 30;
constexpr int kInterceptionBubbleWidth = 290;
} // namespace
......@@ -155,10 +156,16 @@ DiceWebSigninInterceptionBubbleView::DiceWebSigninInterceptionBubbleView(
std::unique_ptr<views::WebView> web_view =
std::make_unique<views::WebView>(profile);
web_view->LoadInitialURL(GURL(chrome::kChromeUIDiceWebSigninInterceptURL));
web_view->SetPreferredSize(gfx::Size(
kInterceptionBubbleWidth, bubble_parameters.show_guest_option
? kInterceptionBubbleWithGuestHeight
: kInterceptionBubbleWithoutGuestHeight));
int height = kInterceptionBubbleWithoutGuestHeight;
if (bubble_parameters.show_guest_option)
height += kInterceptionBubbleGuestFooterHeight;
if (bubble_parameters.interception_type ==
DiceWebSigninInterceptor::SigninInterceptionType::kMultiUser) {
// The kMultiUser bubble has a longer text, increase the height a bit.
// TODO: Dynamically compute the right size based on the text length.
height += kInterceptionBubbleExtraTextHeight;
}
web_view->SetPreferredSize(gfx::Size(kInterceptionBubbleWidth, height));
DiceWebSigninInterceptUI* web_ui = web_view->GetWebContents()
->GetWebUI()
->GetController()
......
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