Skip to content

Commit

Permalink
[Merge to M103] saved_desks: Update desk bar button text
Browse files Browse the repository at this point in the history
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

(cherry picked from commit 6fab7b9)

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-Original-Commit-Position: refs/heads/main@{#1003430}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3651051
Cr-Commit-Position: refs/branch-heads/5060@{#35}
Cr-Branched-From: b83393d-refs/heads/main@{#1002911}
  • Loading branch information
Yongshun Liu authored and Chromium LUCI CQ committed May 16, 2022
1 parent 092452d commit 5532573
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
7 changes: 5 additions & 2 deletions ash/ash_strings.grd
Original file line number Diff line number Diff line change
Expand Up @@ -1838,8 +1838,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
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a670acd2c94df92914932a6eea4bf65a7206d0cd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b8b6962fca8a99eb6e1f4ddb4d169e4ad633ef97
10 changes: 6 additions & 4 deletions ash/wm/desks/desks_bar_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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))));
}
Expand Down

0 comments on commit 5532573

Please sign in to comment.