Commit ce533692 authored by Aaron Leventhal's avatar Aaron Leventhal Committed by Commit Bot

Accessible names for nameless focusable views in autofill code

This is split out from the CL to test all widgets and views for nameless
focusable objects. See crrev.com/c/951933.

Bug: 819350
Change-Id: I2e9a97939e502493e864fec9bb6b840338905a77
Reviewed-on: https://chromium-review.googlesource.com/952988
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541505}
parent c104ca88
...@@ -382,9 +382,13 @@ void CardUnmaskPromptViews::InitIfNecessary() { ...@@ -382,9 +382,13 @@ void CardUnmaskPromptViews::InitIfNecessary() {
// Add the month and year comboboxes if the expiration date is needed. // Add the month and year comboboxes if the expiration date is needed.
month_input_ = new views::Combobox(&month_combobox_model_); month_input_ = new views::Combobox(&month_combobox_model_);
month_input_->set_listener(this); month_input_->set_listener(this);
month_input_->SetAccessibleName(
l10n_util::GetStringUTF16(IDS_AUTOFILL_CARD_UNMASK_EXPIRATION_MONTH));
input_row_->AddChildView(month_input_); input_row_->AddChildView(month_input_);
year_input_ = new views::Combobox(&year_combobox_model_); year_input_ = new views::Combobox(&year_combobox_model_);
year_input_->set_listener(this); year_input_->set_listener(this);
year_input_->SetAccessibleName(
l10n_util::GetStringUTF16(IDS_AUTOFILL_CARD_UNMASK_EXPIRATION_YEAR));
input_row_->AddChildView(year_input_); input_row_->AddChildView(year_input_);
if (!controller_->ShouldRequestExpirationDate()) { if (!controller_->ShouldRequestExpirationDate()) {
month_input_->SetVisible(false); month_input_->SetVisible(false);
......
...@@ -486,7 +486,7 @@ void GenerateTestAutofillPopup( ...@@ -486,7 +486,7 @@ void GenerateTestAutofillPopup(
autofill_external_delegate->OnQuery(query_id, form, field, bounds); autofill_external_delegate->OnQuery(query_id, form, field, bounds);
std::vector<Suggestion> suggestions; std::vector<Suggestion> suggestions;
suggestions.push_back(Suggestion()); suggestions.push_back(Suggestion(base::ASCIIToUTF16("Test suggestion")));
autofill_external_delegate->OnSuggestionsReturned(query_id, suggestions); autofill_external_delegate->OnSuggestionsReturned(query_id, suggestions);
} }
......
...@@ -385,6 +385,12 @@ ...@@ -385,6 +385,12 @@
<message name="IDS_AUTOFILL_CARD_UNMASK_CONFIRM_BUTTON" desc="Text for button that confirms the credit card CVC entry dialog."> <message name="IDS_AUTOFILL_CARD_UNMASK_CONFIRM_BUTTON" desc="Text for button that confirms the credit card CVC entry dialog.">
Confirm Confirm
</message> </message>
<message name="IDS_AUTOFILL_CARD_UNMASK_EXPIRATION_MONTH" desc="Accessible name for card expiry month field.">
Month
</message>
<message name="IDS_AUTOFILL_CARD_UNMASK_EXPIRATION_YEAR" desc="Accessible name for card expiry year field.">
Year
</message>
<message name="IDS_AUTOFILL_CARD_UNMASK_VERIFICATION_IN_PROGRESS" desc="Message displayed while credit card is being verified." formatter_data="android_java"> <message name="IDS_AUTOFILL_CARD_UNMASK_VERIFICATION_IN_PROGRESS" desc="Message displayed while credit card is being verified." formatter_data="android_java">
Confirming card Confirming card
</message> </message>
......
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