Commit a7cdaba4 authored by Henrique Grandinetti's avatar Henrique Grandinetti Committed by Commit Bot

[A11y] Announce parent access dialog title

Bug: 974002
Change-Id: I8658537c9557d686ab46bc2d57129cb74e23806b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1679136Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Commit-Queue: Henrique Grandinetti <hgrandinetti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#672640}
parent de1a884a
...@@ -133,6 +133,10 @@ base::string16 GetDescription(ParentAccessRequestReason reason) { ...@@ -133,6 +133,10 @@ base::string16 GetDescription(ParentAccessRequestReason reason) {
return l10n_util::GetStringUTF16(description_id); return l10n_util::GetStringUTF16(description_id);
} }
base::string16 GetAccessibleTitle() {
return l10n_util::GetStringUTF16(IDS_ASH_LOGIN_PARENT_ACCESS_DIALOG_NAME);
}
// Accessible input field. Customizes field description and focus behavior. // Accessible input field. Customizes field description and focus behavior.
class AccessibleInputField : public views::Textfield { class AccessibleInputField : public views::Textfield {
public: public:
...@@ -634,6 +638,10 @@ views::View* ParentAccessView::GetInitiallyFocusedView() { ...@@ -634,6 +638,10 @@ views::View* ParentAccessView::GetInitiallyFocusedView() {
return access_code_view_; return access_code_view_;
} }
base::string16 ParentAccessView::GetAccessibleWindowTitle() const {
return GetAccessibleTitle();
}
void ParentAccessView::ButtonPressed(views::Button* sender, void ParentAccessView::ButtonPressed(views::Button* sender,
const ui::Event& event) { const ui::Event& event) {
if (sender == back_button_) { if (sender == back_button_) {
...@@ -724,8 +732,7 @@ void ParentAccessView::OnInputChange(bool complete) { ...@@ -724,8 +732,7 @@ void ParentAccessView::OnInputChange(bool complete) {
void ParentAccessView::GetAccessibleNodeData(ui::AXNodeData* node_data) { void ParentAccessView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
views::View::GetAccessibleNodeData(node_data); views::View::GetAccessibleNodeData(node_data);
node_data->role = ax::mojom::Role::kDialog; node_data->role = ax::mojom::Role::kDialog;
node_data->SetName( node_data->SetName(GetAccessibleTitle());
l10n_util::GetStringUTF16(IDS_ASH_LOGIN_PARENT_ACCESS_DIALOG_NAME));
} }
} // namespace ash } // namespace ash
...@@ -98,6 +98,7 @@ class ASH_EXPORT ParentAccessView : public views::DialogDelegateView, ...@@ -98,6 +98,7 @@ class ASH_EXPORT ParentAccessView : public views::DialogDelegateView,
// views::DialogDelegateView: // views::DialogDelegateView:
ui::ModalType GetModalType() const override; ui::ModalType GetModalType() const override;
views::View* GetInitiallyFocusedView() override; views::View* GetInitiallyFocusedView() override;
base::string16 GetAccessibleWindowTitle() const override;
// views::ButtonListener: // views::ButtonListener:
void ButtonPressed(views::Button* sender, const ui::Event& event) override; void ButtonPressed(views::Button* sender, const ui::Event& event) override;
......
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