Commit 79a2bd46 authored by David Black's avatar David Black Committed by Chromium LUCI CQ

Finish holding space view hierarchy refactor.

Finishes the holding space view hierarchy refactor by renaming:
- HoldingSpaceItemViewsContainer --> HoldingSpaceItemViewsSection
- PinnedFilesContainer --> PinnedFilesBubble
- RecentFilesContainer --> RecentFilesBubble

Bug: 1154998
Change-Id: I621a8c76daf142ced35503fe78801dbfd09d4570
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2587611
Commit-Queue: David Black <dmblack@google.com>
Reviewed-by: default avatarToni Baržić <tbarzic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#836301}
parent f0e96fb4
...@@ -995,8 +995,8 @@ component("ash") { ...@@ -995,8 +995,8 @@ component("ash") {
"system/holding_space/holding_space_item_view.h", "system/holding_space/holding_space_item_view.h",
"system/holding_space/holding_space_item_view_delegate.cc", "system/holding_space/holding_space_item_view_delegate.cc",
"system/holding_space/holding_space_item_view_delegate.h", "system/holding_space/holding_space_item_view_delegate.h",
"system/holding_space/holding_space_item_views_container.cc", "system/holding_space/holding_space_item_views_section.cc",
"system/holding_space/holding_space_item_views_container.h", "system/holding_space/holding_space_item_views_section.h",
"system/holding_space/holding_space_tray.cc", "system/holding_space/holding_space_tray.cc",
"system/holding_space/holding_space_tray.h", "system/holding_space/holding_space_tray.h",
"system/holding_space/holding_space_tray_bubble.cc", "system/holding_space/holding_space_tray_bubble.cc",
...@@ -1007,12 +1007,12 @@ component("ash") { ...@@ -1007,12 +1007,12 @@ component("ash") {
"system/holding_space/holding_space_tray_icon.h", "system/holding_space/holding_space_tray_icon.h",
"system/holding_space/holding_space_tray_icon_preview.cc", "system/holding_space/holding_space_tray_icon_preview.cc",
"system/holding_space/holding_space_tray_icon_preview.h", "system/holding_space/holding_space_tray_icon_preview.h",
"system/holding_space/pinned_files_container.cc", "system/holding_space/pinned_files_bubble.cc",
"system/holding_space/pinned_files_container.h", "system/holding_space/pinned_files_bubble.h",
"system/holding_space/pinned_files_section.cc", "system/holding_space/pinned_files_section.cc",
"system/holding_space/pinned_files_section.h", "system/holding_space/pinned_files_section.h",
"system/holding_space/recent_files_container.cc", "system/holding_space/recent_files_bubble.cc",
"system/holding_space/recent_files_container.h", "system/holding_space/recent_files_bubble.h",
"system/holding_space/screen_captures_section.cc", "system/holding_space/screen_captures_section.cc",
"system/holding_space/screen_captures_section.h", "system/holding_space/screen_captures_section.h",
"system/ime/ime_feature_pod_controller.cc", "system/ime/ime_feature_pod_controller.cc",
......
...@@ -12,10 +12,10 @@ ...@@ -12,10 +12,10 @@
namespace ash { namespace ash {
// Appearance. // Appearance.
constexpr int kHoldingSpaceBubbleContainerChildSpacing = 8;
constexpr int kHoldingSpaceBubbleWidth = 360; constexpr int kHoldingSpaceBubbleWidth = 360;
constexpr gfx::Insets kHoldingSpaceContainerPadding(16); constexpr gfx::Insets kHoldingSpaceChildBubblePadding(16);
constexpr int kHoldingSpaceContainerChildSpacing = 16; constexpr int kHoldingSpaceChildBubbleChildSpacing = 16;
constexpr int kHoldingSpaceContainerSpacing = 8;
constexpr gfx::Insets kHoldingSpaceChipPadding(8); constexpr gfx::Insets kHoldingSpaceChipPadding(8);
constexpr int kHoldingSpaceChipChildSpacing = 8; constexpr int kHoldingSpaceChipChildSpacing = 8;
constexpr int kHoldingSpaceChipHeight = 40; constexpr int kHoldingSpaceChipHeight = 40;
...@@ -37,6 +37,7 @@ constexpr gfx::Size kHoldingSpaceScreenCapturePlayIconSize(32, 32); ...@@ -37,6 +37,7 @@ constexpr gfx::Size kHoldingSpaceScreenCapturePlayIconSize(32, 32);
constexpr int kHoldingSpaceScreenCaptureSpacing = 8; constexpr int kHoldingSpaceScreenCaptureSpacing = 8;
constexpr gfx::Size kHoldingSpaceScreenCaptureSize(104, 80); constexpr gfx::Size kHoldingSpaceScreenCaptureSize(104, 80);
constexpr gfx::Insets kHoldingSpaceScreenCapturesContainerPadding(8, 0); constexpr gfx::Insets kHoldingSpaceScreenCapturesContainerPadding(8, 0);
constexpr int kHoldingSpaceSectionChildSpacing = 16;
constexpr float kHoldingSpaceSelectedOverlayOpacity = 0.24f; constexpr float kHoldingSpaceSelectedOverlayOpacity = 0.24f;
constexpr int kHoldingSpaceTrayIconMaxVisiblePreviews = 3; constexpr int kHoldingSpaceTrayIconMaxVisiblePreviews = 3;
constexpr int kHoldingSpaceTrayIconSize = 20; constexpr int kHoldingSpaceTrayIconSize = 20;
...@@ -53,8 +54,8 @@ enum HoldingSpaceCommandId { ...@@ -53,8 +54,8 @@ enum HoldingSpaceCommandId {
}; };
// View IDs. // View IDs.
constexpr int kHoldingSpacePinnedFilesContainerId = 1; constexpr int kHoldingSpacePinnedFilesBubbleId = 1;
constexpr int kHoldingSpaceRecentFilesContainerId = 2; constexpr int kHoldingSpaceRecentFilesBubbleId = 2;
constexpr int kHoldingSpaceScreenCapturePlayIconId = 3; constexpr int kHoldingSpaceScreenCapturePlayIconId = 3;
constexpr int kHoldingSpaceTrayDefaultIconId = 4; constexpr int kHoldingSpaceTrayDefaultIconId = 4;
constexpr int kHoldingSpaceTrayPreviewsIconId = 5; constexpr int kHoldingSpaceTrayPreviewsIconId = 5;
......
...@@ -69,11 +69,11 @@ class ASH_EXPORT HoldingSpaceTestApi { ...@@ -69,11 +69,11 @@ class ASH_EXPORT HoldingSpaceTestApi {
// which displays previews of most recent items added to holding space. // which displays previews of most recent items added to holding space.
views::View* GetPreviewsTrayIcon(); views::View* GetPreviewsTrayIcon();
// Returns whether the pinned files container is shown. // Returns whether the pinned files bubble is shown.
bool PinnedFilesContainerShown() const; bool PinnedFilesBubbleShown() const;
// Returns whether the recent files container is shown. // Returns whether the recent files bubble is shown.
bool RecentFilesContainerShown() const; bool RecentFilesBubbleShown() const;
private: private:
HoldingSpaceTray* holding_space_tray_ = nullptr; HoldingSpaceTray* holding_space_tray_ = nullptr;
......
...@@ -76,11 +76,11 @@ class Header : public views::Button { ...@@ -76,11 +76,11 @@ class Header : public views::Button {
// DownloadsSection ------------------------------------------------------------ // DownloadsSection ------------------------------------------------------------
DownloadsSection::DownloadsSection(HoldingSpaceItemViewDelegate* delegate) DownloadsSection::DownloadsSection(HoldingSpaceItemViewDelegate* delegate)
: HoldingSpaceItemViewsContainer(delegate, : HoldingSpaceItemViewsSection(delegate,
/*supported_types=*/ /*supported_types=*/
{HoldingSpaceItem::Type::kDownload, {HoldingSpaceItem::Type::kDownload,
HoldingSpaceItem::Type::kNearbyShare}, HoldingSpaceItem::Type::kNearbyShare},
/*max_count=*/kMaxDownloads) {} /*max_count=*/kMaxDownloads) {}
DownloadsSection::~DownloadsSection() = default; DownloadsSection::~DownloadsSection() = default;
......
...@@ -7,19 +7,19 @@ ...@@ -7,19 +7,19 @@
#include <memory> #include <memory>
#include "ash/system/holding_space/holding_space_item_views_container.h" #include "ash/system/holding_space/holding_space_item_views_section.h"
namespace ash { namespace ash {
// Section for downloads in the `RecentFilesContainer`. // Section for downloads in the `RecentFilesBubble`.
class DownloadsSection : public HoldingSpaceItemViewsContainer { class DownloadsSection : public HoldingSpaceItemViewsSection {
public: public:
explicit DownloadsSection(HoldingSpaceItemViewDelegate* delegate); explicit DownloadsSection(HoldingSpaceItemViewDelegate* delegate);
DownloadsSection(const DownloadsSection& other) = delete; DownloadsSection(const DownloadsSection& other) = delete;
DownloadsSection& operator=(const DownloadsSection& other) = delete; DownloadsSection& operator=(const DownloadsSection& other) = delete;
~DownloadsSection() override; ~DownloadsSection() override;
// HoldingSpaceItemViewsContainer: // HoldingSpaceItemViewsSection:
const char* GetClassName() const override; const char* GetClassName() const override;
std::unique_ptr<views::View> CreateHeader() override; std::unique_ptr<views::View> CreateHeader() override;
std::unique_ptr<views::View> CreateContainer() override; std::unique_ptr<views::View> CreateContainer() override;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "ash/system/holding_space/holding_space_item_views_container.h" #include "ash/system/holding_space/holding_space_item_views_section.h"
#include "ash/public/cpp/holding_space/holding_space_constants.h" #include "ash/public/cpp/holding_space/holding_space_constants.h"
#include "ash/system/holding_space/holding_space_item_view.h" #include "ash/system/holding_space/holding_space_item_view.h"
...@@ -53,9 +53,9 @@ class HoldingSpaceScrollView : public views::ScrollView, ...@@ -53,9 +53,9 @@ class HoldingSpaceScrollView : public views::ScrollView,
} // namespace } // namespace
// HoldingSpaceItemViewsContainer ---------------------------------------------- // HoldingSpaceItemViewsSection ------------------------------------------------
HoldingSpaceItemViewsContainer::HoldingSpaceItemViewsContainer( HoldingSpaceItemViewsSection::HoldingSpaceItemViewsSection(
HoldingSpaceItemViewDelegate* delegate, HoldingSpaceItemViewDelegate* delegate,
std::vector<HoldingSpaceItem::Type> supported_types, std::vector<HoldingSpaceItem::Type> supported_types,
const base::Optional<size_t>& max_count) const base::Optional<size_t>& max_count)
...@@ -65,14 +65,14 @@ HoldingSpaceItemViewsContainer::HoldingSpaceItemViewsContainer( ...@@ -65,14 +65,14 @@ HoldingSpaceItemViewsContainer::HoldingSpaceItemViewsContainer(
controller_observer_.Observe(HoldingSpaceController::Get()); controller_observer_.Observe(HoldingSpaceController::Get());
} }
HoldingSpaceItemViewsContainer::~HoldingSpaceItemViewsContainer() = default; HoldingSpaceItemViewsSection::~HoldingSpaceItemViewsSection() = default;
void HoldingSpaceItemViewsContainer::Init() { void HoldingSpaceItemViewsSection::Init() {
SetVisible(false); SetVisible(false);
SetLayoutManager(std::make_unique<views::BoxLayout>( SetLayoutManager(std::make_unique<views::BoxLayout>(
views::BoxLayout::Orientation::kVertical, gfx::Insets(), views::BoxLayout::Orientation::kVertical, gfx::Insets(),
kHoldingSpaceContainerChildSpacing)); kHoldingSpaceSectionChildSpacing));
// Header. // Header.
header_ = AddChildView(CreateHeader()); header_ = AddChildView(CreateHeader());
...@@ -111,18 +111,17 @@ void HoldingSpaceItemViewsContainer::Init() { ...@@ -111,18 +111,17 @@ void HoldingSpaceItemViewsContainer::Init() {
OnHoldingSpaceModelAttached(model); OnHoldingSpaceModelAttached(model);
} }
void HoldingSpaceItemViewsContainer::Reset() { void HoldingSpaceItemViewsSection::Reset() {
model_observer_.Reset(); model_observer_.Reset();
controller_observer_.Reset(); controller_observer_.Reset();
} }
void HoldingSpaceItemViewsContainer::ChildPreferredSizeChanged( void HoldingSpaceItemViewsSection::ChildPreferredSizeChanged(
views::View* child) { views::View* child) {
PreferredSizeChanged(); PreferredSizeChanged();
} }
void HoldingSpaceItemViewsContainer::ChildVisibilityChanged( void HoldingSpaceItemViewsSection::ChildVisibilityChanged(views::View* child) {
views::View* child) {
// This section should be visible iff it has visible children. // This section should be visible iff it has visible children.
bool visible = false; bool visible = false;
for (const views::View* c : children()) { for (const views::View* c : children()) {
...@@ -138,7 +137,7 @@ void HoldingSpaceItemViewsContainer::ChildVisibilityChanged( ...@@ -138,7 +137,7 @@ void HoldingSpaceItemViewsContainer::ChildVisibilityChanged(
PreferredSizeChanged(); PreferredSizeChanged();
} }
void HoldingSpaceItemViewsContainer::ViewHierarchyChanged( void HoldingSpaceItemViewsSection::ViewHierarchyChanged(
const views::ViewHierarchyChangedDetails& details) { const views::ViewHierarchyChangedDetails& details) {
if (details.parent != container_) if (details.parent != container_)
return; return;
...@@ -157,21 +156,21 @@ void HoldingSpaceItemViewsContainer::ViewHierarchyChanged( ...@@ -157,21 +156,21 @@ void HoldingSpaceItemViewsContainer::ViewHierarchyChanged(
placeholder_->SetVisible(!details.is_add); placeholder_->SetVisible(!details.is_add);
} }
void HoldingSpaceItemViewsContainer::OnHoldingSpaceModelAttached( void HoldingSpaceItemViewsSection::OnHoldingSpaceModelAttached(
HoldingSpaceModel* model) { HoldingSpaceModel* model) {
model_observer_.Observe(model); model_observer_.Observe(model);
for (const auto& item : model->items()) for (const auto& item : model->items())
OnHoldingSpaceItemAdded(item.get()); OnHoldingSpaceItemAdded(item.get());
} }
void HoldingSpaceItemViewsContainer::OnHoldingSpaceModelDetached( void HoldingSpaceItemViewsSection::OnHoldingSpaceModelDetached(
HoldingSpaceModel* model) { HoldingSpaceModel* model) {
model_observer_.Reset(); model_observer_.Reset();
if (!container_->children().empty()) if (!container_->children().empty())
MaybeAnimateOut(); MaybeAnimateOut();
} }
void HoldingSpaceItemViewsContainer::OnHoldingSpaceItemAdded( void HoldingSpaceItemViewsSection::OnHoldingSpaceItemAdded(
const HoldingSpaceItem* item) { const HoldingSpaceItem* item) {
if (!item->IsFinalized()) if (!item->IsFinalized())
return; return;
...@@ -179,24 +178,23 @@ void HoldingSpaceItemViewsContainer::OnHoldingSpaceItemAdded( ...@@ -179,24 +178,23 @@ void HoldingSpaceItemViewsContainer::OnHoldingSpaceItemAdded(
MaybeAnimateOut(); MaybeAnimateOut();
} }
void HoldingSpaceItemViewsContainer::OnHoldingSpaceItemRemoved( void HoldingSpaceItemViewsSection::OnHoldingSpaceItemRemoved(
const HoldingSpaceItem* item) { const HoldingSpaceItem* item) {
if (base::Contains(views_by_item_id_, item->id())) if (base::Contains(views_by_item_id_, item->id()))
MaybeAnimateOut(); MaybeAnimateOut();
} }
void HoldingSpaceItemViewsContainer::OnHoldingSpaceItemFinalized( void HoldingSpaceItemViewsSection::OnHoldingSpaceItemFinalized(
const HoldingSpaceItem* item) { const HoldingSpaceItem* item) {
if (base::Contains(supported_types_, item->type())) if (base::Contains(supported_types_, item->type()))
MaybeAnimateOut(); MaybeAnimateOut();
} }
std::unique_ptr<views::View> std::unique_ptr<views::View> HoldingSpaceItemViewsSection::CreatePlaceholder() {
HoldingSpaceItemViewsContainer::CreatePlaceholder() {
return nullptr; return nullptr;
} }
void HoldingSpaceItemViewsContainer::DestroyPlaceholder() { void HoldingSpaceItemViewsSection::DestroyPlaceholder() {
if (!placeholder_) if (!placeholder_)
return; return;
...@@ -209,7 +207,7 @@ void HoldingSpaceItemViewsContainer::DestroyPlaceholder() { ...@@ -209,7 +207,7 @@ void HoldingSpaceItemViewsContainer::DestroyPlaceholder() {
header_->SetVisible(false); header_->SetVisible(false);
} }
void HoldingSpaceItemViewsContainer::MaybeAnimateIn() { void HoldingSpaceItemViewsSection::MaybeAnimateIn() {
if (animation_state_ & AnimationState::kAnimatingIn) if (animation_state_ & AnimationState::kAnimatingIn)
return; return;
...@@ -218,14 +216,14 @@ void HoldingSpaceItemViewsContainer::MaybeAnimateIn() { ...@@ -218,14 +216,14 @@ void HoldingSpaceItemViewsContainer::MaybeAnimateIn() {
// NOTE: `animate_in_observer` is deleted after `OnAnimateInCompleted()`. // NOTE: `animate_in_observer` is deleted after `OnAnimateInCompleted()`.
ui::CallbackLayerAnimationObserver* animate_in_observer = ui::CallbackLayerAnimationObserver* animate_in_observer =
new ui::CallbackLayerAnimationObserver(base::BindRepeating( new ui::CallbackLayerAnimationObserver(base::BindRepeating(
&HoldingSpaceItemViewsContainer::OnAnimateInCompleted, &HoldingSpaceItemViewsSection::OnAnimateInCompleted,
base::Unretained(this))); base::Unretained(this)));
AnimateIn(animate_in_observer); AnimateIn(animate_in_observer);
animate_in_observer->SetActive(); animate_in_observer->SetActive();
} }
void HoldingSpaceItemViewsContainer::MaybeAnimateOut() { void HoldingSpaceItemViewsSection::MaybeAnimateOut() {
if (animation_state_ & AnimationState::kAnimatingOut) if (animation_state_ & AnimationState::kAnimatingOut)
return; return;
...@@ -239,7 +237,7 @@ void HoldingSpaceItemViewsContainer::MaybeAnimateOut() { ...@@ -239,7 +237,7 @@ void HoldingSpaceItemViewsContainer::MaybeAnimateOut() {
// NOTE: `animate_out_observer` is deleted after `OnAnimateOutCompleted()`. // NOTE: `animate_out_observer` is deleted after `OnAnimateOutCompleted()`.
ui::CallbackLayerAnimationObserver* animate_out_observer = ui::CallbackLayerAnimationObserver* animate_out_observer =
new ui::CallbackLayerAnimationObserver(base::BindRepeating( new ui::CallbackLayerAnimationObserver(base::BindRepeating(
&HoldingSpaceItemViewsContainer::OnAnimateOutCompleted, &HoldingSpaceItemViewsSection::OnAnimateOutCompleted,
base::Unretained(this))); base::Unretained(this)));
AnimateOut(animate_out_observer); AnimateOut(animate_out_observer);
...@@ -248,7 +246,7 @@ void HoldingSpaceItemViewsContainer::MaybeAnimateOut() { ...@@ -248,7 +246,7 @@ void HoldingSpaceItemViewsContainer::MaybeAnimateOut() {
// TODO(dmblack): Handle animate in of `placeholder_`. // TODO(dmblack): Handle animate in of `placeholder_`.
// TODO(dmblack): Handle grow/shrink of container. // TODO(dmblack): Handle grow/shrink of container.
void HoldingSpaceItemViewsContainer::AnimateIn( void HoldingSpaceItemViewsSection::AnimateIn(
ui::LayerAnimationObserver* observer) { ui::LayerAnimationObserver* observer) {
if (views_by_item_id_.empty() && placeholder_) { if (views_by_item_id_.empty() && placeholder_) {
DCHECK(!placeholder_->GetVisible()); DCHECK(!placeholder_->GetVisible());
...@@ -261,7 +259,7 @@ void HoldingSpaceItemViewsContainer::AnimateIn( ...@@ -261,7 +259,7 @@ void HoldingSpaceItemViewsContainer::AnimateIn(
// TODO(dmblack): Handle animate out of `placeholder_`. // TODO(dmblack): Handle animate out of `placeholder_`.
// TODO(dmblack): Handle animate out of `header_` if this section is leaving. // TODO(dmblack): Handle animate out of `header_` if this section is leaving.
void HoldingSpaceItemViewsContainer::AnimateOut( void HoldingSpaceItemViewsSection::AnimateOut(
ui::LayerAnimationObserver* observer) { ui::LayerAnimationObserver* observer) {
if (placeholder_ && placeholder_->GetVisible()) { if (placeholder_ && placeholder_->GetVisible()) {
DCHECK(views_by_item_id_.empty()); DCHECK(views_by_item_id_.empty());
...@@ -272,7 +270,7 @@ void HoldingSpaceItemViewsContainer::AnimateOut( ...@@ -272,7 +270,7 @@ void HoldingSpaceItemViewsContainer::AnimateOut(
view_by_item_id.second->AnimateOut(observer); view_by_item_id.second->AnimateOut(observer);
} }
bool HoldingSpaceItemViewsContainer::OnAnimateInCompleted( bool HoldingSpaceItemViewsSection::OnAnimateInCompleted(
const ui::CallbackLayerAnimationObserver& observer) { const ui::CallbackLayerAnimationObserver& observer) {
DCHECK(animation_state_ & AnimationState::kAnimatingIn); DCHECK(animation_state_ & AnimationState::kAnimatingIn);
animation_state_ &= ~AnimationState::kAnimatingIn; animation_state_ &= ~AnimationState::kAnimatingIn;
...@@ -290,7 +288,7 @@ bool HoldingSpaceItemViewsContainer::OnAnimateInCompleted( ...@@ -290,7 +288,7 @@ bool HoldingSpaceItemViewsContainer::OnAnimateInCompleted(
return kDeleteObserver; return kDeleteObserver;
} }
bool HoldingSpaceItemViewsContainer::OnAnimateOutCompleted( bool HoldingSpaceItemViewsSection::OnAnimateOutCompleted(
const ui::CallbackLayerAnimationObserver& observer) { const ui::CallbackLayerAnimationObserver& observer) {
DCHECK(animation_state_ & AnimationState::kAnimatingOut); DCHECK(animation_state_ & AnimationState::kAnimatingOut);
animation_state_ &= ~AnimationState::kAnimatingOut; animation_state_ &= ~AnimationState::kAnimatingOut;
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef ASH_SYSTEM_HOLDING_SPACE_HOLDING_SPACE_ITEM_VIEWS_CONTAINER_H_ #ifndef ASH_SYSTEM_HOLDING_SPACE_HOLDING_SPACE_ITEM_VIEWS_SECTION_H_
#define ASH_SYSTEM_HOLDING_SPACE_HOLDING_SPACE_ITEM_VIEWS_CONTAINER_H_ #define ASH_SYSTEM_HOLDING_SPACE_HOLDING_SPACE_ITEM_VIEWS_SECTION_H_
#include <map> #include <map>
#include <memory> #include <memory>
...@@ -29,21 +29,20 @@ namespace ash { ...@@ -29,21 +29,20 @@ namespace ash {
class HoldingSpaceItemView; class HoldingSpaceItemView;
class HoldingSpaceItemViewDelegate; class HoldingSpaceItemViewDelegate;
// TODO(dmblack): Rename to `HoldingSpaceItemViewsSection`.
// A section of holding space item views in a `HoldingSpaceTrayChildBubble`. // A section of holding space item views in a `HoldingSpaceTrayChildBubble`.
class HoldingSpaceItemViewsContainer : public views::View, class HoldingSpaceItemViewsSection : public views::View,
public HoldingSpaceControllerObserver, public HoldingSpaceControllerObserver,
public HoldingSpaceModelObserver { public HoldingSpaceModelObserver {
public: public:
HoldingSpaceItemViewsContainer( HoldingSpaceItemViewsSection(
HoldingSpaceItemViewDelegate* delegate, HoldingSpaceItemViewDelegate* delegate,
std::vector<HoldingSpaceItem::Type> supported_types, std::vector<HoldingSpaceItem::Type> supported_types,
const base::Optional<size_t>& max_count); const base::Optional<size_t>& max_count);
HoldingSpaceItemViewsContainer(const HoldingSpaceItemViewsContainer& other) = HoldingSpaceItemViewsSection(const HoldingSpaceItemViewsSection& other) =
delete; delete;
HoldingSpaceItemViewsContainer& operator=( HoldingSpaceItemViewsSection& operator=(
const HoldingSpaceItemViewsContainer& other) = delete; const HoldingSpaceItemViewsSection& other) = delete;
~HoldingSpaceItemViewsContainer() override; ~HoldingSpaceItemViewsSection() override;
// Initializes the section. // Initializes the section.
void Init(); void Init();
...@@ -143,4 +142,4 @@ class HoldingSpaceItemViewsContainer : public views::View, ...@@ -143,4 +142,4 @@ class HoldingSpaceItemViewsContainer : public views::View,
} // namespace ash } // namespace ash
#endif // ASH_SYSTEM_HOLDING_SPACE_HOLDING_SPACE_ITEM_VIEWS_CONTAINER_H_ #endif // ASH_SYSTEM_HOLDING_SPACE_HOLDING_SPACE_ITEM_VIEWS_SECTION_H_
...@@ -98,7 +98,7 @@ std::vector<views::View*> HoldingSpaceTestApi::GetDownloadChips() { ...@@ -98,7 +98,7 @@ std::vector<views::View*> HoldingSpaceTestApi::GetDownloadChips() {
if (holding_space_tray_->GetBubbleView()) { if (holding_space_tray_->GetBubbleView()) {
FindDescendentsOfClass<HoldingSpaceItemChipView>( FindDescendentsOfClass<HoldingSpaceItemChipView>(
holding_space_tray_->GetBubbleView()->GetViewByID( holding_space_tray_->GetBubbleView()->GetViewByID(
kHoldingSpaceRecentFilesContainerId), kHoldingSpaceRecentFilesBubbleId),
&download_chips); &download_chips);
} }
return download_chips; return download_chips;
...@@ -109,7 +109,7 @@ std::vector<views::View*> HoldingSpaceTestApi::GetPinnedFileChips() { ...@@ -109,7 +109,7 @@ std::vector<views::View*> HoldingSpaceTestApi::GetPinnedFileChips() {
if (holding_space_tray_->GetBubbleView()) { if (holding_space_tray_->GetBubbleView()) {
FindDescendentsOfClass<HoldingSpaceItemChipView>( FindDescendentsOfClass<HoldingSpaceItemChipView>(
holding_space_tray_->GetBubbleView()->GetViewByID( holding_space_tray_->GetBubbleView()->GetViewByID(
kHoldingSpacePinnedFilesContainerId), kHoldingSpacePinnedFilesBubbleId),
&pinned_file_chips); &pinned_file_chips);
} }
return pinned_file_chips; return pinned_file_chips;
...@@ -120,7 +120,7 @@ std::vector<views::View*> HoldingSpaceTestApi::GetScreenCaptureViews() { ...@@ -120,7 +120,7 @@ std::vector<views::View*> HoldingSpaceTestApi::GetScreenCaptureViews() {
if (holding_space_tray_->GetBubbleView()) { if (holding_space_tray_->GetBubbleView()) {
FindDescendentsOfClass<HoldingSpaceItemScreenCaptureView>( FindDescendentsOfClass<HoldingSpaceItemScreenCaptureView>(
holding_space_tray_->GetBubbleView()->GetViewByID( holding_space_tray_->GetBubbleView()->GetViewByID(
kHoldingSpaceRecentFilesContainerId), kHoldingSpaceRecentFilesBubbleId),
&screen_capture_views); &screen_capture_views);
} }
return screen_capture_views; return screen_capture_views;
...@@ -138,22 +138,22 @@ views::View* HoldingSpaceTestApi::GetPreviewsTrayIcon() { ...@@ -138,22 +138,22 @@ views::View* HoldingSpaceTestApi::GetPreviewsTrayIcon() {
return holding_space_tray_->GetViewByID(kHoldingSpaceTrayPreviewsIconId); return holding_space_tray_->GetViewByID(kHoldingSpaceTrayPreviewsIconId);
} }
bool HoldingSpaceTestApi::PinnedFilesContainerShown() const { bool HoldingSpaceTestApi::PinnedFilesBubbleShown() const {
if (!holding_space_tray_->GetBubbleView()) if (!holding_space_tray_->GetBubbleView())
return false; return false;
views::View* container = holding_space_tray_->GetBubbleView()->GetViewByID( views::View* bubble = holding_space_tray_->GetBubbleView()->GetViewByID(
kHoldingSpacePinnedFilesContainerId); kHoldingSpacePinnedFilesBubbleId);
return container && container->GetVisible(); return bubble && bubble->GetVisible();
} }
bool HoldingSpaceTestApi::RecentFilesContainerShown() const { bool HoldingSpaceTestApi::RecentFilesBubbleShown() const {
if (!holding_space_tray_->GetBubbleView()) if (!holding_space_tray_->GetBubbleView())
return false; return false;
views::View* container = holding_space_tray_->GetBubbleView()->GetViewByID( views::View* bubble = holding_space_tray_->GetBubbleView()->GetViewByID(
kHoldingSpaceRecentFilesContainerId); kHoldingSpaceRecentFilesBubbleId);
return container && container->GetVisible(); return bubble && bubble->GetVisible();
} }
} // namespace ash } // namespace ash
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
#include "ash/shell.h" #include "ash/shell.h"
#include "ash/system/holding_space/holding_space_item_view.h" #include "ash/system/holding_space/holding_space_item_view.h"
#include "ash/system/holding_space/holding_space_tray.h" #include "ash/system/holding_space/holding_space_tray.h"
#include "ash/system/holding_space/pinned_files_container.h" #include "ash/system/holding_space/pinned_files_bubble.h"
#include "ash/system/holding_space/recent_files_container.h" #include "ash/system/holding_space/recent_files_bubble.h"
#include "ash/system/tray/tray_bubble_wrapper.h" #include "ash/system/tray/tray_bubble_wrapper.h"
#include "ash/system/tray/tray_constants.h" #include "ash/system/tray/tray_constants.h"
#include "ash/system/tray/tray_utils.h" #include "ash/system/tray/tray_utils.h"
...@@ -59,7 +59,7 @@ class HoldingSpaceBubbleContainer : public views::View { ...@@ -59,7 +59,7 @@ class HoldingSpaceBubbleContainer : public views::View {
HoldingSpaceBubbleContainer() { HoldingSpaceBubbleContainer() {
layout_ = SetLayoutManager(std::make_unique<views::BoxLayout>( layout_ = SetLayoutManager(std::make_unique<views::BoxLayout>(
views::BoxLayout::Orientation::kVertical, gfx::Insets(), views::BoxLayout::Orientation::kVertical, gfx::Insets(),
kHoldingSpaceContainerSpacing)); kHoldingSpaceBubbleContainerChildSpacing));
} }
void SetFlexForChild(views::View* child, int flex) { void SetFlexForChild(views::View* child, int flex) {
...@@ -112,12 +112,12 @@ HoldingSpaceTrayBubble::HoldingSpaceTrayBubble( ...@@ -112,12 +112,12 @@ HoldingSpaceTrayBubble::HoldingSpaceTrayBubble(
// Add pinned files child bubble. // Add pinned files child bubble.
child_bubbles_.push_back(bubble_container->AddChildView( child_bubbles_.push_back(bubble_container->AddChildView(
std::make_unique<PinnedFilesContainer>(&delegate_))); std::make_unique<PinnedFilesBubble>(&delegate_)));
bubble_container->SetFlexForChild(child_bubbles_.back(), 1); bubble_container->SetFlexForChild(child_bubbles_.back(), 1);
// Add recent files child bubble. // Add recent files child bubble.
child_bubbles_.push_back(bubble_container->AddChildView( child_bubbles_.push_back(bubble_container->AddChildView(
std::make_unique<RecentFilesContainer>(&delegate_))); std::make_unique<RecentFilesBubble>(&delegate_)));
// Initialize child bubbles. // Initialize child bubbles.
for (HoldingSpaceTrayChildBubble* child_bubble : child_bubbles_) for (HoldingSpaceTrayChildBubble* child_bubble : child_bubbles_)
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include "ash/public/cpp/holding_space/holding_space_constants.h" #include "ash/public/cpp/holding_space/holding_space_constants.h"
#include "ash/style/ash_color_provider.h" #include "ash/style/ash_color_provider.h"
#include "ash/system/holding_space/holding_space_item_views_container.h" #include "ash/system/holding_space/holding_space_item_views_section.h"
#include "ash/system/tray/tray_constants.h" #include "ash/system/tray/tray_constants.h"
#include "ui/views/layout/box_layout.h" #include "ui/views/layout/box_layout.h"
...@@ -20,8 +20,8 @@ HoldingSpaceTrayChildBubble::~HoldingSpaceTrayChildBubble() = default; ...@@ -20,8 +20,8 @@ HoldingSpaceTrayChildBubble::~HoldingSpaceTrayChildBubble() = default;
void HoldingSpaceTrayChildBubble::Init() { void HoldingSpaceTrayChildBubble::Init() {
SetLayoutManager(std::make_unique<views::BoxLayout>( SetLayoutManager(std::make_unique<views::BoxLayout>(
views::BoxLayout::Orientation::kVertical, kHoldingSpaceContainerPadding, views::BoxLayout::Orientation::kVertical, kHoldingSpaceChildBubblePadding,
kHoldingSpaceContainerChildSpacing)); kHoldingSpaceChildBubbleChildSpacing));
// Layer. // Layer.
SetPaintToLayer(ui::LAYER_SOLID_COLOR); SetPaintToLayer(ui::LAYER_SOLID_COLOR);
...@@ -41,7 +41,7 @@ void HoldingSpaceTrayChildBubble::Init() { ...@@ -41,7 +41,7 @@ void HoldingSpaceTrayChildBubble::Init() {
} }
void HoldingSpaceTrayChildBubble::Reset() { void HoldingSpaceTrayChildBubble::Reset() {
for (HoldingSpaceItemViewsContainer* section : sections_) for (HoldingSpaceItemViewsSection* section : sections_)
section->Reset(); section->Reset();
} }
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
namespace ash { namespace ash {
class HoldingSpaceItemViewDelegate; class HoldingSpaceItemViewDelegate;
class HoldingSpaceItemViewsContainer; class HoldingSpaceItemViewsSection;
// Child bubble of the `HoldingSpaceTrayBubble`. // Child bubble of the `HoldingSpaceTrayBubble`.
class HoldingSpaceTrayChildBubble : public views::View { class HoldingSpaceTrayChildBubble : public views::View {
...@@ -35,7 +35,7 @@ class HoldingSpaceTrayChildBubble : public views::View { ...@@ -35,7 +35,7 @@ class HoldingSpaceTrayChildBubble : public views::View {
protected: protected:
// Invoked to create the `sections_` for this child bubble. // Invoked to create the `sections_` for this child bubble.
virtual std::vector<std::unique_ptr<HoldingSpaceItemViewsContainer>> virtual std::vector<std::unique_ptr<HoldingSpaceItemViewsSection>>
CreateSections() = 0; CreateSections() = 0;
HoldingSpaceItemViewDelegate* delegate() { return delegate_; } HoldingSpaceItemViewDelegate* delegate() { return delegate_; }
...@@ -49,7 +49,7 @@ class HoldingSpaceTrayChildBubble : public views::View { ...@@ -49,7 +49,7 @@ class HoldingSpaceTrayChildBubble : public views::View {
HoldingSpaceItemViewDelegate* const delegate_; HoldingSpaceItemViewDelegate* const delegate_;
// Views owned by view hierarchy. // Views owned by view hierarchy.
std::vector<HoldingSpaceItemViewsContainer*> sections_; std::vector<HoldingSpaceItemViewsSection*> sections_;
}; };
} // namespace ash } // namespace ash
......
...@@ -159,17 +159,17 @@ TEST_P(HoldingSpaceTrayTest, ShowTrayButtonOnFirstUse) { ...@@ -159,17 +159,17 @@ TEST_P(HoldingSpaceTrayTest, ShowTrayButtonOnFirstUse) {
MarkTimeOfFirstAdd(); MarkTimeOfFirstAdd();
EXPECT_TRUE(test_api()->IsShowingInShelf()); EXPECT_TRUE(test_api()->IsShowingInShelf());
// Show the bubble - both the pinned container and recent files container // Show the bubble - both the pinned files and recent files child bubbles
// should be shown. // should be shown.
test_api()->Show(); test_api()->Show();
EXPECT_TRUE(test_api()->PinnedFilesContainerShown()); EXPECT_TRUE(test_api()->PinnedFilesBubbleShown());
EXPECT_TRUE(test_api()->RecentFilesContainerShown()); EXPECT_TRUE(test_api()->RecentFilesBubbleShown());
// Remove the download item and verify the pinned files container, and the // Remove the download item and verify the pinned files bubble, and the
// tray button are still shown. // tray button are still shown.
model()->RemoveItem(item->id()); model()->RemoveItem(item->id());
EXPECT_TRUE(test_api()->PinnedFilesContainerShown()); EXPECT_TRUE(test_api()->PinnedFilesBubbleShown());
EXPECT_FALSE(test_api()->RecentFilesContainerShown()); EXPECT_FALSE(test_api()->RecentFilesBubbleShown());
test_api()->Close(); test_api()->Close();
EXPECT_TRUE(test_api()->IsShowingInShelf()); EXPECT_TRUE(test_api()->IsShowingInShelf());
...@@ -182,8 +182,8 @@ TEST_P(HoldingSpaceTrayTest, ShowTrayButtonOnFirstUse) { ...@@ -182,8 +182,8 @@ TEST_P(HoldingSpaceTrayTest, ShowTrayButtonOnFirstUse) {
MarkTimeOfFirstPin(); MarkTimeOfFirstPin();
model()->RemoveItem(pinned_item->id()); model()->RemoveItem(pinned_item->id());
// Verify that the pinned files container, and the tray button get hidden. // Verify that the pinned files bubble, and the tray button get hidden.
EXPECT_FALSE(test_api()->PinnedFilesContainerShown()); EXPECT_FALSE(test_api()->PinnedFilesBubbleShown());
test_api()->Close(); test_api()->Close();
EXPECT_FALSE(test_api()->IsShowingInShelf()); EXPECT_FALSE(test_api()->IsShowingInShelf());
} }
...@@ -254,22 +254,22 @@ TEST_P(HoldingSpaceTrayTest, TrayButtonNotShownForPartialItemsOnly) { ...@@ -254,22 +254,22 @@ TEST_P(HoldingSpaceTrayTest, TrayButtonNotShownForPartialItemsOnly) {
} }
// Tests how download chips are updated during item addition, removal and // Tests how download chips are updated during item addition, removal and
// finalization // finalization.
TEST_P(HoldingSpaceTrayTest, DownloadsContainer) { TEST_P(HoldingSpaceTrayTest, DownloadsSection) {
StartSession(); StartSession();
test_api()->Show(); test_api()->Show();
EXPECT_TRUE(test_api()->PinnedFilesContainerShown()); EXPECT_TRUE(test_api()->PinnedFilesBubbleShown());
EXPECT_FALSE(test_api()->RecentFilesContainerShown()); EXPECT_FALSE(test_api()->RecentFilesBubbleShown());
EXPECT_TRUE(test_api()->GetPinnedFileChips().empty()); EXPECT_TRUE(test_api()->GetPinnedFileChips().empty());
// Add a download item and verify recent file container gets shown. // Add a download item and verify recent file bubble gets shown.
HoldingSpaceItem* item_1 = HoldingSpaceItem* item_1 =
AddItem(HoldingSpaceItem::Type::kDownload, base::FilePath("/tmp/fake_1")); AddItem(HoldingSpaceItem::Type::kDownload, base::FilePath("/tmp/fake_1"));
EXPECT_TRUE(test_api()->PinnedFilesContainerShown()); EXPECT_TRUE(test_api()->PinnedFilesBubbleShown());
EXPECT_TRUE(test_api()->RecentFilesContainerShown()); EXPECT_TRUE(test_api()->RecentFilesBubbleShown());
EXPECT_TRUE(test_api()->GetPinnedFileChips().empty()); EXPECT_TRUE(test_api()->GetPinnedFileChips().empty());
EXPECT_TRUE(test_api()->GetScreenCaptureViews().empty()); EXPECT_TRUE(test_api()->GetScreenCaptureViews().empty());
...@@ -301,7 +301,7 @@ TEST_P(HoldingSpaceTrayTest, DownloadsContainer) { ...@@ -301,7 +301,7 @@ TEST_P(HoldingSpaceTrayTest, DownloadsContainer) {
HoldingSpaceItemView::Cast(download_chips[1])->item()->id()); HoldingSpaceItemView::Cast(download_chips[1])->item()->id());
// Finalize partially initialized item, and verify it gets added to the // Finalize partially initialized item, and verify it gets added to the
// container, in the order of addition, replacing the oldest item. // section, in the order of addition, replacing the oldest item.
model()->FinalizeOrRemoveItem(item_2->id(), GURL("filesystem:fake_2")); model()->FinalizeOrRemoveItem(item_2->id(), GURL("filesystem:fake_2"));
EXPECT_TRUE(test_api()->GetPinnedFileChips().empty()); EXPECT_TRUE(test_api()->GetPinnedFileChips().empty());
...@@ -313,7 +313,7 @@ TEST_P(HoldingSpaceTrayTest, DownloadsContainer) { ...@@ -313,7 +313,7 @@ TEST_P(HoldingSpaceTrayTest, DownloadsContainer) {
EXPECT_EQ(item_2->id(), EXPECT_EQ(item_2->id(),
HoldingSpaceItemView::Cast(download_chips[1])->item()->id()); HoldingSpaceItemView::Cast(download_chips[1])->item()->id());
// Remove the newest item, and verify the container gets updated. // Remove the newest item, and verify the section gets updated.
model()->RemoveItem(item_3->id()); model()->RemoveItem(item_3->id());
EXPECT_TRUE(test_api()->GetPinnedFileChips().empty()); EXPECT_TRUE(test_api()->GetPinnedFileChips().empty());
...@@ -325,10 +325,10 @@ TEST_P(HoldingSpaceTrayTest, DownloadsContainer) { ...@@ -325,10 +325,10 @@ TEST_P(HoldingSpaceTrayTest, DownloadsContainer) {
EXPECT_EQ(item_1->id(), EXPECT_EQ(item_1->id(),
HoldingSpaceItemView::Cast(download_chips[1])->item()->id()); HoldingSpaceItemView::Cast(download_chips[1])->item()->id());
// Remove other items, and verify the recent files container gets hidden. // Remove other items, and verify the recent files bubble gets hidden.
model()->RemoveItem(item_2->id()); model()->RemoveItem(item_2->id());
EXPECT_TRUE(test_api()->RecentFilesContainerShown()); EXPECT_TRUE(test_api()->RecentFilesBubbleShown());
download_chips = test_api()->GetDownloadChips(); download_chips = test_api()->GetDownloadChips();
ASSERT_EQ(1u, download_chips.size()); ASSERT_EQ(1u, download_chips.size());
EXPECT_EQ(item_1->id(), EXPECT_EQ(item_1->id(),
...@@ -337,15 +337,15 @@ TEST_P(HoldingSpaceTrayTest, DownloadsContainer) { ...@@ -337,15 +337,15 @@ TEST_P(HoldingSpaceTrayTest, DownloadsContainer) {
model()->RemoveItem(item_1->id()); model()->RemoveItem(item_1->id());
EXPECT_TRUE(test_api()->GetDownloadChips().empty()); EXPECT_TRUE(test_api()->GetDownloadChips().empty());
EXPECT_FALSE(test_api()->RecentFilesContainerShown()); EXPECT_FALSE(test_api()->RecentFilesBubbleShown());
// Pinned container is showing "educational" info, and it should remain shown. // Pinned bubble is showing "educational" info, and it should remain shown.
EXPECT_TRUE(test_api()->PinnedFilesContainerShown()); EXPECT_TRUE(test_api()->PinnedFilesBubbleShown());
} }
// Verifies the downloads container is shown and orders items as expected when // Verifies the downloads section is shown and orders items as expected when the
// the model contains a number of finalized items prior to showing UI. // model contains a number of finalized items prior to showing UI.
TEST_P(HoldingSpaceTrayTest, DownloadsContainerWithFinalizedItemsOnly) { TEST_P(HoldingSpaceTrayTest, DownloadsSectionWithFinalizedItemsOnly) {
MarkTimeOfFirstPin(); MarkTimeOfFirstPin();
StartSession(); StartSession();
...@@ -358,7 +358,7 @@ TEST_P(HoldingSpaceTrayTest, DownloadsContainerWithFinalizedItemsOnly) { ...@@ -358,7 +358,7 @@ TEST_P(HoldingSpaceTrayTest, DownloadsContainerWithFinalizedItemsOnly) {
} }
test_api()->Show(); test_api()->Show();
EXPECT_TRUE(test_api()->RecentFilesContainerShown()); EXPECT_TRUE(test_api()->RecentFilesBubbleShown());
std::vector<views::View*> download_files = test_api()->GetDownloadChips(); std::vector<views::View*> download_files = test_api()->GetDownloadChips();
ASSERT_EQ(items.size(), download_files.size()); ASSERT_EQ(items.size(), download_files.size());
...@@ -401,7 +401,7 @@ TEST_P(HoldingSpaceTrayTest, FinalizingDownloadItemThatShouldBeInvisible) { ...@@ -401,7 +401,7 @@ TEST_P(HoldingSpaceTrayTest, FinalizingDownloadItemThatShouldBeInvisible) {
HoldingSpaceItemView::Cast(download_chips[1])->item()->id()); HoldingSpaceItemView::Cast(download_chips[1])->item()->id());
// Finalize partially initialized item, and verify it's not added to the // Finalize partially initialized item, and verify it's not added to the
// container. // section.
model()->FinalizeOrRemoveItem(item_1->id(), GURL("filesystem:fake_1")); model()->FinalizeOrRemoveItem(item_1->id(), GURL("filesystem:fake_1"));
EXPECT_TRUE(test_api()->GetPinnedFileChips().empty()); EXPECT_TRUE(test_api()->GetPinnedFileChips().empty());
...@@ -413,7 +413,7 @@ TEST_P(HoldingSpaceTrayTest, FinalizingDownloadItemThatShouldBeInvisible) { ...@@ -413,7 +413,7 @@ TEST_P(HoldingSpaceTrayTest, FinalizingDownloadItemThatShouldBeInvisible) {
EXPECT_EQ(item_2->id(), EXPECT_EQ(item_2->id(),
HoldingSpaceItemView::Cast(download_chips[1])->item()->id()); HoldingSpaceItemView::Cast(download_chips[1])->item()->id());
// Remove the oldest item, and verify the container doesn't get updated. // Remove the oldest item, and verify the section doesn't get updated.
model()->RemoveItem(item_1->id()); model()->RemoveItem(item_1->id());
EXPECT_TRUE(test_api()->GetPinnedFileChips().empty()); EXPECT_TRUE(test_api()->GetPinnedFileChips().empty());
...@@ -465,20 +465,20 @@ TEST_P(HoldingSpaceTrayTest, PartialItemNowShownOnRemovingADownloadItem) { ...@@ -465,20 +465,20 @@ TEST_P(HoldingSpaceTrayTest, PartialItemNowShownOnRemovingADownloadItem) {
HoldingSpaceItemView::Cast(download_chips[0])->item()->id()); HoldingSpaceItemView::Cast(download_chips[0])->item()->id());
} }
// Tests how screen capture list is updated during item addition, removal and // Tests how screen captures section is updated during item addition, removal
// finalization // and finalization.
TEST_P(HoldingSpaceTrayTest, ScreenCaptureContainer) { TEST_P(HoldingSpaceTrayTest, ScreenCapturesSection) {
StartSession(); StartSession();
test_api()->Show(); test_api()->Show();
EXPECT_TRUE(test_api()->PinnedFilesContainerShown()); EXPECT_TRUE(test_api()->PinnedFilesBubbleShown());
EXPECT_FALSE(test_api()->RecentFilesContainerShown()); EXPECT_FALSE(test_api()->RecentFilesBubbleShown());
// Add a screenshot item and verify recent file container gets shown. // Add a screenshot item and verify recent file bubble gets shown.
HoldingSpaceItem* item_1 = AddItem(HoldingSpaceItem::Type::kScreenshot, HoldingSpaceItem* item_1 = AddItem(HoldingSpaceItem::Type::kScreenshot,
base::FilePath("/tmp/fake_1")); base::FilePath("/tmp/fake_1"));
EXPECT_TRUE(test_api()->PinnedFilesContainerShown()); EXPECT_TRUE(test_api()->PinnedFilesBubbleShown());
EXPECT_TRUE(test_api()->RecentFilesContainerShown()); EXPECT_TRUE(test_api()->RecentFilesBubbleShown());
EXPECT_TRUE(test_api()->GetPinnedFileChips().empty()); EXPECT_TRUE(test_api()->GetPinnedFileChips().empty());
EXPECT_TRUE(test_api()->GetDownloadChips().empty()); EXPECT_TRUE(test_api()->GetDownloadChips().empty());
...@@ -497,7 +497,7 @@ TEST_P(HoldingSpaceTrayTest, ScreenCaptureContainer) { ...@@ -497,7 +497,7 @@ TEST_P(HoldingSpaceTrayTest, ScreenCaptureContainer) {
EXPECT_EQ(item_1->id(), EXPECT_EQ(item_1->id(),
HoldingSpaceItemView::Cast(screen_captures[0])->item()->id()); HoldingSpaceItemView::Cast(screen_captures[0])->item()->id());
// Add more items to fill up the container. // Add more items to fill up the section.
HoldingSpaceItem* item_3 = AddItem(HoldingSpaceItem::Type::kScreenshot, HoldingSpaceItem* item_3 = AddItem(HoldingSpaceItem::Type::kScreenshot,
base::FilePath("/tmp/fake_3")); base::FilePath("/tmp/fake_3"));
HoldingSpaceItem* item_4 = AddItem(HoldingSpaceItem::Type::kScreenshot, HoldingSpaceItem* item_4 = AddItem(HoldingSpaceItem::Type::kScreenshot,
...@@ -515,7 +515,7 @@ TEST_P(HoldingSpaceTrayTest, ScreenCaptureContainer) { ...@@ -515,7 +515,7 @@ TEST_P(HoldingSpaceTrayTest, ScreenCaptureContainer) {
HoldingSpaceItemView::Cast(screen_captures[2])->item()->id()); HoldingSpaceItemView::Cast(screen_captures[2])->item()->id());
// Finalize partially initialized item, and verify it gets added to the // Finalize partially initialized item, and verify it gets added to the
// container, in the order of addition, replacing the oldest item. // section, in the order of addition, replacing the oldest item.
model()->FinalizeOrRemoveItem(item_2->id(), GURL("filesystem:fake_2")); model()->FinalizeOrRemoveItem(item_2->id(), GURL("filesystem:fake_2"));
EXPECT_TRUE(test_api()->GetPinnedFileChips().empty()); EXPECT_TRUE(test_api()->GetPinnedFileChips().empty());
...@@ -529,7 +529,7 @@ TEST_P(HoldingSpaceTrayTest, ScreenCaptureContainer) { ...@@ -529,7 +529,7 @@ TEST_P(HoldingSpaceTrayTest, ScreenCaptureContainer) {
EXPECT_EQ(item_2->id(), EXPECT_EQ(item_2->id(),
HoldingSpaceItemView::Cast(screen_captures[2])->item()->id()); HoldingSpaceItemView::Cast(screen_captures[2])->item()->id());
// Remove the newest item, and verify the container gets updated. // Remove the newest item, and verify the section gets updated.
model()->RemoveItem(item_4->id()); model()->RemoveItem(item_4->id());
EXPECT_TRUE(test_api()->GetPinnedFileChips().empty()); EXPECT_TRUE(test_api()->GetPinnedFileChips().empty());
...@@ -543,7 +543,7 @@ TEST_P(HoldingSpaceTrayTest, ScreenCaptureContainer) { ...@@ -543,7 +543,7 @@ TEST_P(HoldingSpaceTrayTest, ScreenCaptureContainer) {
EXPECT_EQ(item_1->id(), EXPECT_EQ(item_1->id(),
HoldingSpaceItemView::Cast(screen_captures[2])->item()->id()); HoldingSpaceItemView::Cast(screen_captures[2])->item()->id());
// Remove other items, and verify the recent files container gets hidden. // Remove other items, and verify the recent files bubble gets hidden.
model()->RemoveItem(item_2->id()); model()->RemoveItem(item_2->id());
EXPECT_TRUE(test_api()->GetPinnedFileChips().empty()); EXPECT_TRUE(test_api()->GetPinnedFileChips().empty());
...@@ -559,15 +559,15 @@ TEST_P(HoldingSpaceTrayTest, ScreenCaptureContainer) { ...@@ -559,15 +559,15 @@ TEST_P(HoldingSpaceTrayTest, ScreenCaptureContainer) {
model()->RemoveItem(item_1->id()); model()->RemoveItem(item_1->id());
EXPECT_TRUE(test_api()->GetScreenCaptureViews().empty()); EXPECT_TRUE(test_api()->GetScreenCaptureViews().empty());
EXPECT_FALSE(test_api()->RecentFilesContainerShown()); EXPECT_FALSE(test_api()->RecentFilesBubbleShown());
// Pinned container is showing "educational" info, and it should remain shown. // Pinned bubble is showing "educational" info, and it should remain shown.
EXPECT_TRUE(test_api()->PinnedFilesContainerShown()); EXPECT_TRUE(test_api()->PinnedFilesBubbleShown());
} }
// Verifies the screen captures container is shown and orders items as expected // Verifies the screen captures section is shown and orders items as expected
// when the model contains a number of finalized items prior to showing UI. // when the model contains a number of finalized items prior to showing UI.
TEST_P(HoldingSpaceTrayTest, ScreenCapturesContainerWithFinalizedItemsOnly) { TEST_P(HoldingSpaceTrayTest, ScreenCapturesSectionWithFinalizedItemsOnly) {
MarkTimeOfFirstPin(); MarkTimeOfFirstPin();
StartSession(); StartSession();
...@@ -580,7 +580,7 @@ TEST_P(HoldingSpaceTrayTest, ScreenCapturesContainerWithFinalizedItemsOnly) { ...@@ -580,7 +580,7 @@ TEST_P(HoldingSpaceTrayTest, ScreenCapturesContainerWithFinalizedItemsOnly) {
} }
test_api()->Show(); test_api()->Show();
EXPECT_TRUE(test_api()->RecentFilesContainerShown()); EXPECT_TRUE(test_api()->RecentFilesBubbleShown());
std::vector<views::View*> screenshots = test_api()->GetScreenCaptureViews(); std::vector<views::View*> screenshots = test_api()->GetScreenCaptureViews();
ASSERT_EQ(items.size(), screenshots.size()); ASSERT_EQ(items.size(), screenshots.size());
...@@ -608,13 +608,13 @@ TEST_P(HoldingSpaceTrayTest, FinalizingScreenCaptureItemThatShouldBeInvisible) { ...@@ -608,13 +608,13 @@ TEST_P(HoldingSpaceTrayTest, FinalizingScreenCaptureItemThatShouldBeInvisible) {
HoldingSpaceItem* item_1 = AddPartiallyInitializedItem( HoldingSpaceItem* item_1 = AddPartiallyInitializedItem(
HoldingSpaceItem::Type::kScreenshot, base::FilePath("/tmp/fake_1")); HoldingSpaceItem::Type::kScreenshot, base::FilePath("/tmp/fake_1"));
EXPECT_FALSE(test_api()->RecentFilesContainerShown()); EXPECT_FALSE(test_api()->RecentFilesBubbleShown());
EXPECT_TRUE(test_api()->GetPinnedFileChips().empty()); EXPECT_TRUE(test_api()->GetPinnedFileChips().empty());
EXPECT_TRUE(test_api()->GetDownloadChips().empty()); EXPECT_TRUE(test_api()->GetDownloadChips().empty());
EXPECT_TRUE(test_api()->GetScreenCaptureViews().empty()); EXPECT_TRUE(test_api()->GetScreenCaptureViews().empty());
// Add enough screenshot items to fill up the container. // Add enough screenshot items to fill up the section.
HoldingSpaceItem* item_2 = AddItem(HoldingSpaceItem::Type::kScreenshot, HoldingSpaceItem* item_2 = AddItem(HoldingSpaceItem::Type::kScreenshot,
base::FilePath("/tmp/fake_2")); base::FilePath("/tmp/fake_2"));
HoldingSpaceItem* item_3 = AddItem(HoldingSpaceItem::Type::kScreenshot, HoldingSpaceItem* item_3 = AddItem(HoldingSpaceItem::Type::kScreenshot,
...@@ -635,7 +635,7 @@ TEST_P(HoldingSpaceTrayTest, FinalizingScreenCaptureItemThatShouldBeInvisible) { ...@@ -635,7 +635,7 @@ TEST_P(HoldingSpaceTrayTest, FinalizingScreenCaptureItemThatShouldBeInvisible) {
HoldingSpaceItemView::Cast(screen_captures[2])->item()->id()); HoldingSpaceItemView::Cast(screen_captures[2])->item()->id());
// Finalize partially initialized item, and verify it's not added to the // Finalize partially initialized item, and verify it's not added to the
// container. // section.
model()->FinalizeOrRemoveItem(item_1->id(), GURL("filesystem:fake_1")); model()->FinalizeOrRemoveItem(item_1->id(), GURL("filesystem:fake_1"));
EXPECT_TRUE(test_api()->GetPinnedFileChips().empty()); EXPECT_TRUE(test_api()->GetPinnedFileChips().empty());
...@@ -649,7 +649,7 @@ TEST_P(HoldingSpaceTrayTest, FinalizingScreenCaptureItemThatShouldBeInvisible) { ...@@ -649,7 +649,7 @@ TEST_P(HoldingSpaceTrayTest, FinalizingScreenCaptureItemThatShouldBeInvisible) {
EXPECT_EQ(item_2->id(), EXPECT_EQ(item_2->id(),
HoldingSpaceItemView::Cast(screen_captures[2])->item()->id()); HoldingSpaceItemView::Cast(screen_captures[2])->item()->id());
// Remove the oldest item, and verify the container doesn't get updated. // Remove the oldest item, and verify the section doesn't get updated.
model()->RemoveItem(item_1->id()); model()->RemoveItem(item_1->id());
EXPECT_TRUE(test_api()->GetPinnedFileChips().empty()); EXPECT_TRUE(test_api()->GetPinnedFileChips().empty());
...@@ -712,9 +712,9 @@ TEST_P(HoldingSpaceTrayTest, PartialItemNowShownOnRemovingAScreenCapture) { ...@@ -712,9 +712,9 @@ TEST_P(HoldingSpaceTrayTest, PartialItemNowShownOnRemovingAScreenCapture) {
test_api()->Close(); test_api()->Close();
} }
// Tests how the pinned item list is updated during item addition, removal and // Tests how the pinned item section is updated during item addition, removal
// finalization. // and finalization.
TEST_P(HoldingSpaceTrayTest, PinnedFilesContainer) { TEST_P(HoldingSpaceTrayTest, PinnedFilesSection) {
MarkTimeOfFirstPin(); MarkTimeOfFirstPin();
StartSession(); StartSession();
...@@ -722,8 +722,8 @@ TEST_P(HoldingSpaceTrayTest, PinnedFilesContainer) { ...@@ -722,8 +722,8 @@ TEST_P(HoldingSpaceTrayTest, PinnedFilesContainer) {
base::FilePath("/tmp/fake_1")); base::FilePath("/tmp/fake_1"));
test_api()->Show(); test_api()->Show();
EXPECT_TRUE(test_api()->PinnedFilesContainerShown()); EXPECT_TRUE(test_api()->PinnedFilesBubbleShown());
EXPECT_FALSE(test_api()->RecentFilesContainerShown()); EXPECT_FALSE(test_api()->RecentFilesBubbleShown());
EXPECT_TRUE(test_api()->GetDownloadChips().empty()); EXPECT_TRUE(test_api()->GetDownloadChips().empty());
EXPECT_TRUE(test_api()->GetScreenCaptureViews().empty()); EXPECT_TRUE(test_api()->GetScreenCaptureViews().empty());
...@@ -744,7 +744,7 @@ TEST_P(HoldingSpaceTrayTest, PinnedFilesContainer) { ...@@ -744,7 +744,7 @@ TEST_P(HoldingSpaceTrayTest, PinnedFilesContainer) {
EXPECT_EQ(item_1->id(), EXPECT_EQ(item_1->id(),
HoldingSpaceItemView::Cast(pinned_files[0])->item()->id()); HoldingSpaceItemView::Cast(pinned_files[0])->item()->id());
// Add more items to the container. // Add more items to the section.
HoldingSpaceItem* item_3 = AddPartiallyInitializedItem( HoldingSpaceItem* item_3 = AddPartiallyInitializedItem(
HoldingSpaceItem::Type::kPinnedFile, base::FilePath("/tmp/fake_3")); HoldingSpaceItem::Type::kPinnedFile, base::FilePath("/tmp/fake_3"));
HoldingSpaceItem* item_4 = AddItem(HoldingSpaceItem::Type::kPinnedFile, HoldingSpaceItem* item_4 = AddItem(HoldingSpaceItem::Type::kPinnedFile,
...@@ -787,7 +787,7 @@ TEST_P(HoldingSpaceTrayTest, PinnedFilesContainer) { ...@@ -787,7 +787,7 @@ TEST_P(HoldingSpaceTrayTest, PinnedFilesContainer) {
EXPECT_EQ(item_1->id(), EXPECT_EQ(item_1->id(),
HoldingSpaceItemView::Cast(pinned_files[2])->item()->id()); HoldingSpaceItemView::Cast(pinned_files[2])->item()->id());
// Remove the newest item, and verify the container gets updated. // Remove the newest item, and verify the section gets updated.
model()->RemoveItem(item_4->id()); model()->RemoveItem(item_4->id());
EXPECT_TRUE(test_api()->GetDownloadChips().empty()); EXPECT_TRUE(test_api()->GetDownloadChips().empty());
...@@ -799,7 +799,7 @@ TEST_P(HoldingSpaceTrayTest, PinnedFilesContainer) { ...@@ -799,7 +799,7 @@ TEST_P(HoldingSpaceTrayTest, PinnedFilesContainer) {
EXPECT_EQ(item_1->id(), EXPECT_EQ(item_1->id(),
HoldingSpaceItemView::Cast(pinned_files[1])->item()->id()); HoldingSpaceItemView::Cast(pinned_files[1])->item()->id());
// Remove other items, and verify the files container gets hidden. // Remove other items, and verify the files section gets hidden.
model()->RemoveItem(item_2->id()); model()->RemoveItem(item_2->id());
EXPECT_TRUE(test_api()->GetDownloadChips().empty()); EXPECT_TRUE(test_api()->GetDownloadChips().empty());
EXPECT_TRUE(test_api()->GetScreenCaptureViews().empty()); EXPECT_TRUE(test_api()->GetScreenCaptureViews().empty());
...@@ -813,14 +813,14 @@ TEST_P(HoldingSpaceTrayTest, PinnedFilesContainer) { ...@@ -813,14 +813,14 @@ TEST_P(HoldingSpaceTrayTest, PinnedFilesContainer) {
EXPECT_TRUE(test_api()->GetScreenCaptureViews().empty()); EXPECT_TRUE(test_api()->GetScreenCaptureViews().empty());
EXPECT_TRUE(test_api()->GetPinnedFileChips().empty()); EXPECT_TRUE(test_api()->GetPinnedFileChips().empty());
EXPECT_FALSE(test_api()->RecentFilesContainerShown()); EXPECT_FALSE(test_api()->RecentFilesBubbleShown());
EXPECT_FALSE(test_api()->PinnedFilesContainerShown()); EXPECT_FALSE(test_api()->PinnedFilesBubbleShown());
} }
// Verifies the pinned items container is not shown if it only contains // Verifies the pinned files bubble is not shown if it only contains partially
// partially initialized items. // initialized items.
TEST_P(HoldingSpaceTrayTest, TEST_P(HoldingSpaceTrayTest,
PinnedFilesContainerWithPartiallyInitializedItemsOnly) { PinnedFilesBubbleWithPartiallyInitializedItemsOnly) {
MarkTimeOfFirstPin(); MarkTimeOfFirstPin();
StartSession(); StartSession();
...@@ -831,17 +831,17 @@ TEST_P(HoldingSpaceTrayTest, ...@@ -831,17 +831,17 @@ TEST_P(HoldingSpaceTrayTest,
base::FilePath("/tmp/fake_1")); base::FilePath("/tmp/fake_1"));
test_api()->Show(); test_api()->Show();
EXPECT_FALSE(test_api()->PinnedFilesContainerShown()); EXPECT_FALSE(test_api()->PinnedFilesBubbleShown());
// Add another partially initialized item. // Add another partially initialized item.
HoldingSpaceItem* item_2 = AddPartiallyInitializedItem( HoldingSpaceItem* item_2 = AddPartiallyInitializedItem(
HoldingSpaceItem::Type::kPinnedFile, base::FilePath("/tmp/fake_2")); HoldingSpaceItem::Type::kPinnedFile, base::FilePath("/tmp/fake_2"));
EXPECT_FALSE(test_api()->PinnedFilesContainerShown()); EXPECT_FALSE(test_api()->PinnedFilesBubbleShown());
// Add a fully initialized item, and verify it gets shown. // Add a fully initialized item, and verify it gets shown.
HoldingSpaceItem* item_3 = AddItem(HoldingSpaceItem::Type::kPinnedFile, HoldingSpaceItem* item_3 = AddItem(HoldingSpaceItem::Type::kPinnedFile,
base::FilePath("/tmp/fake_3")); base::FilePath("/tmp/fake_3"));
EXPECT_TRUE(test_api()->PinnedFilesContainerShown()); EXPECT_TRUE(test_api()->PinnedFilesBubbleShown());
std::vector<views::View*> pinned_files = test_api()->GetPinnedFileChips(); std::vector<views::View*> pinned_files = test_api()->GetPinnedFileChips();
ASSERT_EQ(1u, pinned_files.size()); ASSERT_EQ(1u, pinned_files.size());
...@@ -859,9 +859,9 @@ TEST_P(HoldingSpaceTrayTest, ...@@ -859,9 +859,9 @@ TEST_P(HoldingSpaceTrayTest,
HoldingSpaceItemView::Cast(pinned_files[0])->item()->id()); HoldingSpaceItemView::Cast(pinned_files[0])->item()->id());
} }
// Verifies the pinned items container is shown and orders items as expected // Verifies the pinned items section is shown and orders items as expected when
// when the model contains a number of finalized items prior to showing UI. // the model contains a number of finalized items prior to showing UI.
TEST_P(HoldingSpaceTrayTest, PinnedFilesContainerWithFinalizedItemsOnly) { TEST_P(HoldingSpaceTrayTest, PinnedFilesSectionWithFinalizedItemsOnly) {
MarkTimeOfFirstPin(); MarkTimeOfFirstPin();
StartSession(); StartSession();
...@@ -874,7 +874,7 @@ TEST_P(HoldingSpaceTrayTest, PinnedFilesContainerWithFinalizedItemsOnly) { ...@@ -874,7 +874,7 @@ TEST_P(HoldingSpaceTrayTest, PinnedFilesContainerWithFinalizedItemsOnly) {
} }
test_api()->Show(); test_api()->Show();
EXPECT_TRUE(test_api()->PinnedFilesContainerShown()); EXPECT_TRUE(test_api()->PinnedFilesBubbleShown());
std::vector<views::View*> pinned_files = test_api()->GetPinnedFileChips(); std::vector<views::View*> pinned_files = test_api()->GetPinnedFileChips();
ASSERT_EQ(items.size(), pinned_files.size()); ASSERT_EQ(items.size(), pinned_files.size());
...@@ -891,24 +891,24 @@ TEST_P(HoldingSpaceTrayTest, PinnedFilesContainerWithFinalizedItemsOnly) { ...@@ -891,24 +891,24 @@ TEST_P(HoldingSpaceTrayTest, PinnedFilesContainerWithFinalizedItemsOnly) {
} }
// Tests that as nearby shared files are added to the model, they show on the // Tests that as nearby shared files are added to the model, they show on the
// downloads container. // downloads section.
TEST_P(HoldingSpaceTrayTest, DownloadsContainerWithNearbySharedFiles) { TEST_P(HoldingSpaceTrayTest, DownloadsSectionWithNearbySharedFiles) {
StartSession(); StartSession();
test_api()->Show(); test_api()->Show();
EXPECT_TRUE(test_api()->PinnedFilesContainerShown()); EXPECT_TRUE(test_api()->PinnedFilesBubbleShown());
EXPECT_FALSE(test_api()->RecentFilesContainerShown()); EXPECT_FALSE(test_api()->RecentFilesBubbleShown());
EXPECT_TRUE(test_api()->GetPinnedFileChips().empty()); EXPECT_TRUE(test_api()->GetPinnedFileChips().empty());
ASSERT_TRUE(test_api()->GetDownloadChips().empty()); ASSERT_TRUE(test_api()->GetDownloadChips().empty());
// Add a nearby share item and verify recent file container gets shown. // Add a nearby share item and verify recent files bubble gets shown.
HoldingSpaceItem* item_1 = AddItem(HoldingSpaceItem::Type::kNearbyShare, HoldingSpaceItem* item_1 = AddItem(HoldingSpaceItem::Type::kNearbyShare,
base::FilePath("/tmp/fake_1")); base::FilePath("/tmp/fake_1"));
ASSERT_TRUE(item_1->IsFinalized()); ASSERT_TRUE(item_1->IsFinalized());
EXPECT_TRUE(test_api()->PinnedFilesContainerShown()); EXPECT_TRUE(test_api()->PinnedFilesBubbleShown());
EXPECT_TRUE(test_api()->RecentFilesContainerShown()); EXPECT_TRUE(test_api()->RecentFilesBubbleShown());
EXPECT_TRUE(test_api()->GetPinnedFileChips().empty()); EXPECT_TRUE(test_api()->GetPinnedFileChips().empty());
EXPECT_TRUE(test_api()->GetScreenCaptureViews().empty()); EXPECT_TRUE(test_api()->GetScreenCaptureViews().empty());
...@@ -928,7 +928,7 @@ TEST_P(HoldingSpaceTrayTest, DownloadsContainerWithNearbySharedFiles) { ...@@ -928,7 +928,7 @@ TEST_P(HoldingSpaceTrayTest, DownloadsContainerWithNearbySharedFiles) {
EXPECT_EQ(item_1->id(), EXPECT_EQ(item_1->id(),
HoldingSpaceItemView::Cast(download_chips[1])->item()->id()); HoldingSpaceItemView::Cast(download_chips[1])->item()->id());
// Remove the first item, and verify the container gets updated. // Remove the first item, and verify the section gets updated.
model()->RemoveItem(item_1->id()); model()->RemoveItem(item_1->id());
EXPECT_TRUE(test_api()->GetPinnedFileChips().empty()); EXPECT_TRUE(test_api()->GetPinnedFileChips().empty());
...@@ -947,7 +947,7 @@ TEST_P(HoldingSpaceTrayTest, PartialNearbyShareItemWithExistingDownloadItems) { ...@@ -947,7 +947,7 @@ TEST_P(HoldingSpaceTrayTest, PartialNearbyShareItemWithExistingDownloadItems) {
StartSession(); StartSession();
test_api()->Show(); test_api()->Show();
EXPECT_FALSE(test_api()->RecentFilesContainerShown()); EXPECT_FALSE(test_api()->RecentFilesBubbleShown());
ASSERT_TRUE(test_api()->GetDownloadChips().empty()); ASSERT_TRUE(test_api()->GetDownloadChips().empty());
// Add partially initialized nearby share item - verify it doesn't get shown // Add partially initialized nearby share item - verify it doesn't get shown
...@@ -955,21 +955,21 @@ TEST_P(HoldingSpaceTrayTest, PartialNearbyShareItemWithExistingDownloadItems) { ...@@ -955,21 +955,21 @@ TEST_P(HoldingSpaceTrayTest, PartialNearbyShareItemWithExistingDownloadItems) {
HoldingSpaceItem* nearby_share_item = HoldingSpaceItem* nearby_share_item =
AddPartiallyInitializedItem(HoldingSpaceItem::Type::kNearbyShare, AddPartiallyInitializedItem(HoldingSpaceItem::Type::kNearbyShare,
base::FilePath("/tmp/nearby_share")); base::FilePath("/tmp/nearby_share"));
EXPECT_FALSE(test_api()->RecentFilesContainerShown()); EXPECT_FALSE(test_api()->RecentFilesBubbleShown());
EXPECT_TRUE(test_api()->GetDownloadChips().empty()); EXPECT_TRUE(test_api()->GetDownloadChips().empty());
// Add partially initialized screenshot item - verify it doesn't get shown in // Add partially initialized screenshot item - verify it doesn't get shown in
// the UI yet. // the UI yet.
HoldingSpaceItem* screenshot_item = AddPartiallyInitializedItem( HoldingSpaceItem* screenshot_item = AddPartiallyInitializedItem(
HoldingSpaceItem::Type::kScreenshot, base::FilePath("/tmp/screenshot")); HoldingSpaceItem::Type::kScreenshot, base::FilePath("/tmp/screenshot"));
EXPECT_FALSE(test_api()->RecentFilesContainerShown()); EXPECT_FALSE(test_api()->RecentFilesBubbleShown());
// Add two download items. // Add two download items.
HoldingSpaceItem* download_item_1 = AddItem( HoldingSpaceItem* download_item_1 = AddItem(
HoldingSpaceItem::Type::kDownload, base::FilePath("/tmp/download_1")); HoldingSpaceItem::Type::kDownload, base::FilePath("/tmp/download_1"));
HoldingSpaceItem* download_item_2 = AddItem( HoldingSpaceItem* download_item_2 = AddItem(
HoldingSpaceItem::Type::kDownload, base::FilePath("/tmp/download_2")); HoldingSpaceItem::Type::kDownload, base::FilePath("/tmp/download_2"));
EXPECT_TRUE(test_api()->RecentFilesContainerShown()); EXPECT_TRUE(test_api()->RecentFilesBubbleShown());
EXPECT_TRUE(test_api()->GetPinnedFileChips().empty()); EXPECT_TRUE(test_api()->GetPinnedFileChips().empty());
EXPECT_TRUE(test_api()->GetScreenCaptureViews().empty()); EXPECT_TRUE(test_api()->GetScreenCaptureViews().empty());
std::vector<views::View*> download_chips = test_api()->GetDownloadChips(); std::vector<views::View*> download_chips = test_api()->GetDownloadChips();
...@@ -1027,14 +1027,14 @@ TEST_P(HoldingSpaceTrayTest, PartialDownloadItemWithExistingNearbyShareItems) { ...@@ -1027,14 +1027,14 @@ TEST_P(HoldingSpaceTrayTest, PartialDownloadItemWithExistingNearbyShareItems) {
StartSession(); StartSession();
test_api()->Show(); test_api()->Show();
EXPECT_FALSE(test_api()->RecentFilesContainerShown()); EXPECT_FALSE(test_api()->RecentFilesBubbleShown());
ASSERT_TRUE(test_api()->GetDownloadChips().empty()); ASSERT_TRUE(test_api()->GetDownloadChips().empty());
// Add partially initialized download item - verify it doesn't get shown // Add partially initialized download item - verify it doesn't get shown
// in the UI yet. // in the UI yet.
HoldingSpaceItem* item_1 = AddPartiallyInitializedItem( HoldingSpaceItem* item_1 = AddPartiallyInitializedItem(
HoldingSpaceItem::Type::kDownload, base::FilePath("/tmp/fake_1")); HoldingSpaceItem::Type::kDownload, base::FilePath("/tmp/fake_1"));
EXPECT_FALSE(test_api()->RecentFilesContainerShown()); EXPECT_FALSE(test_api()->RecentFilesBubbleShown());
EXPECT_TRUE(test_api()->GetDownloadChips().empty()); EXPECT_TRUE(test_api()->GetDownloadChips().empty());
// Add two nearby share items. // Add two nearby share items.
...@@ -1042,7 +1042,7 @@ TEST_P(HoldingSpaceTrayTest, PartialDownloadItemWithExistingNearbyShareItems) { ...@@ -1042,7 +1042,7 @@ TEST_P(HoldingSpaceTrayTest, PartialDownloadItemWithExistingNearbyShareItems) {
base::FilePath("/tmp/fake_2")); base::FilePath("/tmp/fake_2"));
HoldingSpaceItem* item_3 = AddItem(HoldingSpaceItem::Type::kNearbyShare, HoldingSpaceItem* item_3 = AddItem(HoldingSpaceItem::Type::kNearbyShare,
base::FilePath("/tmp/fake_3")); base::FilePath("/tmp/fake_3"));
EXPECT_TRUE(test_api()->RecentFilesContainerShown()); EXPECT_TRUE(test_api()->RecentFilesBubbleShown());
EXPECT_TRUE(test_api()->GetPinnedFileChips().empty()); EXPECT_TRUE(test_api()->GetPinnedFileChips().empty());
EXPECT_TRUE(test_api()->GetScreenCaptureViews().empty()); EXPECT_TRUE(test_api()->GetScreenCaptureViews().empty());
std::vector<views::View*> download_chips = test_api()->GetDownloadChips(); std::vector<views::View*> download_chips = test_api()->GetDownloadChips();
...@@ -1099,24 +1099,24 @@ TEST_P(HoldingSpaceTrayTest, ShouldMaybeShowContextMenuOnRightClick) { ...@@ -1099,24 +1099,24 @@ TEST_P(HoldingSpaceTrayTest, ShouldMaybeShowContextMenuOnRightClick) {
} }
// Tests that as screen recording files are added to the model, they show in the // Tests that as screen recording files are added to the model, they show in the
// screen capture container. // screen captures section.
TEST_P(HoldingSpaceTrayTest, ScreenCaptureContainerWithScreenRecordingFiles) { TEST_P(HoldingSpaceTrayTest, ScreenCapturesSectionWithScreenRecordingFiles) {
StartSession(); StartSession();
test_api()->Show(); test_api()->Show();
EXPECT_TRUE(test_api()->PinnedFilesContainerShown()); EXPECT_TRUE(test_api()->PinnedFilesBubbleShown());
EXPECT_FALSE(test_api()->RecentFilesContainerShown()); EXPECT_FALSE(test_api()->RecentFilesBubbleShown());
EXPECT_TRUE(test_api()->GetPinnedFileChips().empty()); EXPECT_TRUE(test_api()->GetPinnedFileChips().empty());
ASSERT_TRUE(test_api()->GetScreenCaptureViews().empty()); ASSERT_TRUE(test_api()->GetScreenCaptureViews().empty());
// Add a screen recording item and verify recent file container gets shown. // Add a screen recording item and verify recent files section gets shown.
HoldingSpaceItem* item_1 = AddItem(HoldingSpaceItem::Type::kScreenRecording, HoldingSpaceItem* item_1 = AddItem(HoldingSpaceItem::Type::kScreenRecording,
base::FilePath("/tmp/fake_1")); base::FilePath("/tmp/fake_1"));
ASSERT_TRUE(item_1->IsFinalized()); ASSERT_TRUE(item_1->IsFinalized());
EXPECT_TRUE(test_api()->PinnedFilesContainerShown()); EXPECT_TRUE(test_api()->PinnedFilesBubbleShown());
EXPECT_TRUE(test_api()->RecentFilesContainerShown()); EXPECT_TRUE(test_api()->RecentFilesBubbleShown());
EXPECT_TRUE(test_api()->GetPinnedFileChips().empty()); EXPECT_TRUE(test_api()->GetPinnedFileChips().empty());
EXPECT_TRUE(test_api()->GetDownloadChips().empty()); EXPECT_TRUE(test_api()->GetDownloadChips().empty());
...@@ -1137,7 +1137,7 @@ TEST_P(HoldingSpaceTrayTest, ScreenCaptureContainerWithScreenRecordingFiles) { ...@@ -1137,7 +1137,7 @@ TEST_P(HoldingSpaceTrayTest, ScreenCaptureContainerWithScreenRecordingFiles) {
EXPECT_EQ(item_1->id(), EXPECT_EQ(item_1->id(),
HoldingSpaceItemView::Cast(screen_capture_chips[1])->item()->id()); HoldingSpaceItemView::Cast(screen_capture_chips[1])->item()->id());
// Remove the first item, and verify the container gets updated. // Remove the first item, and verify the section gets updated.
model()->RemoveItem(item_1->id()); model()->RemoveItem(item_1->id());
EXPECT_TRUE(test_api()->GetPinnedFileChips().empty()); EXPECT_TRUE(test_api()->GetPinnedFileChips().empty());
...@@ -1157,7 +1157,7 @@ TEST_P(HoldingSpaceTrayTest, ...@@ -1157,7 +1157,7 @@ TEST_P(HoldingSpaceTrayTest,
StartSession(); StartSession();
test_api()->Show(); test_api()->Show();
EXPECT_FALSE(test_api()->RecentFilesContainerShown()); EXPECT_FALSE(test_api()->RecentFilesBubbleShown());
ASSERT_TRUE(test_api()->GetScreenCaptureViews().empty()); ASSERT_TRUE(test_api()->GetScreenCaptureViews().empty());
// Add partially initialized screen recording item - verify it doesn't get // Add partially initialized screen recording item - verify it doesn't get
...@@ -1165,17 +1165,17 @@ TEST_P(HoldingSpaceTrayTest, ...@@ -1165,17 +1165,17 @@ TEST_P(HoldingSpaceTrayTest,
HoldingSpaceItem* screen_recording_item = HoldingSpaceItem* screen_recording_item =
AddPartiallyInitializedItem(HoldingSpaceItem::Type::kScreenRecording, AddPartiallyInitializedItem(HoldingSpaceItem::Type::kScreenRecording,
base::FilePath("/tmp/screen_recording")); base::FilePath("/tmp/screen_recording"));
EXPECT_FALSE(test_api()->RecentFilesContainerShown()); EXPECT_FALSE(test_api()->RecentFilesBubbleShown());
EXPECT_TRUE(test_api()->GetScreenCaptureViews().empty()); EXPECT_TRUE(test_api()->GetScreenCaptureViews().empty());
// Add three screenshot items to fill up the container. // Add three screenshot items to fill up the section.
HoldingSpaceItem* screenshot_item_1 = AddItem( HoldingSpaceItem* screenshot_item_1 = AddItem(
HoldingSpaceItem::Type::kScreenshot, base::FilePath("/tmp/screenshot_1")); HoldingSpaceItem::Type::kScreenshot, base::FilePath("/tmp/screenshot_1"));
HoldingSpaceItem* screenshot_item_2 = AddItem( HoldingSpaceItem* screenshot_item_2 = AddItem(
HoldingSpaceItem::Type::kScreenshot, base::FilePath("/tmp/screenshot_2")); HoldingSpaceItem::Type::kScreenshot, base::FilePath("/tmp/screenshot_2"));
HoldingSpaceItem* screenshot_item_3 = AddItem( HoldingSpaceItem* screenshot_item_3 = AddItem(
HoldingSpaceItem::Type::kScreenshot, base::FilePath("/tmp/screenshot_3")); HoldingSpaceItem::Type::kScreenshot, base::FilePath("/tmp/screenshot_3"));
EXPECT_TRUE(test_api()->RecentFilesContainerShown()); EXPECT_TRUE(test_api()->RecentFilesBubbleShown());
EXPECT_TRUE(test_api()->GetPinnedFileChips().empty()); EXPECT_TRUE(test_api()->GetPinnedFileChips().empty());
EXPECT_TRUE(test_api()->GetDownloadChips().empty()); EXPECT_TRUE(test_api()->GetDownloadChips().empty());
std::vector<views::View*> screen_capture_chips = std::vector<views::View*> screen_capture_chips =
...@@ -1255,24 +1255,24 @@ TEST_P(HoldingSpaceTrayTest, ...@@ -1255,24 +1255,24 @@ TEST_P(HoldingSpaceTrayTest,
StartSession(); StartSession();
test_api()->Show(); test_api()->Show();
EXPECT_FALSE(test_api()->RecentFilesContainerShown()); EXPECT_FALSE(test_api()->RecentFilesBubbleShown());
ASSERT_TRUE(test_api()->GetScreenCaptureViews().empty()); ASSERT_TRUE(test_api()->GetScreenCaptureViews().empty());
// Add partially initialized screenshot item - verify it doesn't get shown // Add partially initialized screenshot item - verify it doesn't get shown
// in the UI yet. // in the UI yet.
HoldingSpaceItem* screenshot_item = AddPartiallyInitializedItem( HoldingSpaceItem* screenshot_item = AddPartiallyInitializedItem(
HoldingSpaceItem::Type::kScreenshot, base::FilePath("/tmp/fake_1")); HoldingSpaceItem::Type::kScreenshot, base::FilePath("/tmp/fake_1"));
EXPECT_FALSE(test_api()->RecentFilesContainerShown()); EXPECT_FALSE(test_api()->RecentFilesBubbleShown());
EXPECT_TRUE(test_api()->GetScreenCaptureViews().empty()); EXPECT_TRUE(test_api()->GetScreenCaptureViews().empty());
// Add three screenshot recording items to fill up the container. // Add three screenshot recording items to fill up the section.
HoldingSpaceItem* screen_recording_item_1 = AddItem( HoldingSpaceItem* screen_recording_item_1 = AddItem(
HoldingSpaceItem::Type::kScreenRecording, base::FilePath("/tmp/fake_2")); HoldingSpaceItem::Type::kScreenRecording, base::FilePath("/tmp/fake_2"));
HoldingSpaceItem* screen_recording_item_2 = AddItem( HoldingSpaceItem* screen_recording_item_2 = AddItem(
HoldingSpaceItem::Type::kScreenRecording, base::FilePath("/tmp/fake_3")); HoldingSpaceItem::Type::kScreenRecording, base::FilePath("/tmp/fake_3"));
HoldingSpaceItem* screen_recording_item_3 = AddItem( HoldingSpaceItem* screen_recording_item_3 = AddItem(
HoldingSpaceItem::Type::kScreenRecording, base::FilePath("/tmp/fake_4")); HoldingSpaceItem::Type::kScreenRecording, base::FilePath("/tmp/fake_4"));
EXPECT_TRUE(test_api()->RecentFilesContainerShown()); EXPECT_TRUE(test_api()->RecentFilesBubbleShown());
EXPECT_TRUE(test_api()->GetPinnedFileChips().empty()); EXPECT_TRUE(test_api()->GetPinnedFileChips().empty());
EXPECT_TRUE(test_api()->GetDownloadChips().empty()); EXPECT_TRUE(test_api()->GetDownloadChips().empty());
std::vector<views::View*> screen_capture_chips = std::vector<views::View*> screen_capture_chips =
...@@ -1326,7 +1326,7 @@ TEST_P(HoldingSpaceTrayTest, PlayIconForScreenRecordings) { ...@@ -1326,7 +1326,7 @@ TEST_P(HoldingSpaceTrayTest, PlayIconForScreenRecordings) {
HoldingSpaceItem::Type::kScreenshot, base::FilePath("/tmp/fake_1")); HoldingSpaceItem::Type::kScreenshot, base::FilePath("/tmp/fake_1"));
HoldingSpaceItem* screen_recording_item = AddItem( HoldingSpaceItem* screen_recording_item = AddItem(
HoldingSpaceItem::Type::kScreenRecording, base::FilePath("/tmp/fake_2")); HoldingSpaceItem::Type::kScreenRecording, base::FilePath("/tmp/fake_2"));
EXPECT_TRUE(test_api()->RecentFilesContainerShown()); EXPECT_TRUE(test_api()->RecentFilesBubbleShown());
std::vector<views::View*> screen_capture_chips = std::vector<views::View*> screen_capture_chips =
test_api()->GetScreenCaptureViews(); test_api()->GetScreenCaptureViews();
......
...@@ -2,28 +2,27 @@ ...@@ -2,28 +2,27 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "ash/system/holding_space/pinned_files_container.h" #include "ash/system/holding_space/pinned_files_bubble.h"
#include "ash/public/cpp/holding_space/holding_space_constants.h" #include "ash/public/cpp/holding_space/holding_space_constants.h"
#include "ash/system/holding_space/pinned_files_section.h" #include "ash/system/holding_space/pinned_files_section.h"
namespace ash { namespace ash {
PinnedFilesContainer::PinnedFilesContainer( PinnedFilesBubble::PinnedFilesBubble(HoldingSpaceItemViewDelegate* delegate)
HoldingSpaceItemViewDelegate* delegate)
: HoldingSpaceTrayChildBubble(delegate) { : HoldingSpaceTrayChildBubble(delegate) {
SetID(kHoldingSpacePinnedFilesContainerId); SetID(kHoldingSpacePinnedFilesBubbleId);
} }
PinnedFilesContainer::~PinnedFilesContainer() = default; PinnedFilesBubble::~PinnedFilesBubble() = default;
const char* PinnedFilesContainer::GetClassName() const { const char* PinnedFilesBubble::GetClassName() const {
return "PinnedFilesContainer"; return "PinnedFilesBubble";
} }
std::vector<std::unique_ptr<HoldingSpaceItemViewsContainer>> std::vector<std::unique_ptr<HoldingSpaceItemViewsSection>>
PinnedFilesContainer::CreateSections() { PinnedFilesBubble::CreateSections() {
std::vector<std::unique_ptr<HoldingSpaceItemViewsContainer>> sections; std::vector<std::unique_ptr<HoldingSpaceItemViewsSection>> sections;
sections.push_back(std::make_unique<PinnedFilesSection>(delegate())); sections.push_back(std::make_unique<PinnedFilesSection>(delegate()));
return sections; return sections;
} }
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef ASH_SYSTEM_HOLDING_SPACE_PINNED_FILES_CONTAINER_H_ #ifndef ASH_SYSTEM_HOLDING_SPACE_PINNED_FILES_BUBBLE_H_
#define ASH_SYSTEM_HOLDING_SPACE_PINNED_FILES_CONTAINER_H_ #define ASH_SYSTEM_HOLDING_SPACE_PINNED_FILES_BUBBLE_H_
#include <memory> #include <memory>
#include <vector> #include <vector>
...@@ -12,21 +12,20 @@ ...@@ -12,21 +12,20 @@
namespace ash { namespace ash {
// TODO(dmblack): Rename to `PinnedFilesBubble`.
// Child bubble of `HoldingSpaceTrayBubble` for pinned files. // Child bubble of `HoldingSpaceTrayBubble` for pinned files.
class PinnedFilesContainer : public HoldingSpaceTrayChildBubble { class PinnedFilesBubble : public HoldingSpaceTrayChildBubble {
public: public:
explicit PinnedFilesContainer(HoldingSpaceItemViewDelegate* delegate); explicit PinnedFilesBubble(HoldingSpaceItemViewDelegate* delegate);
PinnedFilesContainer(const PinnedFilesContainer& other) = delete; PinnedFilesBubble(const PinnedFilesBubble& other) = delete;
PinnedFilesContainer& operator=(const PinnedFilesContainer& other) = delete; PinnedFilesBubble& operator=(const PinnedFilesBubble& other) = delete;
~PinnedFilesContainer() override; ~PinnedFilesBubble() override;
// HoldingSpaceTrayChildBubble: // HoldingSpaceTrayChildBubble:
const char* GetClassName() const override; const char* GetClassName() const override;
std::vector<std::unique_ptr<HoldingSpaceItemViewsContainer>> CreateSections() std::vector<std::unique_ptr<HoldingSpaceItemViewsSection>> CreateSections()
override; override;
}; };
} // namespace ash } // namespace ash
#endif // ASH_SYSTEM_HOLDING_SPACE_PINNED_FILES_CONTAINER_H_ #endif // ASH_SYSTEM_HOLDING_SPACE_PINNED_FILES_BUBBLE_H_
...@@ -40,10 +40,10 @@ bool HasEverPinnedHoldingSpaceItem() { ...@@ -40,10 +40,10 @@ bool HasEverPinnedHoldingSpaceItem() {
// PinnedFilesSection ---------------------------------------------------------- // PinnedFilesSection ----------------------------------------------------------
PinnedFilesSection::PinnedFilesSection(HoldingSpaceItemViewDelegate* delegate) PinnedFilesSection::PinnedFilesSection(HoldingSpaceItemViewDelegate* delegate)
: HoldingSpaceItemViewsContainer(delegate, : HoldingSpaceItemViewsSection(delegate,
/*supported_types=*/ /*supported_types=*/
{HoldingSpaceItem::Type::kPinnedFile}, {HoldingSpaceItem::Type::kPinnedFile},
/*max_count=*/base::nullopt) {} /*max_count=*/base::nullopt) {}
PinnedFilesSection::~PinnedFilesSection() = default; PinnedFilesSection::~PinnedFilesSection() = default;
......
...@@ -7,19 +7,19 @@ ...@@ -7,19 +7,19 @@
#include <memory> #include <memory>
#include "ash/system/holding_space/holding_space_item_views_container.h" #include "ash/system/holding_space/holding_space_item_views_section.h"
namespace ash { namespace ash {
// Section for pinned files in the `PinnedFilesContainer`. // Section for pinned files in the `PinnedFilesBubble`.
class PinnedFilesSection : public HoldingSpaceItemViewsContainer { class PinnedFilesSection : public HoldingSpaceItemViewsSection {
public: public:
explicit PinnedFilesSection(HoldingSpaceItemViewDelegate* delegate); explicit PinnedFilesSection(HoldingSpaceItemViewDelegate* delegate);
PinnedFilesSection(const PinnedFilesSection& other) = delete; PinnedFilesSection(const PinnedFilesSection& other) = delete;
PinnedFilesSection& operator=(const PinnedFilesSection& other) = delete; PinnedFilesSection& operator=(const PinnedFilesSection& other) = delete;
~PinnedFilesSection() override; ~PinnedFilesSection() override;
// HoldingSpaceItemViewsContainer: // HoldingSpaceItemViewsSection:
const char* GetClassName() const override; const char* GetClassName() const override;
std::unique_ptr<views::View> CreateHeader() override; std::unique_ptr<views::View> CreateHeader() override;
std::unique_ptr<views::View> CreateContainer() override; std::unique_ptr<views::View> CreateContainer() override;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "ash/system/holding_space/recent_files_container.h" #include "ash/system/holding_space/recent_files_bubble.h"
#include "ash/public/cpp/holding_space/holding_space_constants.h" #include "ash/public/cpp/holding_space/holding_space_constants.h"
#include "ash/system/holding_space/downloads_section.h" #include "ash/system/holding_space/downloads_section.h"
...@@ -10,21 +10,20 @@ ...@@ -10,21 +10,20 @@
namespace ash { namespace ash {
RecentFilesContainer::RecentFilesContainer( RecentFilesBubble::RecentFilesBubble(HoldingSpaceItemViewDelegate* delegate)
HoldingSpaceItemViewDelegate* delegate)
: HoldingSpaceTrayChildBubble(delegate) { : HoldingSpaceTrayChildBubble(delegate) {
SetID(kHoldingSpaceRecentFilesContainerId); SetID(kHoldingSpaceRecentFilesBubbleId);
} }
RecentFilesContainer::~RecentFilesContainer() = default; RecentFilesBubble::~RecentFilesBubble() = default;
const char* RecentFilesContainer::GetClassName() const { const char* RecentFilesBubble::GetClassName() const {
return "RecentFilesContainer"; return "RecentFilesBubble";
} }
std::vector<std::unique_ptr<HoldingSpaceItemViewsContainer>> std::vector<std::unique_ptr<HoldingSpaceItemViewsSection>>
RecentFilesContainer::CreateSections() { RecentFilesBubble::CreateSections() {
std::vector<std::unique_ptr<HoldingSpaceItemViewsContainer>> sections; std::vector<std::unique_ptr<HoldingSpaceItemViewsSection>> sections;
sections.push_back(std::make_unique<ScreenCapturesSection>(delegate())); sections.push_back(std::make_unique<ScreenCapturesSection>(delegate()));
sections.push_back(std::make_unique<DownloadsSection>(delegate())); sections.push_back(std::make_unique<DownloadsSection>(delegate()));
return sections; return sections;
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef ASH_SYSTEM_HOLDING_SPACE_RECENT_FILES_CONTAINER_H_ #ifndef ASH_SYSTEM_HOLDING_SPACE_RECENT_FILES_BUBBLE_H_
#define ASH_SYSTEM_HOLDING_SPACE_RECENT_FILES_CONTAINER_H_ #define ASH_SYSTEM_HOLDING_SPACE_RECENT_FILES_BUBBLE_H_
#include <memory> #include <memory>
#include <vector> #include <vector>
...@@ -12,21 +12,20 @@ ...@@ -12,21 +12,20 @@
namespace ash { namespace ash {
// TODO(dmblack): Rename to `RecentFilesBubble`.
// Child bubble of `HoldingSpaceTrayBubble` for recent files. // Child bubble of `HoldingSpaceTrayBubble` for recent files.
class RecentFilesContainer : public HoldingSpaceTrayChildBubble { class RecentFilesBubble : public HoldingSpaceTrayChildBubble {
public: public:
explicit RecentFilesContainer(HoldingSpaceItemViewDelegate* delegate); explicit RecentFilesBubble(HoldingSpaceItemViewDelegate* delegate);
RecentFilesContainer(const RecentFilesContainer& other) = delete; RecentFilesBubble(const RecentFilesBubble& other) = delete;
RecentFilesContainer& operator=(const RecentFilesContainer& other) = delete; RecentFilesBubble& operator=(const RecentFilesBubble& other) = delete;
~RecentFilesContainer() override; ~RecentFilesBubble() override;
// HoldingSpaceTrayChildBubble: // HoldingSpaceTrayChildBubble:
const char* GetClassName() const override; const char* GetClassName() const override;
std::vector<std::unique_ptr<HoldingSpaceItemViewsContainer>> CreateSections() std::vector<std::unique_ptr<HoldingSpaceItemViewsSection>> CreateSections()
override; override;
}; };
} // namespace ash } // namespace ash
#endif // ASH_SYSTEM_HOLDING_SPACE_RECENT_FILES_CONTAINER_H_ #endif // ASH_SYSTEM_HOLDING_SPACE_RECENT_FILES_BUBBLE_H_
...@@ -21,11 +21,11 @@ namespace ash { ...@@ -21,11 +21,11 @@ namespace ash {
ScreenCapturesSection::ScreenCapturesSection( ScreenCapturesSection::ScreenCapturesSection(
HoldingSpaceItemViewDelegate* delegate) HoldingSpaceItemViewDelegate* delegate)
: HoldingSpaceItemViewsContainer(delegate, : HoldingSpaceItemViewsSection(delegate,
/*supported_types=*/ /*supported_types=*/
{HoldingSpaceItem::Type::kScreenshot, {HoldingSpaceItem::Type::kScreenshot,
HoldingSpaceItem::Type::kScreenRecording}, HoldingSpaceItem::Type::kScreenRecording},
/*max_count=*/kMaxScreenCaptures) {} /*max_count=*/kMaxScreenCaptures) {}
ScreenCapturesSection::~ScreenCapturesSection() = default; ScreenCapturesSection::~ScreenCapturesSection() = default;
......
...@@ -7,19 +7,19 @@ ...@@ -7,19 +7,19 @@
#include <memory> #include <memory>
#include "ash/system/holding_space/holding_space_item_views_container.h" #include "ash/system/holding_space/holding_space_item_views_section.h"
namespace ash { namespace ash {
// Section for screen captures in the `RecentFilesContainer`. // Section for screen captures in the `RecentFilesBubble`.
class ScreenCapturesSection : public HoldingSpaceItemViewsContainer { class ScreenCapturesSection : public HoldingSpaceItemViewsSection {
public: public:
explicit ScreenCapturesSection(HoldingSpaceItemViewDelegate* delegate); explicit ScreenCapturesSection(HoldingSpaceItemViewDelegate* delegate);
ScreenCapturesSection(const ScreenCapturesSection& other) = delete; ScreenCapturesSection(const ScreenCapturesSection& other) = delete;
ScreenCapturesSection& operator=(const ScreenCapturesSection& other) = delete; ScreenCapturesSection& operator=(const ScreenCapturesSection& other) = delete;
~ScreenCapturesSection() override; ~ScreenCapturesSection() override;
// HoldingSpaceItemViewsContainer: // HoldingSpaceItemViewsSection:
const char* GetClassName() const override; const char* GetClassName() const override;
std::unique_ptr<views::View> CreateHeader() override; std::unique_ptr<views::View> CreateHeader() override;
std::unique_ptr<views::View> CreateContainer() override; std::unique_ptr<views::View> CreateContainer() override;
......
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