saved_desks: Add Chromevox readout to grid item view
This is to add Chromebox readout to grid item view. Bug: 1328476 Change-Id: Ib112c79fbcf4162b0878d20d715d0adcc426244d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3662207 Commit-Queue: Yongshun Liu <yongshun@chromium.org> Reviewed-by: Daniel Andersson <dandersson@chromium.org> Reviewed-by: Mark Schillaci <mschillaci@google.com> Cr-Commit-Position: refs/heads/main@{#1007671}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
1799b6b011
commit
f312f5ee69
ash
ash_strings.grd
ash_strings_grd
IDS_ASH_DESKS_TEMPLATES_LIBRARY_SAVED_DESK_GRID_ITEM_EXTRA_ACCESSIBLE_DESCRIPTION.png.sha1IDS_ASH_DESKS_TEMPLATES_LIBRARY_SAVE_AND_RECALL_GRID_ITEM_ACCESSIBLE_NAME.png.sha1IDS_ASH_DESKS_TEMPLATES_LIBRARY_TEMPLATES_GRID_ITEM_ACCESSIBLE_NAME.png.sha1
wm
desks
chrome/browser/ash/accessibility
@ -1907,6 +1907,15 @@ This file contains the strings for ash.
|
||||
<message name="IDS_ASH_DESKS_TEMPLATES_LIBRARY_NO_DESKS_LABEL" desc="The text that shows in the saved desk library when there are no saved desks.">
|
||||
No saved desks
|
||||
</message>
|
||||
<message name="IDS_ASH_DESKS_TEMPLATES_LIBRARY_TEMPLATES_GRID_ITEM_ACCESSIBLE_NAME" desc="The full accessible name of template grid item">
|
||||
Template, <ph name="TEMPLATE_NAME">$1</ph>
|
||||
</message>
|
||||
<message name="IDS_ASH_DESKS_TEMPLATES_LIBRARY_SAVE_AND_RECALL_GRID_ITEM_ACCESSIBLE_NAME" desc="The full accessible name of save and recall grid item">
|
||||
Saved desk, <ph name="SAVE_AND_RECALL_DESK_NAME">$1</ph>
|
||||
</message>
|
||||
<message name="IDS_ASH_DESKS_TEMPLATES_LIBRARY_SAVED_DESK_GRID_ITEM_EXTRA_ACCESSIBLE_DESCRIPTION" desc="The extra accessible description of saved desk grid item">
|
||||
Press Ctrl+W to close
|
||||
</message>
|
||||
|
||||
<!-- Virtual Desks -->
|
||||
<message name="IDS_ASH_DESKS_NEW_DESK_BUTTON" desc="The label of the new virtual desk (a.k.a. workspaces) button.">
|
||||
|
1
ash/ash_strings_grd/IDS_ASH_DESKS_TEMPLATES_LIBRARY_SAVED_DESK_GRID_ITEM_EXTRA_ACCESSIBLE_DESCRIPTION.png.sha1
Normal file
1
ash/ash_strings_grd/IDS_ASH_DESKS_TEMPLATES_LIBRARY_SAVED_DESK_GRID_ITEM_EXTRA_ACCESSIBLE_DESCRIPTION.png.sha1
Normal file
@ -0,0 +1 @@
|
||||
221ae7039a68577a32f0ed4c733d142de65cafa8
|
1
ash/ash_strings_grd/IDS_ASH_DESKS_TEMPLATES_LIBRARY_SAVE_AND_RECALL_GRID_ITEM_ACCESSIBLE_NAME.png.sha1
Normal file
1
ash/ash_strings_grd/IDS_ASH_DESKS_TEMPLATES_LIBRARY_SAVE_AND_RECALL_GRID_ITEM_ACCESSIBLE_NAME.png.sha1
Normal file
@ -0,0 +1 @@
|
||||
ae9c08dd236659dd6e4a867a73642c614598fa13
|
1
ash/ash_strings_grd/IDS_ASH_DESKS_TEMPLATES_LIBRARY_TEMPLATES_GRID_ITEM_ACCESSIBLE_NAME.png.sha1
Normal file
1
ash/ash_strings_grd/IDS_ASH_DESKS_TEMPLATES_LIBRARY_TEMPLATES_GRID_ITEM_ACCESSIBLE_NAME.png.sha1
Normal file
@ -0,0 +1 @@
|
||||
44bd8f723cd85e4e7e4451a51cd80fbbc36579b9
|
@ -36,6 +36,7 @@
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/time/time.h"
|
||||
#include "chromeos/ui/vector_icons/vector_icons.h"
|
||||
#include "ui/accessibility/ax_enums.mojom.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
#include "ui/base/l10n/time_format.h"
|
||||
#include "ui/base/metadata/metadata_impl_macros.h"
|
||||
@ -339,6 +340,25 @@ void SavedDeskItemView::UpdateTemplate(const DeskTemplate& updated_template) {
|
||||
name_view_->OnContentsChanged();
|
||||
}
|
||||
|
||||
void SavedDeskItemView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
|
||||
int accessible_text_id =
|
||||
desk_template_->type() == DeskTemplateType::kTemplate
|
||||
? IDS_ASH_DESKS_TEMPLATES_LIBRARY_TEMPLATES_GRID_ITEM_ACCESSIBLE_NAME
|
||||
: IDS_ASH_DESKS_TEMPLATES_LIBRARY_SAVE_AND_RECALL_GRID_ITEM_ACCESSIBLE_NAME;
|
||||
|
||||
node_data->role = ax::mojom::Role::kButton;
|
||||
|
||||
node_data->AddStringAttribute(
|
||||
ax::mojom::StringAttribute::kName,
|
||||
l10n_util::GetStringFUTF8(accessible_text_id,
|
||||
desk_template_->template_name()));
|
||||
|
||||
node_data->AddStringAttribute(
|
||||
ax::mojom::StringAttribute::kDescription,
|
||||
l10n_util::GetStringUTF8(
|
||||
IDS_ASH_DESKS_TEMPLATES_LIBRARY_SAVED_DESK_GRID_ITEM_EXTRA_ACCESSIBLE_DESCRIPTION));
|
||||
}
|
||||
|
||||
void SavedDeskItemView::Layout() {
|
||||
views::View::Layout();
|
||||
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "ash/wm/overview/overview_highlightable_view.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "base/scoped_observation.h"
|
||||
#include "ui/accessibility/ax_node_data.h"
|
||||
#include "ui/base/metadata/metadata_header_macros.h"
|
||||
#include "ui/views/controls/button/button.h"
|
||||
#include "ui/views/controls/textfield/textfield_controller.h"
|
||||
@ -108,6 +109,7 @@ class ASH_EXPORT SavedDeskItemView : public views::Button,
|
||||
void UpdateTemplate(const DeskTemplate& updated_template);
|
||||
|
||||
// views::Button:
|
||||
void GetAccessibleNodeData(ui::AXNodeData* node_data) override;
|
||||
void Layout() override;
|
||||
void OnThemeChanged() override;
|
||||
void OnViewFocused(views::View* observed_view) override;
|
||||
|
@ -1740,8 +1740,10 @@ IN_PROC_BROWSER_TEST_F(DeskTemplatesSpokenFeedbackTest, DeskTemplatesBasic) {
|
||||
// has the same name as the desk it was created from, in this case the default
|
||||
// desk name is "Desk 1".
|
||||
sm_.Call([this]() { SendKeyPress(ui::VKEY_TAB); });
|
||||
sm_.ExpectSpeechPattern("Desk 1");
|
||||
sm_.ExpectSpeechPattern("Template, Desk 1");
|
||||
sm_.ExpectSpeech("Button");
|
||||
sm_.ExpectSpeech("Press Ctrl plus W to close");
|
||||
sm_.ExpectSpeech("Press Search plus Space to activate");
|
||||
|
||||
// The next item is the textfield inside the template card, which also has the
|
||||
// same name as the desk it was created from.
|
||||
|
Reference in New Issue
Block a user