#include "ui/views/controls/button/image_button.h"
#include <utility>
#include "base/functional/bind.h"
#include "base/strings/utf_string_conversions.h"
#include "base/trace_event/trace_event.h"
#include "ui/accessibility/ax_enums.mojom.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/gfx/animation/throb_animation.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/image/image_skia_operations.h"
#include "ui/gfx/scoped_canvas.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/animation/ink_drop.h"
#include "ui/views/background.h"
#include "ui/views/controls/highlight_path_generator.h"
#include "ui/views/layout/layout_provider.h"
#include "ui/views/painter.h"
#include "ui/views/widget/widget.h"
namespace views {
static constexpr int kDefaultWidth = …;
static constexpr int kDefaultHeight = …;
ImageButton::ImageButton(PressedCallback callback)
: … { … }
ImageButton::~ImageButton() = default;
gfx::ImageSkia ImageButton::GetImage(ButtonState state) const { … }
void ImageButton::SetImageModel(ButtonState for_state,
const ui::ImageModel& image_model) { … }
void ImageButton::SetBackgroundImage(SkColor color,
const gfx::ImageSkia* image,
const gfx::ImageSkia* mask) { … }
ImageButton::HorizontalAlignment ImageButton::GetImageHorizontalAlignment()
const { … }
ImageButton::VerticalAlignment ImageButton::GetImageVerticalAlignment() const { … }
void ImageButton::SetImageHorizontalAlignment(HorizontalAlignment h_alignment) { … }
void ImageButton::SetImageVerticalAlignment(VerticalAlignment v_alignment) { … }
gfx::Size ImageButton::GetMinimumImageSize() const { … }
void ImageButton::SetMinimumImageSize(const gfx::Size& size) { … }
gfx::Size ImageButton::CalculatePreferredSize(
const SizeBounds& available_size) const { … }
views::PaintInfo::ScaleType ImageButton::GetPaintScaleType() const { … }
void ImageButton::OnThemeChanged() { … }
std::unique_ptr<ImageButton> ImageButton::CreateIconButton(
PressedCallback callback,
const gfx::VectorIcon& icon,
const std::u16string& accessible_name,
MaterialIconStyle icon_style,
std::optional<gfx::Insets> insets) { … }
void ImageButton::PaintButtonContents(gfx::Canvas* canvas) { … }
gfx::ImageSkia ImageButton::GetImageToPaint() { … }
void ToggleImageButton::UpdateAccessibleRoleIfNeeded() { … }
const gfx::Point ImageButton::ComputeImagePaintPosition(
const gfx::ImageSkia& image) const { … }
ToggleImageButton::ToggleImageButton(PressedCallback callback)
: … { … }
ToggleImageButton::~ToggleImageButton() = default;
bool ToggleImageButton::GetToggled() const { … }
void ToggleImageButton::UpdateAccessibleCheckedState() { … }
void ToggleImageButton::SetToggled(bool toggled) { … }
void ToggleImageButton::SetToggledImage(ButtonState image_state,
const gfx::ImageSkia* image) { … }
void ToggleImageButton::SetToggledImageModel(
ButtonState image_state,
const ui::ImageModel& image_model) { … }
void ToggleImageButton::SetToggledBackground(std::unique_ptr<Background> b) { … }
std::u16string ToggleImageButton::GetToggledTooltipText() const { … }
void ToggleImageButton::SetToggledTooltipText(const std::u16string& tooltip) { … }
std::u16string ToggleImageButton::GetToggledAccessibleName() const { … }
void ToggleImageButton::SetToggledAccessibleName(const std::u16string& name) { … }
gfx::ImageSkia ToggleImageButton::GetImage(ButtonState image_state) const { … }
void ToggleImageButton::SetImageModel(ButtonState image_state,
const ui::ImageModel& image_model) { … }
void ToggleImageButton::OnPaintBackground(gfx::Canvas* canvas) { … }
std::u16string ToggleImageButton::GetTooltipText(const gfx::Point& p) const { … }
void ToggleImageButton::GetAccessibleNodeData(ui::AXNodeData* node_data) { … }
BEGIN_METADATA(…)
BEGIN_METADATA(…)
}
DEFINE_ENUM_CONVERTERS(…)
DEFINE_ENUM_CONVERTERS(…)