#ifndef ASH_SHELF_SHELF_VIEW_TEST_API_H_
#define ASH_SHELF_SHELF_VIEW_TEST_API_H_
#include <optional>
#include <string>
#include "ash/public/cpp/shelf_item.h"
#include "base/functional/callback_forward.h"
#include "base/memory/raw_ptr.h"
#include "ui/base/ui_base_types.h"
#include "ui/compositor/layer_tree_owner.h"
namespace base {
class TimeDelta;
}
namespace gfx {
class Point;
class Rect;
}
namespace views {
class BoundsAnimator;
class View;
}
namespace ash {
class OverflowBubble;
class ShelfAppButton;
class ShelfButtonPressedMetricTracker;
class ShelfTooltipManager;
class ShelfView;
class ShelfViewTestAPI {
public:
explicit ShelfViewTestAPI(ShelfView* shelf_view);
ShelfViewTestAPI(const ShelfViewTestAPI&) = delete;
ShelfViewTestAPI& operator=(const ShelfViewTestAPI&) = delete;
~ShelfViewTestAPI();
size_t GetButtonCount();
ShelfAppButton* GetButton(int index);
ShelfID AddItem(ShelfItemType type);
void RemoveItemAt(int index);
views::View* GetViewAt(int index);
const gfx::Rect& GetBoundsByIndex(int index);
const gfx::Rect& GetIdealBoundsByIndex(int index);
void ShowOverflowBubble();
void HideOverflowBubble();
base::TimeDelta GetAnimationDuration() const;
void SetAnimationDuration(base::TimeDelta duration);
void RunMessageLoopUntilAnimationsDone(
views::BoundsAnimator* bounds_animator);
void RunMessageLoopUntilAnimationsDone();
gfx::Rect GetMenuAnchorRect(const views::View& source,
const gfx::Point& location,
bool context_menu) const;
bool CloseMenu();
const gfx::Rect& visible_shelf_item_bounds_union() const;
ShelfView* shelf_view() { return shelf_view_; }
ShelfTooltipManager* tooltip_manager();
OverflowBubble* overflow_bubble();
int GetMinimumDragDistance() const;
bool SameDragType(ShelfItemType typea, ShelfItemType typeb) const;
gfx::Rect GetBoundsForDragInsertInScreen();
bool IsRippedOffFromShelf();
bool DraggedItemToAnotherShelf();
ShelfButtonPressedMetricTracker* shelf_button_pressed_metric_tracker();
void SetShelfContextMenuCallback(base::RepeatingClosure closure);
std::optional<size_t> GetSeparatorIndex() const;
bool IsSeparatorVisible() const;
bool HasPendingPromiseAppRemoval(const std::string& promise_app_id) const;
private:
raw_ptr<ShelfView, DanglingUntriaged> shelf_view_;
int id_ = 0;
};
}
#endif