chromium/ui/views/controls/button/image_button.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 {

// Default button size if no image is set. This is ignored if there is an image,
// and exists for historical reasons (any number of clients could depend on this
// behaviour).
static constexpr int kDefaultWidth =;
static constexpr int kDefaultHeight =;

////////////////////////////////////////////////////////////////////////////////
// ImageButton, public:

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) {}

////////////////////////////////////////////////////////////////////////////////
// ImageButton, View overrides:

gfx::Size ImageButton::CalculatePreferredSize(
    const SizeBounds& available_size) const {}

views::PaintInfo::ScaleType ImageButton::GetPaintScaleType() const {}

void ImageButton::OnThemeChanged() {}

// static
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) {}

////////////////////////////////////////////////////////////////////////////////
// ImageButton, protected:

gfx::ImageSkia ImageButton::GetImageToPaint() {}

void ToggleImageButton::UpdateAccessibleRoleIfNeeded() {}

////////////////////////////////////////////////////////////////////////////////
// ImageButton, private:

const gfx::Point ImageButton::ComputeImagePaintPosition(
    const gfx::ImageSkia& image) const {}

////////////////////////////////////////////////////////////////////////////////
// ToggleImageButton, public:

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) {}

////////////////////////////////////////////////////////////////////////////////
// ToggleImageButton, ImageButton overrides:

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) {}

////////////////////////////////////////////////////////////////////////////////
// ToggleImageButton, View overrides:

std::u16string ToggleImageButton::GetTooltipText(const gfx::Point& p) const {}

void ToggleImageButton::GetAccessibleNodeData(ui::AXNodeData* node_data) {}

BEGIN_METADATA()

BEGIN_METADATA()

}  // namespace views

DEFINE_ENUM_CONVERTERS()
DEFINE_ENUM_CONVERTERS()