post-login: set chips accessible names
This cl sets the accessible names for glanceables chips. The accessible names are the suggestion's title + subtitle. Add the accessible name for calendar event button. The examples are in the bug comment. BUG: b:351037084 Change-Id: I8dea50239f8c3808e43d25c5c7f2f2fca608ae27 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5703105 Commit-Queue: Xiaodan Zhu <zxdan@chromium.org> Reviewed-by: Sammie Quon <sammiequon@chromium.org> Cr-Commit-Position: refs/heads/main@{#1327015}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
9965d3010f
commit
44f65af65b
ash
@ -8356,6 +8356,9 @@ To shut down the device, press and hold the power button on the device again.
|
||||
<message name="IDS_ASH_BIRCH_CALENDAR_JOIN_BUTTON" desc="Button label for joining a meeting associated with a calendar event">
|
||||
Join
|
||||
</message>
|
||||
<message name="IDS_ASH_BIRCH_CALENDAR_JOIN_BUTTON_TOOLTIP" desc="Tooltip for the join button of a calendar event">
|
||||
Join with Google Meet
|
||||
</message>
|
||||
<message name="IDS_ASH_BIRCH_RECENT_TAB_SUBTITLE_YESTERDAY" desc="Subtitle for the suggestion chip with recent tabs from other devices shared yesterday">
|
||||
Yesterday
|
||||
</message>
|
||||
|
@ -0,0 +1 @@
|
||||
db02b4cbff6b0c4f0714aaa6a6b136af2f53f2ef
|
@ -14,6 +14,7 @@
|
||||
#include "ash/wm/overview/birch/birch_bar_controller.h"
|
||||
#include "ash/wm/overview/birch/birch_chip_context_menu_model.h"
|
||||
#include "base/types/cxx23_to_underlying.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
#include "ui/base/metadata/metadata_impl_macros.h"
|
||||
#include "ui/chromeos/styles/cros_tokens_color_mappings.h"
|
||||
#include "ui/events/types/event_type.h"
|
||||
@ -170,8 +171,6 @@ BirchChipButton::BirchChipButton()
|
||||
// Build up the chip's contents.
|
||||
views::Builder<BirchChipButtonBase>(this)
|
||||
.SetLayoutManager(std::move(flex_layout))
|
||||
// TODO(zxdan): verbalize all the contents in following changes.
|
||||
.SetAccessibleName(u"Birch Chip")
|
||||
.AddChildren(
|
||||
// Icon.
|
||||
views::Builder<views::ImageView>().CopyAddressTo(&icon_).SetProperty(
|
||||
@ -222,11 +221,15 @@ void BirchChipButton::Init(BirchItem* item) {
|
||||
base::Unretained(item_)),
|
||||
*item_->secondary_action(), PillButton::Type::kSecondaryWithoutIcon));
|
||||
button->SetProperty(views::kMarginsKey, gfx::Insets::VH(0, 16));
|
||||
button->SetTooltipText(
|
||||
l10n_util::GetStringUTF16(IDS_ASH_BIRCH_CALENDAR_JOIN_BUTTON_TOOLTIP));
|
||||
}
|
||||
|
||||
StylizeIconForItemType(icon_, item_->GetType());
|
||||
item_->LoadIcon(base::BindOnce(&BirchChipButton::SetIconImage,
|
||||
weak_factory_.GetWeakPtr()));
|
||||
|
||||
SetAccessibleName(item_->title() + u" " + item_->subtitle());
|
||||
}
|
||||
|
||||
const BirchItem* BirchChipButton::GetItem() const {
|
||||
|
Reference in New Issue
Block a user