Commit 280480c6 authored by Meilin Wang's avatar Meilin Wang Committed by Commit Bot

Add meaningful title of Assistant for screen reader users.

Add an accessible window title called "Assistant" for Assistant container
view, thus ChromeVox can read the window title when invoking multilayered
shortcut:Search + a > w.

Bug: 910559
Test: local compile and manually test.
Change-Id: Ia71e08567cf448abce1e9a5d59b9fe50f34be8a2
Reviewed-on: https://chromium-review.googlesource.com/c/1357650
Commit-Queue: Meilin Wang <meilinw@chromium.org>
Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#613291}
parent 4f51d5d7
......@@ -1697,6 +1697,9 @@ This file contains the strings for ash.
</message>
<!-- Assistant -->
<message name="IDS_ASH_ASSISTANT_WINDOW" desc="The accessible description of the Assistant window.">
Assistant
</message>
<message name="IDS_ASH_ASSISTANT_DIALOG_PLATE_HINT" desc="Message shown as a placeholder in Assistant's input textfield when empty.">
Type a message
</message>
......
......@@ -15,10 +15,12 @@
#include "ash/assistant/ui/assistant_ui_constants.h"
#include "ash/assistant/ui/assistant_web_view.h"
#include "ash/shell.h"
#include "ash/strings/grit/ash_strings.h"
#include "base/logging.h"
#include "base/strings/utf_string_conversions.h"
#include "ui/aura/window.h"
#include "ui/aura/window_targeter.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
#include "ui/gfx/animation/tween.h"
......@@ -214,6 +216,10 @@ ax::mojom::Role AssistantContainerView::GetAccessibleWindowRole() const {
return ax::mojom::Role::kWindow;
}
base::string16 AssistantContainerView::GetAccessibleWindowTitle() const {
return l10n_util::GetStringUTF16(IDS_ASH_ASSISTANT_WINDOW);
}
int AssistantContainerView::GetDialogButtons() const {
return ui::DIALOG_BUTTON_NONE;
}
......
......@@ -39,6 +39,7 @@ class AssistantContainerView : public views::BubbleDialogDelegateView,
const char* GetClassName() const override;
void AddedToWidget() override;
ax::mojom::Role GetAccessibleWindowRole() const override;
base::string16 GetAccessibleWindowTitle() const override;
int GetDialogButtons() const override;
views::FocusTraversable* GetFocusTraversable() override;
void ChildPreferredSizeChanged(views::View* child) 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