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

Update the title text of migration bubble

The previous title has translation issue.

Bug: 897998
Change-Id: I59471c13de7c099bd8b7755d09c67d83e517f6b4
Reviewed-on: https://chromium-review.googlesource.com/c/1316835Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Commit-Queue: Siyu An <siyua@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605583}
parent e3ea2ae8
......@@ -41,7 +41,7 @@ class LocalCardMigrationBubbleControllerImpl
// Returns nullptr if no bubble is currently shown.
LocalCardMigrationBubble* local_card_migration_bubble_view() const;
// LocalCardBubbleController:
// LocalCardMigrationBubbleController:
void OnConfirmButtonClicked() override;
void OnCancelButtonClicked() override;
void OnBubbleClosed() override;
......
......@@ -84,7 +84,6 @@ int LocalCardMigrationBubbleViews::GetDialogButtons() const {
base::string16 LocalCardMigrationBubbleViews::GetDialogButtonLabel(
ui::DialogButton button) const {
// TODO(crbug.com/859254): Update OK button label once mock is finalized.
return l10n_util::GetStringUTF16(
button == ui::DIALOG_BUTTON_OK
? IDS_AUTOFILL_LOCAL_CARD_MIGRATION_BUBBLE_BUTTON_LABEL
......@@ -115,10 +114,12 @@ void LocalCardMigrationBubbleViews::AddedToWidget() {
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);
auto* title =
new views::Label(GetWindowTitle(), views::style::CONTEXT_DIALOG_TITLE);
title->SetHorizontalAlignment(gfx::ALIGN_LEFT);
// Need to set title's preferred size otherwise the long title
// would not be two-lined but would change the width of bubble.
title->SetPreferredSize(gfx::Size(0, 0));
title->SetMultiLine(true);
title_container->AddChildView(title);
......@@ -129,6 +130,12 @@ bool LocalCardMigrationBubbleViews::ShouldShowCloseButton() const {
return true;
}
base::string16 LocalCardMigrationBubbleViews::GetWindowTitle() const {
return controller_ ? l10n_util::GetStringUTF16(
IDS_AUTOFILL_LOCAL_CARD_MIGRATION_BUBBLE_TITLE)
: base::string16();
}
void LocalCardMigrationBubbleViews::WindowClosing() {
if (controller_) {
controller_->OnBubbleClosed();
......
......@@ -43,6 +43,7 @@ class LocalCardMigrationBubbleViews : public LocalCardMigrationBubble,
gfx::Size CalculatePreferredSize() const override;
void AddedToWidget() override;
bool ShouldShowCloseButton() const override;
base::string16 GetWindowTitle() const override;
void WindowClosing() override;
private:
......
......@@ -250,7 +250,7 @@
Google Pay logo
</message>
<message name="IDS_AUTOFILL_LOCAL_CARD_MIGRATION_BUBBLE_TITLE" desc="The title text for a bubble that offers users to start the process of migrating local cards to cloud.">
Save your cards to Google?
Save cards to your Google Account?
</message>
<message name="IDS_AUTOFILL_LOCAL_CARD_MIGRATION_BUBBLE_BUTTON_LABEL" desc="The text in the OK button of a bubble that offers users to start the process of migration local cards to cloud.">
Continue
......
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