#ifndef ASH_STYLE_CLOSE_BUTTON_H_
#define ASH_STYLE_CLOSE_BUTTON_H_
#include "ash/ash_export.h"
#include "ash/style/ash_color_id.h"
#include "ui/base/metadata/metadata_header_macros.h"
#include "ui/color/color_id.h"
#include "ui/views/controls/button/image_button.h"
#include "ui/views/view_targeter_delegate.h"
namespace gfx {
struct VectorIcon;
}
namespace ash {
class ASH_EXPORT CloseButton : public views::ImageButton,
public views::ViewTargeterDelegate {
METADATA_HEADER(CloseButton, views::ImageButton)
public:
enum class Type {
kSmall,
kMedium,
kLarge,
kSmallFloating,
kMediumFloating,
kLargeFloating,
};
CloseButton(PressedCallback callback,
Type type,
const gfx::VectorIcon* icon = nullptr,
ui::ColorId background_color_id = kColorAshShieldAndBase80,
ui::ColorId icon_color_id = kColorAshButtonIconColor);
CloseButton(const CloseButton&) = delete;
CloseButton& operator=(const CloseButton&) = delete;
~CloseButton() override;
bool DoesIntersectScreenRect(const gfx::Rect& screen_rect) const;
void ResetListener();
private:
void OnThemeChanged() override;
gfx::Size CalculatePreferredSize(
const views::SizeBounds& available_size) const override;
bool DoesIntersectRect(const views::View* target,
const gfx::Rect& rect) const override;
const Type type_;
};
}
#endif