saved_desks: Consolidate existing Desk Templates UI string
This consolidates existing Desk Templates UI strings for the use of Save and Recall. Bug: 1326175 Change-Id: I2e7199ba9056ac6f9330a694ed756e7c5f85fa6a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3650984 Commit-Queue: Yongshun Liu <yongshun@chromium.org> Reviewed-by: Daniel Andersson <dandersson@chromium.org> Cr-Commit-Position: refs/heads/main@{#1004334}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
f49aac9ca0
commit
3a86056966
ash
ash_strings.grd
ash_strings_grd
IDS_ASH_DESKS_TEMPLATES_DELETE_DESK_DIALOG_TITLE.png.sha1IDS_ASH_DESKS_TEMPLATES_DELETE_DIALOG_TITLE.png.sha1IDS_ASH_DESKS_TEMPLATES_DELETE_TEMPLATE_DIALOG_TITLE.png.sha1IDS_ASH_DESKS_TEMPLATES_DESK_TOO_LARGE_TOAST.png.sha1IDS_ASH_DESKS_TEMPLATES_REPLACE_DESK_DIALOG_DESCRIPTION.png.sha1IDS_ASH_DESKS_TEMPLATES_REPLACE_DESK_DIALOG_TITLE.png.sha1IDS_ASH_DESKS_TEMPLATES_REPLACE_DIALOG_DESCRIPTION.png.sha1IDS_ASH_DESKS_TEMPLATES_REPLACE_DIALOG_TITLE.png.sha1IDS_ASH_DESKS_TEMPLATES_REPLACE_TEMPLATE_DIALOG_DESCRIPTION.png.sha1IDS_ASH_DESKS_TEMPLATES_REPLACE_TEMPLATE_DIALOG_TITLE.png.sha1IDS_ASH_DESKS_TEMPLATES_TEMPLATE_TOO_LARGE_TOAST.png.sha1IDS_ASH_DESKS_TEMPLATES_UNSUPPORTED_APPS_DIALOG_TITLE.png.sha1IDS_ASH_DESKS_TEMPLATES_UNSUPPORTED_APPS_IN_DESK_DIALOG_TITLE.png.sha1IDS_ASH_DESKS_TEMPLATES_UNSUPPORTED_APPS_IN_TEMPLATE_DIALOG_TITLE.png.sha1
wm
@ -1799,15 +1799,24 @@ This file contains the strings for ash.
|
||||
<message name="IDS_ASH_DESKS_TEMPLATES_DELETE_DIALOG_CONFIRM_BUTTON" desc="The text of the confirm button of the desks templates delete dialog, which shows up when trying to delete a template.">
|
||||
Delete
|
||||
</message>
|
||||
<message name="IDS_ASH_DESKS_TEMPLATES_UNSUPPORTED_APPS_DIALOG_TITLE" desc="The text of the title of the desks templates unsupported apps dialog, which shows up when trying to save a desk that contains an unsupported app (i.e. Crostini app).">
|
||||
<message name="IDS_ASH_DESKS_TEMPLATES_UNSUPPORTED_APPS_IN_TEMPLATE_DIALOG_TITLE" desc="The text of the title of the desks templates unsupported apps dialog, which shows up when trying to save a desk that contains an unsupported app (i.e. Crostini app).">
|
||||
Unsupported apps in template
|
||||
</message>
|
||||
<message name="IDS_ASH_DESKS_TEMPLATES_REPLACE_DIALOG_TITLE" desc="The text of the title of the desks templates replace dialog, which shows up when trying to rename a template to the name of an existing template.">
|
||||
<message name="IDS_ASH_DESKS_TEMPLATES_UNSUPPORTED_APPS_IN_DESK_DIALOG_TITLE" desc="The text of the title of the saved desk unsupported apps dialog, which shows up when trying to save a desk that contains an unsupported app (i.e. Crostini app).">
|
||||
Unsupported apps in desk
|
||||
</message>
|
||||
<message name="IDS_ASH_DESKS_TEMPLATES_REPLACE_TEMPLATE_DIALOG_TITLE" desc="The text of the title of the desks templates replace dialog, which shows up when trying to rename a template to the name of an existing template.">
|
||||
Replace template?
|
||||
</message>
|
||||
<message name="IDS_ASH_DESKS_TEMPLATES_DELETE_DIALOG_TITLE" desc="The text of the title of the desks templates delete dialog, which shows up when trying to delete a template.">
|
||||
<message name="IDS_ASH_DESKS_TEMPLATES_REPLACE_DESK_DIALOG_TITLE" desc="The text of the title of the saved desk replace dialog, which shows up when trying to rename a saved desk to the name of an existing desk.">
|
||||
Replace saved desk?
|
||||
</message>
|
||||
<message name="IDS_ASH_DESKS_TEMPLATES_DELETE_TEMPLATE_DIALOG_TITLE" desc="The text of the title of the desks templates delete dialog, which shows up when trying to delete a template.">
|
||||
Delete template?
|
||||
</message>
|
||||
<message name="IDS_ASH_DESKS_TEMPLATES_DELETE_DESK_DIALOG_TITLE" desc="The text of the title of the saved desk delete dialog, which shows up when trying to delete a saved desk.">
|
||||
Delete saved desk?
|
||||
</message>
|
||||
<message name="IDS_ASH_DESKS_TEMPLATES_UNSUPPORTED_LACROS_DIALOG_DESCRIPTION" desc="The text of the description of the desks templates unsupported apps dialog, which shows up when trying to save a desk that contains an unsupported app (i.e. Crostini app).">
|
||||
Lacros windows aren't currently supported. Other apps will be saved.
|
||||
</message>
|
||||
@ -1820,9 +1829,12 @@ This file contains the strings for ash.
|
||||
<message name="IDS_ASH_DESKS_TEMPLATES_UNSUPPORTED_INCOGNITO_DIALOG_DESCRIPTION" desc="The text of the description of the desks templates unsupported apps dialog, which shows up when trying to save a desk that contains an unsupported app (i.e. Crostini app).">
|
||||
Incognito windows aren’t currently supported. Other apps will be saved.
|
||||
</message>
|
||||
<message name="IDS_ASH_DESKS_TEMPLATES_REPLACE_DIALOG_DESCRIPTION" desc="The text of the description of the desks templates replace dialog, which shows up when trying to rename a template to the name of an existing template.">
|
||||
<message name="IDS_ASH_DESKS_TEMPLATES_REPLACE_TEMPLATE_DIALOG_DESCRIPTION" desc="The text of the description of the desks templates replace dialog, which shows up when trying to rename a template to the name of an existing template.">
|
||||
Template named <ph name="DESK_TEMPLATE_NAME">$1<ex>Bento</ex></ph> already exists
|
||||
</message>
|
||||
<message name="IDS_ASH_DESKS_TEMPLATES_REPLACE_DESK_DIALOG_DESCRIPTION" desc="The text of the description of the desks templates replace dialog, which shows up when trying to rename a template to the name of an existing template.">
|
||||
A saved desk named <ph name="DESK_TEMPLATE_NAME">$1<ex>Bento</ex></ph> already exists
|
||||
</message>
|
||||
<message name="IDS_ASH_DESKS_TEMPLATES_DELETE_DIALOG_DESCRIPTION" desc="The text of the description of the desks templates delete dialog, which shows up when trying to delete a template.">
|
||||
<ph name="DESK_TEMPLATE_NAME">$1<ex>Bento</ex></ph> will be permanently deleted
|
||||
</message>
|
||||
@ -1877,6 +1889,9 @@ This file contains the strings for ash.
|
||||
<message name="IDS_ASH_DESKS_TEMPLATES_TEMPLATE_TOO_LARGE_TOAST" desc="The text of the toast displayed when user tries to save a template whose metadata would exceed the threshold for Chrome Sync. The template is not saved and this toast shows up instead.">
|
||||
Couldn’t save template. Too many windows or tabs.
|
||||
</message>
|
||||
<message name="IDS_ASH_DESKS_TEMPLATES_DESK_TOO_LARGE_TOAST" desc="The text of the toast displayed when user tries to save a desk whose metadata would exceed the threshold for Chrome Sync. The desk is not saved and this toast shows up instead.">
|
||||
Couldn’t save desk. Too many windows or tabs.
|
||||
</message>
|
||||
<message name="IDS_ASH_DESKS_TEMPLATES_MANAGEMENT_STATUS_DESCRIPTION" desc="The text of the description under template item if the desks templates is shared by the administrator.">
|
||||
Shared by your administrator
|
||||
</message>
|
||||
|
@ -0,0 +1 @@
|
||||
4c4964f2df4f33bfd27db8fdcb5749e7e0d407b2
|
@ -1 +0,0 @@
|
||||
f11199c826c60131aa8e7c5d21be3a14efb64769
|
@ -0,0 +1 @@
|
||||
07fcc0b7157418d6c7673018f195bd5e8e53ca82
|
@ -0,0 +1 @@
|
||||
f57df2c221ff78c8dabb363a84b540a6f32675c1
|
@ -0,0 +1 @@
|
||||
dac9eb90a5528d27551ce258a2e5ea7c9540d2fb
|
@ -0,0 +1 @@
|
||||
0f379266cfa48967506288d983353b7924b5260c
|
@ -1 +0,0 @@
|
||||
669c933a4d3587f55621af032adbd8084b5b6be4
|
@ -1 +0,0 @@
|
||||
669c933a4d3587f55621af032adbd8084b5b6be4
|
1
ash/ash_strings_grd/IDS_ASH_DESKS_TEMPLATES_REPLACE_TEMPLATE_DIALOG_DESCRIPTION.png.sha1
Normal file
1
ash/ash_strings_grd/IDS_ASH_DESKS_TEMPLATES_REPLACE_TEMPLATE_DIALOG_DESCRIPTION.png.sha1
Normal file
@ -0,0 +1 @@
|
||||
2382dbdc4560cc6adc2d2dfab94d97721cc8fcc3
|
@ -0,0 +1 @@
|
||||
f897d9a47bd99219dc4b14ac1191decb75ae3145
|
@ -1 +1 @@
|
||||
bb9a462178296eaa862c5835b747591a4ba0ef96
|
||||
fc43c0bddd97bc233c90bc68e29e4f1d937aa8cd
|
@ -1 +0,0 @@
|
||||
f11199c826c60131aa8e7c5d21be3a14efb64769
|
1
ash/ash_strings_grd/IDS_ASH_DESKS_TEMPLATES_UNSUPPORTED_APPS_IN_DESK_DIALOG_TITLE.png.sha1
Normal file
1
ash/ash_strings_grd/IDS_ASH_DESKS_TEMPLATES_UNSUPPORTED_APPS_IN_DESK_DIALOG_TITLE.png.sha1
Normal file
@ -0,0 +1 @@
|
||||
3770d753cb311c41b0f2e4fa1f09e124cce5a927
|
1
ash/ash_strings_grd/IDS_ASH_DESKS_TEMPLATES_UNSUPPORTED_APPS_IN_TEMPLATE_DIALOG_TITLE.png.sha1
Normal file
1
ash/ash_strings_grd/IDS_ASH_DESKS_TEMPLATES_UNSUPPORTED_APPS_IN_TEMPLATE_DIALOG_TITLE.png.sha1
Normal file
@ -0,0 +1 @@
|
||||
d251061648062754c440213be002099465a61c1d
|
@ -187,7 +187,10 @@ void SavedDeskDialogController::ShowUnsupportedAppsDialog(
|
||||
|
||||
auto dialog =
|
||||
views::Builder<SavedDeskDialog>()
|
||||
.SetTitleText(IDS_ASH_DESKS_TEMPLATES_UNSUPPORTED_APPS_DIALOG_TITLE)
|
||||
.SetTitleText(
|
||||
unsupported_apps_template_->type() == DeskTemplateType::kTemplate
|
||||
? IDS_ASH_DESKS_TEMPLATES_UNSUPPORTED_APPS_IN_TEMPLATE_DIALOG_TITLE
|
||||
: IDS_ASH_DESKS_TEMPLATES_UNSUPPORTED_APPS_IN_DESK_DIALOG_TITLE)
|
||||
.SetConfirmButtonText(
|
||||
IDS_ASH_DESKS_TEMPLATES_UNSUPPORTED_APPS_DIALOG_CONFIRM_BUTTON)
|
||||
.SetDescriptionText(l10n_util::GetStringUTF16(app_description_id))
|
||||
@ -221,31 +224,44 @@ void SavedDeskDialogController::ShowUnsupportedAppsDialog(
|
||||
void SavedDeskDialogController::ShowReplaceDialog(
|
||||
aura::Window* root_window,
|
||||
const std::u16string& template_name,
|
||||
DeskTemplateType template_type,
|
||||
base::OnceClosure on_accept_callback,
|
||||
base::OnceClosure on_cancel_callback) {
|
||||
auto dialog = views::Builder<SavedDeskDialog>()
|
||||
.SetTitleText(IDS_ASH_DESKS_TEMPLATES_REPLACE_DIALOG_TITLE)
|
||||
.SetConfirmButtonText(
|
||||
IDS_ASH_DESKS_TEMPLATES_REPLACE_DIALOG_CONFIRM_BUTTON)
|
||||
.SetDescriptionText(l10n_util::GetStringFUTF16(
|
||||
IDS_ASH_DESKS_TEMPLATES_REPLACE_DIALOG_DESCRIPTION,
|
||||
GetStringWithQuotes(template_name)))
|
||||
.SetDescriptionAccessibleName(l10n_util::GetStringFUTF16(
|
||||
IDS_ASH_DESKS_TEMPLATES_REPLACE_DIALOG_DESCRIPTION,
|
||||
template_name))
|
||||
.SetAcceptCallback(std::move(on_accept_callback))
|
||||
.SetCancelCallback(std::move(on_cancel_callback))
|
||||
.Build();
|
||||
auto dialog =
|
||||
views::Builder<SavedDeskDialog>()
|
||||
.SetTitleText(
|
||||
template_type == DeskTemplateType::kTemplate
|
||||
? IDS_ASH_DESKS_TEMPLATES_REPLACE_TEMPLATE_DIALOG_TITLE
|
||||
: IDS_ASH_DESKS_TEMPLATES_REPLACE_DESK_DIALOG_TITLE)
|
||||
.SetConfirmButtonText(
|
||||
IDS_ASH_DESKS_TEMPLATES_REPLACE_DIALOG_CONFIRM_BUTTON)
|
||||
.SetDescriptionText(l10n_util::GetStringFUTF16(
|
||||
template_type == DeskTemplateType::kTemplate
|
||||
? IDS_ASH_DESKS_TEMPLATES_REPLACE_TEMPLATE_DIALOG_DESCRIPTION
|
||||
: IDS_ASH_DESKS_TEMPLATES_REPLACE_DESK_DIALOG_DESCRIPTION,
|
||||
GetStringWithQuotes(template_name)))
|
||||
.SetDescriptionAccessibleName(l10n_util::GetStringFUTF16(
|
||||
template_type == DeskTemplateType::kTemplate
|
||||
? IDS_ASH_DESKS_TEMPLATES_REPLACE_TEMPLATE_DIALOG_DESCRIPTION
|
||||
: IDS_ASH_DESKS_TEMPLATES_REPLACE_DESK_DIALOG_DESCRIPTION,
|
||||
template_name))
|
||||
.SetAcceptCallback(std::move(on_accept_callback))
|
||||
.SetCancelCallback(std::move(on_cancel_callback))
|
||||
.Build();
|
||||
CreateDialogWidget(std::move(dialog), root_window);
|
||||
}
|
||||
|
||||
void SavedDeskDialogController::ShowDeleteDialog(
|
||||
aura::Window* root_window,
|
||||
const std::u16string& template_name,
|
||||
DeskTemplateType template_type,
|
||||
base::OnceClosure on_accept_callback) {
|
||||
auto dialog =
|
||||
views::Builder<SavedDeskDialog>()
|
||||
.SetTitleText(IDS_ASH_DESKS_TEMPLATES_DELETE_DIALOG_TITLE)
|
||||
.SetTitleText(
|
||||
template_type == DeskTemplateType::kTemplate
|
||||
? IDS_ASH_DESKS_TEMPLATES_DELETE_TEMPLATE_DIALOG_TITLE
|
||||
: IDS_ASH_DESKS_TEMPLATES_DELETE_DESK_DIALOG_TITLE)
|
||||
.SetButtonLabel(
|
||||
ui::DIALOG_BUTTON_OK,
|
||||
l10n_util::GetStringUTF16(
|
||||
|
@ -51,6 +51,7 @@ class ASH_EXPORT SavedDeskDialogController : public views::WidgetObserver {
|
||||
std::unique_ptr<DeskTemplate> desk_template);
|
||||
void ShowReplaceDialog(aura::Window* root_window,
|
||||
const std::u16string& template_name,
|
||||
DeskTemplateType template_type,
|
||||
base::OnceClosure on_accept_callback,
|
||||
base::OnceClosure on_cancel_callback);
|
||||
// Show the delete template dialog when user press the delete button.
|
||||
@ -58,6 +59,7 @@ class ASH_EXPORT SavedDeskDialogController : public views::WidgetObserver {
|
||||
// the dialog description.
|
||||
void ShowDeleteDialog(aura::Window* root_window,
|
||||
const std::u16string& template_name,
|
||||
DeskTemplateType template_type,
|
||||
base::OnceClosure on_accept_callback);
|
||||
|
||||
// views::WidgetObserver:
|
||||
|
@ -478,6 +478,7 @@ void SavedDeskItemView::MaybeShowReplaceDialog(
|
||||
aura::Window* root_window = GetWidget()->GetNativeWindow()->GetRootWindow();
|
||||
SavedDeskDialogController::Get()->ShowReplaceDialog(
|
||||
root_window, name_view_->GetText(),
|
||||
template_to_replace->desk_template_->type(),
|
||||
base::BindOnce(
|
||||
&SavedDeskItemView::ReplaceTemplate, weak_ptr_factory_.GetWeakPtr(),
|
||||
template_to_replace->desk_template_->uuid().AsLowercaseString()),
|
||||
@ -634,7 +635,7 @@ void SavedDeskItemView::OnDeleteButtonPressed() {
|
||||
auto* dialog_controller = SavedDeskDialogController::Get();
|
||||
dialog_controller->ShowDeleteDialog(
|
||||
GetWidget()->GetNativeWindow()->GetRootWindow(),
|
||||
name_view_->GetAccessibleName(),
|
||||
name_view_->GetAccessibleName(), desk_template_->type(),
|
||||
base::BindOnce(&SavedDeskItemView::OnDeleteTemplate,
|
||||
weak_ptr_factory_.GetWeakPtr()));
|
||||
}
|
||||
|
@ -334,10 +334,12 @@ void SavedDeskPresenter::OnAddOrUpdateEntry(
|
||||
desks_storage::DeskModel::AddOrUpdateEntryStatus::kEntryTooLarge) {
|
||||
// Show a toast if the template we tried to save was too large to be
|
||||
// transported through Chrome Sync.
|
||||
int toast_text_id = desk_template->type() == DeskTemplateType::kTemplate
|
||||
? IDS_ASH_DESKS_TEMPLATES_TEMPLATE_TOO_LARGE_TOAST
|
||||
: IDS_ASH_DESKS_TEMPLATES_DESK_TOO_LARGE_TOAST;
|
||||
ToastData toast_data(kTemplateTooLargeToastName,
|
||||
ToastCatalogName::kDeskTemplateTooLarge,
|
||||
l10n_util::GetStringUTF16(
|
||||
IDS_ASH_DESKS_TEMPLATES_TEMPLATE_TOO_LARGE_TOAST));
|
||||
l10n_util::GetStringUTF16(toast_text_id));
|
||||
ToastManager::Get()->Show(toast_data);
|
||||
return;
|
||||
}
|
||||
|
@ -744,6 +744,7 @@ TEST_F(SavedDeskTest, DialogSystemModal) {
|
||||
// Show one of the dialogs. Activating the dialog keeps us in overview mode.
|
||||
auto* dialog_controller = SavedDeskDialogController::Get();
|
||||
dialog_controller->ShowReplaceDialog(Shell::GetPrimaryRootWindow(), u"Bento",
|
||||
DeskTemplateType::kTemplate,
|
||||
base::DoNothing(), base::DoNothing());
|
||||
EXPECT_TRUE(Shell::IsSystemModalWindowOpen());
|
||||
ASSERT_TRUE(GetOverviewSession());
|
||||
@ -3026,9 +3027,9 @@ TEST_F(SavedDeskTest, ReplaceTemplateMetric) {
|
||||
auto callback = base::BindLambdaForTesting(
|
||||
[&]() { item_view->ReplaceTemplate(uuid_1.AsLowercaseString()); });
|
||||
|
||||
dialog_controller->ShowReplaceDialog(Shell::GetPrimaryRootWindow(),
|
||||
base::UTF8ToUTF16(name_1), callback,
|
||||
base::DoNothing());
|
||||
dialog_controller->ShowReplaceDialog(
|
||||
Shell::GetPrimaryRootWindow(), base::UTF8ToUTF16(name_1),
|
||||
DeskTemplateType::kTemplate, callback, base::DoNothing());
|
||||
EXPECT_TRUE(Shell::IsSystemModalWindowOpen());
|
||||
ASSERT_TRUE(GetOverviewSession());
|
||||
|
||||
|
Reference in New Issue
Block a user