0

multipaste: Finalize strings for clipboard history menu header

This CL adds string resources for the clipboard history menu header's
title and remove-all button. This CL also changes previous references to
a "clear-all" button to a "remove-all" button, in alignment with the
final string.

Title screenshot: https://screenshot.googleplex.com/6bHLuer9kf5GFA5
Button screenshot: https://screenshot.googleplex.com/BP7sV6evmVJMZE2

Fixed: b/267694214
Change-Id: I6033f77bc3ac8ab2ab02378b565479d17b99ca93
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4652788
Commit-Queue: Colin Kincaid <ckincaid@chromium.org>
Reviewed-by: David Black <dmblack@google.com>
Cr-Commit-Position: refs/heads/main@{#1163237}
This commit is contained in:
Colin Kincaid
2023-06-27 21:47:48 +00:00
committed by Chromium LUCI CQ
parent e7abc35134
commit 12903455b3
6 changed files with 30 additions and 18 deletions

@ -5929,6 +5929,12 @@ Here are some things you can try to get started.
<message name="IDS_ASH_CLIPBOARD_HISTORY_CONTROL_V_LONGPRESS_FOOTER" desc="The message used to educate users about the clipboard history menu that shows when they hold down Ctrl+V.">
Youll see the clipboard when you press and hold Ctrl + V. You can turn off this shortcut by disabling the #clipboard-history-longpress flag in chrome://flags (os://flags if using Lacros).
</message>
<message name="IDS_ASH_CLIPBOARD_HISTORY_HEADER_TITLE" desc="The title of the ChromeOS clipboard history menu, which shows the user's most recently copied items.">
Clipboard
</message>
<message name="IDS_ASH_CLIPBOARD_HISTORY_REMOVE_ALL_BUTTON" desc="The display text for a button in the top-right corner of the ChromeOS clipboard history menu. Users can activate this button to clear their clipboard history (remove all items from the menu).">
Remove all
</message>
<message name="IDS_ASH_MULTIPASTE_CONTEXTUAL_NUDGE" desc="The label used for the multipaste nudge, to be seen once the user copies and pastes multiple times in a short time span.">
Press <ph name="SHORTCUT_KEY_NAME">$1<ex>Launcher</ex></ph> + V to view your clipboard. The last 5 items you've copied are saved to your clipboard.
</message>

@ -0,0 +1 @@
3d6f5871422711f05a2b3d558fe1a3c6e26ae1b9

@ -0,0 +1 @@
798974722cd2bc714e60dbd5b7bdc4376c6f8e95

@ -84,8 +84,8 @@ bool IsFooterIndex(size_t index, size_t num_clipboard_history_items) {
: num_clipboard_history_items);
}
// Populates `container` with a menu title and clear-all button to appear at the
// top of the clipboard history menu.
// Populates `container` with a menu title and remove-all button to appear at
// the top of the clipboard history menu.
void InsertHeaderContent(views::MenuItemView* container) {
container->AddChildView(
views::Builder<views::BoxLayoutView>()
@ -101,18 +101,22 @@ void InsertHeaderContent(views::MenuItemView* container) {
}))
.AddChildren(
views::Builder<views::Label>(
bubble_utils::CreateLabel(TypographyToken::kCrosButton1,
u"[i18n] Clipboard",
cros_tokens::kCrosSysOnSurface))
bubble_utils::CreateLabel(
TypographyToken::kCrosButton1,
l10n_util::GetStringUTF16(
IDS_ASH_CLIPBOARD_HISTORY_HEADER_TITLE),
cros_tokens::kCrosSysOnSurface))
.SetID(clipboard_history_util::kMenuTitleViewID)
.SetHorizontalAlignment(gfx::ALIGN_LEFT)
.SetProperty(views::kFlexBehaviorKey,
views::FlexSpecification().WithWeight(1)),
views::Builder<views::Label>(
bubble_utils::CreateLabel(TypographyToken::kCrosButton2,
u"[i18n] Clear all",
cros_tokens::kCrosSysPrimary))
.SetID(clipboard_history_util::kClearAllButtonViewID))
bubble_utils::CreateLabel(
TypographyToken::kCrosButton2,
l10n_util::GetStringUTF16(
IDS_ASH_CLIPBOARD_HISTORY_REMOVE_ALL_BUTTON),
cros_tokens::kCrosSysPrimary))
.SetID(clipboard_history_util::kRemoveAllButtonViewID))
.Build());
}
@ -250,7 +254,7 @@ void ClipboardHistoryMenuModelAdapter::Run(
if (chromeos::features::IsClipboardHistoryRefreshEnabled()) {
// Add a placeholder non-interactive item that will contain the clipboard
// history menu's header, consisting of a title and a clear-all button.
// history menu's header, consisting of a title and a remove-all button.
model_->AddTitle(std::u16string());
}

@ -58,10 +58,10 @@ enum class Action {
// IDs for the views used by the clipboard history menu.
enum MenuViewID {
// We start at 1 because 0 is not a valid view ID.
kClearAllButtonViewID = 1,
kDeleteButtonViewID,
kDeleteButtonViewID = 1,
kMainButtonViewID,
kMenuTitleViewID,
kRemoveAllButtonViewID,
};
// Modes for specifying a clipboard history pause's semantics.

@ -1774,7 +1774,7 @@ class ClipboardHistoryRefreshEnabledBrowserTest
// Verifies that clicking the clipboard history menu's header does nothing and
// that tab and arrow key traversal pass over the header.
// TODO(http://b/267693860): Update this test when the clear-all button works.
// TODO(http://b/267693860): Update this test when the remove-all button works.
IN_PROC_BROWSER_TEST_F(ClipboardHistoryRefreshEnabledBrowserTest,
HeaderNotInteractive) {
// Write some things to the clipboard.
@ -1804,12 +1804,12 @@ IN_PROC_BROWSER_TEST_F(ClipboardHistoryRefreshEnabledBrowserTest,
EXPECT_TRUE(textfield_->GetText().empty());
EXPECT_TRUE(GetClipboardHistoryController()->IsMenuShowing());
// Verify that clicking on the header's clear-all button does nothing.
const auto* const clear_all_button =
header->GetViewByID(ash::clipboard_history_util::kClearAllButtonViewID);
ASSERT_TRUE(clear_all_button);
// Verify that clicking on the header's remove-all button does nothing.
const auto* const remove_all_button =
header->GetViewByID(ash::clipboard_history_util::kRemoveAllButtonViewID);
ASSERT_TRUE(remove_all_button);
GetEventGenerator()->MoveMouseTo(
clear_all_button->GetBoundsInScreen().CenterPoint());
remove_all_button->GetBoundsInScreen().CenterPoint());
GetEventGenerator()->ClickLeftButton();
EXPECT_TRUE(textfield_->GetText().empty());
EXPECT_TRUE(GetClipboardHistoryController()->IsMenuShowing());