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 @@ ...@@ -28,6 +28,7 @@
#include "ui/views/controls/button/label_button.h" #include "ui/views/controls/button/label_button.h"
#include "ui/views/controls/label.h" #include "ui/views/controls/label.h"
#include "ui/views/layout/box_layout.h" #include "ui/views/layout/box_layout.h"
#include "ui/views/layout/fill_layout.h"
#include "ui/views/style/typography.h" #include "ui/views/style/typography.h"
namespace autofill { namespace autofill {
...@@ -100,17 +101,28 @@ gfx::Size LocalCardMigrationBubbleViews::CalculatePreferredSize() const { ...@@ -100,17 +101,28 @@ gfx::Size LocalCardMigrationBubbleViews::CalculatePreferredSize() const {
void LocalCardMigrationBubbleViews::AddedToWidget() { void LocalCardMigrationBubbleViews::AddedToWidget() {
auto title_container = std::make_unique<views::View>(); auto title_container = std::make_unique<views::View>();
title_container->SetLayoutManager( title_container->SetLayoutManager(std::make_unique<views::BoxLayout>(
std::make_unique<views::BoxLayout>(views::BoxLayout::kHorizontal)); views::BoxLayout::kVertical, gfx::Insets(),
ChromeLayoutProvider::Get()->GetDistanceMetric(
DISTANCE_RELATED_CONTROL_VERTICAL_SMALL)));
gfx::ImageSkia image = gfx::ImageSkiaOperations::CreateTiledImage( gfx::ImageSkia image = gfx::ImageSkiaOperations::CreateTiledImage(
gfx::CreateVectorIcon(kGooglePayLogoIcon, gfx::kPlaceholderColor), gfx::CreateVectorIcon(kGooglePayLogoIcon, gfx::kPlaceholderColor),
/*x=*/0, /*y=*/0, kMigrationBubbleGooglePayLogoWidth, /*x=*/0, /*y=*/0, kMigrationBubbleGooglePayLogoWidth,
kMigrationBubbleGooglePayLogoHeight); kMigrationBubbleGooglePayLogoHeight);
views::ImageView* icon_view = new views::ImageView(); views::ImageView* icon_view = new views::ImageView();
icon_view->SetImage(&image); icon_view->SetImage(&image);
icon_view->SetHorizontalAlignment(views::ImageView::LEADING);
icon_view->SetAccessibleName( icon_view->SetAccessibleName(
l10n_util::GetStringUTF16(IDS_AUTOFILL_GOOGLE_PAY_LOGO_ACCESSIBLE_NAME)); l10n_util::GetStringUTF16(IDS_AUTOFILL_GOOGLE_PAY_LOGO_ACCESSIBLE_NAME));
title_container->AddChildView(icon_view); 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)); GetBubbleFrameView()->SetTitleView(std::move(title_container));
} }
...@@ -128,18 +140,7 @@ void LocalCardMigrationBubbleViews::WindowClosing() { ...@@ -128,18 +140,7 @@ void LocalCardMigrationBubbleViews::WindowClosing() {
LocalCardMigrationBubbleViews::~LocalCardMigrationBubbleViews() {} LocalCardMigrationBubbleViews::~LocalCardMigrationBubbleViews() {}
void LocalCardMigrationBubbleViews::Init() { void LocalCardMigrationBubbleViews::Init() {
SetLayoutManager(std::make_unique<views::BoxLayout>( SetLayoutManager(std::make_unique<views::FillLayout>());
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);
auto* explanatory_message = new views::Label( auto* explanatory_message = new views::Label(
l10n_util::GetStringUTF16( l10n_util::GetStringUTF16(
IDS_AUTOFILL_LOCAL_CARD_MIGRATION_BUBBLE_BODY_TEXT), 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