diff --git a/ash/ash_strings.grd b/ash/ash_strings.grd index 2a2ddde52c17c..267caffeba046 100644 --- a/ash/ash_strings.grd +++ b/ash/ash_strings.grd @@ -2078,6 +2078,9 @@ Style notes: <message name="IDS_ASH_DESKS_CLOSE_ALL_UNDONE_NOTIFICATION" desc="ChromeVox announcement that is read when the user presses the button to undo desk removal."> Desk and windows reopened </message> + <message name="IDS_ASH_DESKS_NAME_HIGHLIGHT_NOTIFICATION" desc="Alert spoken by screen readers when user tabs to the name view of a virtual desk."> + Press enter or search + space to select the text for editing. + </message> <!-- Status tray charging strings. --> <message name="IDS_ASH_STATUS_TRAY_LOW_POWER_CHARGER_TITLE" desc="The title of a notification indicating that a low-current USB charger has been connected."> diff --git a/ash/ash_strings_grd/IDS_ASH_DESKS_NAME_HIGHLIGHT_NOTIFICATION.png.sha1 b/ash/ash_strings_grd/IDS_ASH_DESKS_NAME_HIGHLIGHT_NOTIFICATION.png.sha1 new file mode 100644 index 0000000000000..2fa38ced01237 --- /dev/null +++ b/ash/ash_strings_grd/IDS_ASH_DESKS_NAME_HIGHLIGHT_NOTIFICATION.png.sha1 @@ -0,0 +1 @@ +9e5746bd25e53c3cd96c4f5be6a6cb9b19068d59 \ No newline at end of file diff --git a/ash/wm/desks/desk_name_view.cc b/ash/wm/desks/desk_name_view.cc index 417573594a16c..dc6b2e84701fa 100644 --- a/ash/wm/desks/desk_name_view.cc +++ b/ash/wm/desks/desk_name_view.cc @@ -6,11 +6,14 @@ #include <memory> +#include "ash/accessibility/accessibility_controller_impl.h" #include "ash/shell.h" +#include "ash/strings/grit/ash_strings.h" #include "ash/wm/desks/desk_mini_view.h" #include "ash/wm/desks/desks_bar_view.h" #include "ash/wm/overview/overview_controller.h" #include "ash/wm/overview/overview_grid.h" +#include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/text_elider.h" #include "ui/views/focus/focus_manager.h" @@ -63,6 +66,16 @@ void DeskNameView::CommitChanges(views::Widget* widget) { } void DeskNameView::OnViewHighlighted() { + if (!HasFocus()) { + // When the highlight is the result of tabbing, as opposed to clicking or + // chromevoxing, the name view will not have focus, so the user should be + // told how to focus and edit the field. + Shell::Get() + ->accessibility_controller() + ->TriggerAccessibilityAlertWithMessage(l10n_util::GetStringUTF8( + IDS_ASH_DESKS_NAME_HIGHLIGHT_NOTIFICATION)); + } + DesksTextfield::OnViewHighlighted(); mini_view_->owner_bar()->ScrollToShowMiniViewIfNecessary(mini_view_); }