Commit dc95faf8 authored by David Black's avatar David Black Committed by Commit Bot

Update holding space strings.

Aligning holding space strings with latest spec.

Bug: 1128731
Change-Id: Ib99e74abea9898f600b6b752ac8c8018e8f85a67
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2432364Reviewed-by: default avatarAhmed Mehfooz <amehfooz@chromium.org>
Commit-Queue: David Black <dmblack@google.com>
Cr-Commit-Position: refs/heads/master@{#810808}
parent d79d4189
......@@ -949,11 +949,14 @@ This file contains the strings for ash.
</message>
<!-- Holding space tray-->
<message name="IDS_ASH_HOLDING_SPACE_TITLE" desc="Title of the holding space tray and bubble.">
Recent screenshots and downloads
</message>
<message name="IDS_ASH_HOLDING_SPACE_PINNED_TITLE" desc="Title of the pinned files area in the holding space bubble.">
Pinned
</message>
<message name="IDS_ASH_HOLDING_SPACE_RECENT_DOWNLOADS_TITLE" desc="Title of the recent downloads area in the holding space bubble.">
Recent downloads
<message name="IDS_ASH_HOLDING_SPACE_DOWNLOADS_TITLE" desc="Title of the downloads area in the holding space bubble.">
Downloads
</message>
<message name="IDS_ASH_HOLDING_SPACE_SCREENSHOTS_TITLE" desc="Title of the screenshots area in the holding space bubble.">
Screenshots
......
17b48007b77400c70eb2d72aef10c82860f53bd9
\ No newline at end of file
85c7fe7a8351346a4e7a66ce9ce589976679acdc
\ No newline at end of file
3d51f195238e492424d4f82be8e05a12c79e420e
\ No newline at end of file
......@@ -54,10 +54,9 @@ void SetupChildLayer(views::View* child) {
HoldingSpaceTray::HoldingSpaceTray(Shelf* shelf) : TrayBackgroundView(shelf) {
SetLayoutManager(std::make_unique<views::FillLayout>());
icon_ = tray_container()->AddChildView(std::make_unique<views::ImageView>());
icon_->SetTooltipText(
l10n_util::GetStringUTF16(IDS_ASH_HOLDING_SPACE_SCREENSHOTS_TITLE));
icon_ = tray_container()->AddChildView(std::make_unique<views::ImageView>());
icon_->SetTooltipText(l10n_util::GetStringUTF16(IDS_ASH_HOLDING_SPACE_TITLE));
icon_->SetImage(CreateVectorIcon(kHoldingSpaceIcon,
ShelfConfig::Get()->shelf_icon_color()));
......@@ -84,12 +83,11 @@ void HoldingSpaceTray::ClickedOutsideBubble() {
}
base::string16 HoldingSpaceTray::GetAccessibleNameForTray() {
return l10n_util::GetStringUTF16(IDS_ASH_HOLDING_SPACE_SCREENSHOTS_TITLE);
return l10n_util::GetStringUTF16(IDS_ASH_HOLDING_SPACE_TITLE);
}
void HoldingSpaceTray::HandleLocaleChange() {
icon_->SetTooltipText(
l10n_util::GetStringUTF16(IDS_ASH_HOLDING_SPACE_SCREENSHOTS_TITLE));
icon_->SetTooltipText(l10n_util::GetStringUTF16(IDS_ASH_HOLDING_SPACE_TITLE));
}
void HoldingSpaceTray::HideBubbleWithView(const TrayBubbleView* bubble_view) {}
......
......@@ -55,12 +55,12 @@ RecentFilesContainer::RecentFilesContainer(
gfx::Insets(/*top=*/0, /*left=*/0, /*bottom=*/0,
/*right=*/kHoldingSpaceScreenshotSpacing));
auto* recent_downloads_label = AddChildView(std::make_unique<views::Label>(
l10n_util::GetStringUTF16(IDS_ASH_HOLDING_SPACE_RECENT_DOWNLOADS_TITLE)));
setup_layered_child(recent_downloads_label);
style.SetupLabel(recent_downloads_label);
auto* downloads_label = AddChildView(std::make_unique<views::Label>(
l10n_util::GetStringUTF16(IDS_ASH_HOLDING_SPACE_DOWNLOADS_TITLE)));
setup_layered_child(downloads_label);
style.SetupLabel(downloads_label);
recent_downloads_container_ =
downloads_container_ =
AddChildView(std::make_unique<HoldingSpaceItemChipsContainer>());
if (HoldingSpaceController::Get()->model())
......@@ -80,7 +80,7 @@ void RecentFilesContainer::AddHoldingSpaceItemView(
void RecentFilesContainer::RemoveAllHoldingSpaceItemViews() {
views_by_item_id_.clear();
screenshots_container_->RemoveAllChildViews(true);
recent_downloads_container_->RemoveAllChildViews(true);
downloads_container_->RemoveAllChildViews(true);
}
void RecentFilesContainer::RemoveHoldingSpaceItemView(
......@@ -147,16 +147,15 @@ void RecentFilesContainer::AddHoldingSpaceDownloadView(
DCHECK(!base::Contains(views_by_item_id_, item->id()));
// Remove the last download view if we are already at max capacity.
if (recent_downloads_container_->children().size() == kMaxDownloads) {
std::unique_ptr<views::View> view =
recent_downloads_container_->RemoveChildViewT(
recent_downloads_container_->children().back());
if (downloads_container_->children().size() == kMaxDownloads) {
std::unique_ptr<views::View> view = downloads_container_->RemoveChildViewT(
downloads_container_->children().back());
views_by_item_id_.erase(
HoldingSpaceItemView::Cast(view.get())->item()->id());
}
// Add the download view to the front in order to sort by recency.
views_by_item_id_[item->id()] = recent_downloads_container_->AddChildViewAt(
views_by_item_id_[item->id()] = downloads_container_->AddChildViewAt(
std::make_unique<HoldingSpaceItemChipView>(delegate_, item), /*index=*/0);
}
......@@ -169,11 +168,11 @@ void RecentFilesContainer::RemoveHoldingSpaceDownloadView(
return;
// Remove the download view associated with `item`.
recent_downloads_container_->RemoveChildViewT(it->second);
downloads_container_->RemoveChildViewT(it->second);
views_by_item_id_.erase(it);
// Verify that we are *not* at max capacity.
DCHECK_LT(recent_downloads_container_->children().size(), kMaxDownloads);
DCHECK_LT(downloads_container_->children().size(), kMaxDownloads);
// Since we are under max capacity, we can add at most one download view to
// replace the view we just removed. Note that we add the replacement to the
......@@ -182,10 +181,9 @@ void RecentFilesContainer::RemoveHoldingSpaceDownloadView(
base::Reversed(HoldingSpaceController::Get()->model()->items())) {
if (candidate->type() == HoldingSpaceItem::Type::kDownload &&
!base::Contains(views_by_item_id_, candidate->id())) {
views_by_item_id_[candidate->id()] =
recent_downloads_container_->AddChildView(
std::make_unique<HoldingSpaceItemChipView>(delegate_,
candidate.get()));
views_by_item_id_[candidate->id()] = downloads_container_->AddChildView(
std::make_unique<HoldingSpaceItemChipView>(delegate_,
candidate.get()));
return;
}
}
......
......@@ -14,7 +14,7 @@ namespace ash {
class HoldingSpaceItemChipsContainer;
class HoldingSpaceItemViewDelegate;
// Container for the recent files (Screenshots, downloads etc).
// Container for the recent files (e.g. screenshots, downloads, etc).
class RecentFilesContainer : public HoldingSpaceItemViewsContainer {
public:
explicit RecentFilesContainer(HoldingSpaceItemViewDelegate* delegate);
......@@ -35,7 +35,7 @@ class RecentFilesContainer : public HoldingSpaceItemViewsContainer {
HoldingSpaceItemViewDelegate* const delegate_;
views::View* screenshots_container_ = nullptr;
HoldingSpaceItemChipsContainer* recent_downloads_container_ = nullptr;
HoldingSpaceItemChipsContainer* downloads_container_ = nullptr;
std::map<std::string, views::View*> views_by_item_id_;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment