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 ...@@ -41,7 +41,7 @@ class LocalCardMigrationBubbleControllerImpl
// Returns nullptr if no bubble is currently shown. // Returns nullptr if no bubble is currently shown.
LocalCardMigrationBubble* local_card_migration_bubble_view() const; LocalCardMigrationBubble* local_card_migration_bubble_view() const;
// LocalCardBubbleController: // LocalCardMigrationBubbleController:
void OnConfirmButtonClicked() override; void OnConfirmButtonClicked() override;
void OnCancelButtonClicked() override; void OnCancelButtonClicked() override;
void OnBubbleClosed() override; void OnBubbleClosed() override;
......
...@@ -84,7 +84,6 @@ int LocalCardMigrationBubbleViews::GetDialogButtons() const { ...@@ -84,7 +84,6 @@ int LocalCardMigrationBubbleViews::GetDialogButtons() const {
base::string16 LocalCardMigrationBubbleViews::GetDialogButtonLabel( base::string16 LocalCardMigrationBubbleViews::GetDialogButtonLabel(
ui::DialogButton button) const { ui::DialogButton button) const {
// TODO(crbug.com/859254): Update OK button label once mock is finalized.
return l10n_util::GetStringUTF16( return l10n_util::GetStringUTF16(
button == ui::DIALOG_BUTTON_OK button == ui::DIALOG_BUTTON_OK
? IDS_AUTOFILL_LOCAL_CARD_MIGRATION_BUBBLE_BUTTON_LABEL ? IDS_AUTOFILL_LOCAL_CARD_MIGRATION_BUBBLE_BUTTON_LABEL
...@@ -115,10 +114,12 @@ void LocalCardMigrationBubbleViews::AddedToWidget() { ...@@ -115,10 +114,12 @@ void LocalCardMigrationBubbleViews::AddedToWidget() {
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( auto* title =
l10n_util::GetStringUTF16(IDS_AUTOFILL_LOCAL_CARD_MIGRATION_BUBBLE_TITLE), new views::Label(GetWindowTitle(), views::style::CONTEXT_DIALOG_TITLE);
views::style::CONTEXT_DIALOG_TITLE);
title->SetHorizontalAlignment(gfx::ALIGN_LEFT); 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->SetMultiLine(true);
title_container->AddChildView(title); title_container->AddChildView(title);
...@@ -129,6 +130,12 @@ bool LocalCardMigrationBubbleViews::ShouldShowCloseButton() const { ...@@ -129,6 +130,12 @@ bool LocalCardMigrationBubbleViews::ShouldShowCloseButton() const {
return true; return true;
} }
base::string16 LocalCardMigrationBubbleViews::GetWindowTitle() const {
return controller_ ? l10n_util::GetStringUTF16(
IDS_AUTOFILL_LOCAL_CARD_MIGRATION_BUBBLE_TITLE)
: base::string16();
}
void LocalCardMigrationBubbleViews::WindowClosing() { void LocalCardMigrationBubbleViews::WindowClosing() {
if (controller_) { if (controller_) {
controller_->OnBubbleClosed(); controller_->OnBubbleClosed();
......
...@@ -43,6 +43,7 @@ class LocalCardMigrationBubbleViews : public LocalCardMigrationBubble, ...@@ -43,6 +43,7 @@ class LocalCardMigrationBubbleViews : public LocalCardMigrationBubble,
gfx::Size CalculatePreferredSize() const override; gfx::Size CalculatePreferredSize() const override;
void AddedToWidget() override; void AddedToWidget() override;
bool ShouldShowCloseButton() const override; bool ShouldShowCloseButton() const override;
base::string16 GetWindowTitle() const override;
void WindowClosing() override; void WindowClosing() override;
private: private:
...@@ -58,4 +59,4 @@ class LocalCardMigrationBubbleViews : public LocalCardMigrationBubble, ...@@ -58,4 +59,4 @@ class LocalCardMigrationBubbleViews : public LocalCardMigrationBubble,
} // namespace autofill } // namespace autofill
#endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_LOCAL_CARD_MIGRATION_BUBBLE_VIEWS_H_ #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_LOCAL_CARD_MIGRATION_BUBBLE_VIEWS_H_
\ No newline at end of file
...@@ -250,7 +250,7 @@ ...@@ -250,7 +250,7 @@
Google Pay logo Google Pay logo
</message> </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."> <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>
<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."> <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 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