Commit b1405602 authored by siyua's avatar siyua Committed by Commit Bot

Moved the title of migration bubble from body to title container.

Bug: 897998
Change-Id: I39e0595288a4d9441fc2452b2d47b4f430a4d0cb
Reviewed-on: https://chromium-review.googlesource.com/c/1298083
Commit-Queue: Siyu An <siyua@chromium.org>
Reviewed-by: default avatarBret Sepulveda <bsep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#602527}
parent b6ff8a6b
......@@ -28,6 +28,7 @@
#include "ui/views/controls/button/label_button.h"
#include "ui/views/controls/label.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/layout/fill_layout.h"
#include "ui/views/style/typography.h"
namespace autofill {
......@@ -100,17 +101,28 @@ gfx::Size LocalCardMigrationBubbleViews::CalculatePreferredSize() const {
void LocalCardMigrationBubbleViews::AddedToWidget() {
auto title_container = std::make_unique<views::View>();
title_container->SetLayoutManager(
std::make_unique<views::BoxLayout>(views::BoxLayout::kHorizontal));
title_container->SetLayoutManager(std::make_unique<views::BoxLayout>(
views::BoxLayout::kVertical, gfx::Insets(),
ChromeLayoutProvider::Get()->GetDistanceMetric(
DISTANCE_RELATED_CONTROL_VERTICAL_SMALL)));
gfx::ImageSkia image = gfx::ImageSkiaOperations::CreateTiledImage(
gfx::CreateVectorIcon(kGooglePayLogoIcon, gfx::kPlaceholderColor),
/*x=*/0, /*y=*/0, kMigrationBubbleGooglePayLogoWidth,
kMigrationBubbleGooglePayLogoHeight);
views::ImageView* icon_view = new views::ImageView();
icon_view->SetImage(&image);
icon_view->SetHorizontalAlignment(views::ImageView::LEADING);
icon_view->SetAccessibleName(
l10n_util::GetStringUTF16(IDS_AUTOFILL_GOOGLE_PAY_LOGO_ACCESSIBLE_NAME));
title_container->AddChildView(icon_view);
auto* title = new views::Label(
l10n_util::GetStringUTF16(IDS_AUTOFILL_LOCAL_CARD_MIGRATION_BUBBLE_TITLE),
views::style::CONTEXT_DIALOG_TITLE);
title->SetHorizontalAlignment(gfx::ALIGN_LEFT);
title->SetMultiLine(true);
title_container->AddChildView(title);
GetBubbleFrameView()->SetTitleView(std::move(title_container));
}
......@@ -128,18 +140,7 @@ void LocalCardMigrationBubbleViews::WindowClosing() {
LocalCardMigrationBubbleViews::~LocalCardMigrationBubbleViews() {}
void LocalCardMigrationBubbleViews::Init() {
SetLayoutManager(std::make_unique<views::BoxLayout>(
views::BoxLayout::kVertical, gfx::Insets(),
ChromeLayoutProvider::Get()->GetDistanceMetric(
DISTANCE_RELATED_CONTROL_VERTICAL_SMALL)));
auto* title = new views::Label(
l10n_util::GetStringUTF16(IDS_AUTOFILL_LOCAL_CARD_MIGRATION_BUBBLE_TITLE),
views::style::CONTEXT_DIALOG_TITLE);
title->SetHorizontalAlignment(gfx::ALIGN_LEFT);
title->SetMultiLine(true);
AddChildView(title);
SetLayoutManager(std::make_unique<views::FillLayout>());
auto* explanatory_message = new views::Label(
l10n_util::GetStringUTF16(
IDS_AUTOFILL_LOCAL_CARD_MIGRATION_BUBBLE_BODY_TEXT),
......
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