0

saved_desks: Update desk bar button text

In the desk bar, the button to show all saved templates and desks should
be updated based on the string doc. Button text should be as follows.
  1. `Saved for later`: When Desk Templates is off
  2. `Library`: When Desk Templates is on

Bug: 1324300
Change-Id: I6f7bef48164c8533a75615c341863529ae1fada5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3639705
Reviewed-by: Min Chen <minch@chromium.org>
Commit-Queue: Yongshun Liu <yongshun@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1003430}
This commit is contained in:
Yongshun Liu
2022-05-14 01:14:32 +00:00
committed by Chromium LUCI CQ
parent 36832288ef
commit 6fab7b9922
5 changed files with 13 additions and 7 deletions

@ -1844,8 +1844,11 @@ This file contains the strings for ash.
<message name="IDS_ASH_DESKS_TEMPLATES_MAX_SAVED_DESKS_TOOLTIP" desc="The disabled Save Desk for later button tooltip text when maximum number of saved desks has been reached.">
Only 6 saved desks allowed. Remove a desk to save a new one.
</message>
<message name="IDS_ASH_DESKS_TEMPLATES_DESKS_BAR_BUTTON" desc="The text of the desks templates button in the overview desks bar.">
Templates
<message name="IDS_ASH_DESKS_TEMPLATES_DESKS_BAR_BUTTON_LIBRARY" desc="The text of the desks templates button in the overview desks bar when Desk Templates is enabled.">
Library
</message>
<message name="IDS_ASH_DESKS_TEMPLATES_DESKS_BAR_BUTTON_SAVED_FOR_LATER" desc="The text of the desks templates button in the overview desks bar when Desk Templates is disabled.">
Saved for later
</message>
<message name="IDS_ASH_DESKS_TEMPLATES_SAVE_DESK_AS_TEMPLATE_BUTTON" desc="The text of the button to save the active desk as a template.">
Save desk as a template

@ -1 +0,0 @@
feca4c15053b65554d653dba5d1f17fc45129bdd

@ -0,0 +1 @@
a670acd2c94df92914932a6eea4bf65a7206d0cd

@ -0,0 +1 @@
b8b6962fca8a99eb6e1f4ddb4d169e4ad633ef97

@ -386,20 +386,22 @@ DesksBarView::DesksBarView(OverviewGrid* overview_grid)
base::Unretained(this),
DesksCreationRemovalSource::kButton)));
if (saved_desk_util::IsSavedDesksEnabled()) {
int button_text_id = IDS_ASH_DESKS_TEMPLATES_DESKS_BAR_BUTTON_LIBRARY;
if (!saved_desk_util::AreDesksTemplatesEnabled())
button_text_id = IDS_ASH_DESKS_TEMPLATES_DESKS_BAR_BUTTON_SAVED_FOR_LATER;
expanded_state_desks_templates_button_ =
scroll_view_contents_->AddChildView(
std::make_unique<ExpandedDesksBarButton>(
this, &kDesksTemplatesIcon,
l10n_util::GetStringUTF16(
IDS_ASH_DESKS_TEMPLATES_DESKS_BAR_BUTTON),
l10n_util::GetStringUTF16(button_text_id),
/*initially_enabled=*/true,
base::BindRepeating(
&DesksBarView::OnDesksTemplatesButtonPressed,
base::Unretained(this))));
zero_state_desks_templates_button_ = scroll_view_contents_->AddChildView(
std::make_unique<ZeroStateIconButton>(
&kDesksTemplatesIcon,
l10n_util::GetStringUTF16(IDS_ASH_DESKS_TEMPLATES_DESKS_BAR_BUTTON),
&kDesksTemplatesIcon, l10n_util::GetStringUTF16(button_text_id),
base::BindRepeating(&DesksBarView::OnDesksTemplatesButtonPressed,
base::Unretained(this))));
}