#ifndef UI_VIEWS_CONTROLS_MENU_MENU_SCROLL_VIEW_CONTAINER_H_
#define UI_VIEWS_CONTROLS_MENU_MENU_SCROLL_VIEW_CONTAINER_H_
#include "base/memory/raw_ptr.h"
#include "ui/views/bubble/bubble_border.h"
#include "ui/views/controls/menu/menu_types.h"
#include "ui/views/view.h"
namespace gfx {
class RoundedCornersF;
}
namespace views {
class MenuItemView;
class SubmenuView;
class MenuScrollViewContainer : public View {
public:
METADATA_HEADER(MenuScrollViewContainer);
explicit MenuScrollViewContainer(SubmenuView* content_view);
MenuScrollViewContainer(const MenuScrollViewContainer&) = delete;
MenuScrollViewContainer& operator=(const MenuScrollViewContainer&) = delete;
View* scroll_down_button() const { return scroll_down_button_; }
View* scroll_up_button() const { return scroll_up_button_; }
bool HasBubbleBorder() const;
gfx::Size CalculatePreferredSize() const override;
void OnPaintBackground(gfx::Canvas* canvas) override;
void GetAccessibleNodeData(ui::AXNodeData* node_data) override;
void OnThemeChanged() override;
void SetBorderColorId(absl::optional<ui::ColorId> border_color_id) {
border_color_id_ = border_color_id;
}
protected:
void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
private:
friend class MenuScrollView;
void DidScrollToTop();
void DidScrollToBottom();
void DidScrollAwayFromTop();
void DidScrollAwayFromBottom();
void CreateBorder();
void CreateDefaultBorder();
void CreateBubbleBorder();
BubbleBorder::Arrow BubbleBorderTypeFromAnchor(MenuAnchorPosition anchor);
MenuItemView* GetFootnote() const;
gfx::RoundedCornersF GetRoundedCorners() const;
class MenuScrollView;
raw_ptr<View> background_view_ = nullptr;
raw_ptr<View> scroll_up_button_;
raw_ptr<View> scroll_down_button_;
raw_ptr<MenuScrollView> scroll_view_;
raw_ptr<SubmenuView> content_view_;
BubbleBorder::Arrow arrow_ = BubbleBorder::NONE;
int corner_radius_ = 0;
const bool use_ash_system_ui_layout_;
absl::optional<ui::ColorId> border_color_id_;
};
}
#endif