diff --git a/chrome/browser/ui/autofill/local_card_migration_bubble_controller_impl.cc b/chrome/browser/ui/autofill/local_card_migration_bubble_controller_impl.cc index f22ec7a0ce9ec9..f6b86e9124f10e 100644 --- a/chrome/browser/ui/autofill/local_card_migration_bubble_controller_impl.cc +++ b/chrome/browser/ui/autofill/local_card_migration_bubble_controller_impl.cc @@ -164,7 +164,7 @@ void LocalCardMigrationBubbleControllerImpl::ShowBubbleImplementation() { Browser* browser = chrome::FindBrowserWithWebContents(web_contents()); local_card_migration_bubble_ = browser->window()->ShowLocalCardMigrationBubble(web_contents(), this, - true); + is_reshow_); DCHECK(local_card_migration_bubble_); UpdateIcon(); timer_.reset(new base::ElapsedTimer()); diff --git a/chrome/browser/ui/views/autofill/local_card_migration_bubble_views.cc b/chrome/browser/ui/views/autofill/local_card_migration_bubble_views.cc index da87d21abac6f4..8c146411a95795 100644 --- a/chrome/browser/ui/views/autofill/local_card_migration_bubble_views.cc +++ b/chrome/browser/ui/views/autofill/local_card_migration_bubble_views.cc @@ -108,6 +108,8 @@ void LocalCardMigrationBubbleViews::AddedToWidget() { kMigrationBubbleGooglePayLogoHeight); views::ImageView* icon_view = new views::ImageView(); icon_view->SetImage(&image); + icon_view->SetAccessibleName( + l10n_util::GetStringUTF16(IDS_AUTOFILL_GOOGLE_PAY_LOGO_ACCESSIBLE_NAME)); title_container->AddChildView(icon_view); GetBubbleFrameView()->SetTitleView(std::move(title_container)); } diff --git a/chrome/browser/ui/views/autofill/local_card_migration_dialog_view.cc b/chrome/browser/ui/views/autofill/local_card_migration_dialog_view.cc index 2cd1517551c043..94a47587cd916e 100644 --- a/chrome/browser/ui/views/autofill/local_card_migration_dialog_view.cc +++ b/chrome/browser/ui/views/autofill/local_card_migration_dialog_view.cc @@ -221,6 +221,8 @@ void LocalCardMigrationDialogView::Init() { std::unique_ptr image = std::make_unique(); image->SetImage(rb.GetImageSkiaNamed(GetHeaderImageId())); + image->SetAccessibleName( + l10n_util::GetStringUTF16(IDS_AUTOFILL_GOOGLE_PAY_LOGO_ACCESSIBLE_NAME)); image_container->AddChildView(image.release()); main_container->AddChildView(image_container.release()); diff --git a/chrome/browser/ui/views/autofill/migratable_card_view.cc b/chrome/browser/ui/views/autofill/migratable_card_view.cc index c8acad4d29cda2..338af4eacbb2ef 100644 --- a/chrome/browser/ui/views/autofill/migratable_card_view.cc +++ b/chrome/browser/ui/views/autofill/migratable_card_view.cc @@ -84,10 +84,14 @@ void MigratableCardView::Init( checkbox_ = new views::Checkbox(base::string16(), listener); checkbox_->SetChecked(true); checkbox_->set_tag(card_index); - checkbox_->SetVisible(true); // TODO(crbug/867194): Currently the ink drop animation circle is cut by the // border of scroll bar view. Find a way to adjust the format. checkbox_->SetInkDropMode(views::InkDropHostView::InkDropMode::OFF); + std::unique_ptr card_description = + std::make_unique( + migratable_credit_card.credit_card().NetworkAndLastFourDigits(), + views::style::CONTEXT_LABEL); + checkbox_->SetAssociatedLabel(card_description.get()); AddChildView(checkbox_); constexpr int kMigrationResultImageSize = 16; @@ -116,12 +120,10 @@ void MigratableCardView::Init( rb.GetImageNamed(CreditCard::IconResourceId( migratable_credit_card.credit_card().network())) .AsImageSkia()); + card_image->SetAccessibleName( + migratable_credit_card.credit_card().NetworkForDisplay()); card_network_and_last_four_digits->AddChildView(card_image.release()); - std::unique_ptr card_description = - std::make_unique( - migratable_credit_card.credit_card().NetworkAndLastFourDigits(), - views::style::CONTEXT_LABEL); card_network_and_last_four_digits->AddChildView(card_description.release()); std::unique_ptr card_expiration = diff --git a/components/autofill_strings.grdp b/components/autofill_strings.grdp index 9c93add1e5fd1b..040b934b54009d 100644 --- a/components/autofill_strings.grdp +++ b/components/autofill_strings.grdp @@ -252,6 +252,9 @@ + + Google Pay logo + Save all your cards in one place? diff --git a/ui/views/controls/image_view.cc b/ui/views/controls/image_view.cc index b1abacf1e0de95..0c18557823dbb9 100644 --- a/ui/views/controls/image_view.cc +++ b/ui/views/controls/image_view.cc @@ -138,9 +138,17 @@ void ImageView::OnPaint(gfx::Canvas* canvas) { OnPaintImage(canvas); } +void ImageView::SetAccessibleName(const base::string16& accessible_name) { + accessible_name_ = accessible_name; +} + +base::string16 ImageView::GetAccessibleName() const { + return accessible_name_; +} + void ImageView::GetAccessibleNodeData(ui::AXNodeData* node_data) { node_data->role = ax::mojom::Role::kImage; - node_data->SetName(tooltip_text_); + node_data->SetName(accessible_name_); } const char* ImageView::GetClassName() const { @@ -169,8 +177,11 @@ ImageView::Alignment ImageView::GetVerticalAlignment() const { return vertical_alignment_; } +// TODO(crbug.com/890465): Update the duplicate code here and in views::Button. void ImageView::SetTooltipText(const base::string16& tooltip) { tooltip_text_ = tooltip; + if (accessible_name_.empty()) + accessible_name_ = tooltip_text_; } base::string16 ImageView::GetTooltipText() const { diff --git a/ui/views/controls/image_view.h b/ui/views/controls/image_view.h index c3adf654e36aa3..b13e4940de735a 100644 --- a/ui/views/controls/image_view.h +++ b/ui/views/controls/image_view.h @@ -73,6 +73,10 @@ class VIEWS_EXPORT ImageView : public View { void SetTooltipText(const base::string16& tooltip); base::string16 GetTooltipText() const; + // Set / Get the accessible name text. + void SetAccessibleName(const base::string16& name); + base::string16 GetAccessibleName() const; + // Overriden from View: void OnPaint(gfx::Canvas* canvas) override; void GetAccessibleNodeData(ui::AXNodeData* node_data) override; @@ -120,6 +124,9 @@ class VIEWS_EXPORT ImageView : public View { // The current tooltip text. base::string16 tooltip_text_; + // The current accessible name text. + base::string16 accessible_name_; + // Scale last painted at. float last_paint_scale_;