#include "ui/views/window/frame_caption_button.h"
#include <memory>
#include <utility>
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "cc/paint/paint_flags.h"
#include "ui/base/hit_test.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/color/color_id.h"
#include "ui/gfx/animation/slide_animation.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/color_utils.h"
#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/gfx/geometry/rrect_f.h"
#include "ui/gfx/paint_vector_icon.h"
#include "ui/views/animation/flood_fill_ink_drop_ripple.h"
#include "ui/views/animation/ink_drop.h"
#include "ui/views/animation/ink_drop_highlight.h"
#include "ui/views/animation/ink_drop_impl.h"
#include "ui/views/animation/ink_drop_ripple.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/controls/highlight_path_generator.h"
#include "ui/views/window/hit_test_utils.h"
namespace views {
namespace {
constexpr float kInkDropVisibleOpacity = …;
constexpr float kFadeOutRatio = …;
constexpr float kDisabledButtonAlphaRatio = …;
}
class FrameCaptionButton::HighlightPathGenerator
: public views::HighlightPathGenerator { … };
FrameCaptionButton::FrameCaptionButton(PressedCallback callback,
CaptionButtonIcon icon,
int hit_test_type)
: … { … }
FrameCaptionButton::~FrameCaptionButton() = default;
SkColor FrameCaptionButton::GetButtonColor(SkColor background_color) { … }
float FrameCaptionButton::GetInactiveButtonColorAlphaRatio() { … }
void FrameCaptionButton::SetImage(CaptionButtonIcon icon,
Animate animate,
const gfx::VectorIcon& icon_definition) { … }
bool FrameCaptionButton::IsAnimatingImageSwap() const { … }
void FrameCaptionButton::SetAlpha(SkAlpha alpha) { … }
void FrameCaptionButton::OnGestureEvent(ui::GestureEvent* event) { … }
views::PaintInfo::ScaleType FrameCaptionButton::GetPaintScaleType() const { … }
void FrameCaptionButton::SetBackgroundColor(SkColor background_color) { … }
void FrameCaptionButton::SetIconColorId(ui::ColorId icon_color_id) { … }
SkColor FrameCaptionButton::GetBackgroundColor() const { … }
void FrameCaptionButton::SetInkDropCornerRadius(int ink_drop_corner_radius) { … }
int FrameCaptionButton::GetInkDropCornerRadius() const { … }
base::CallbackListSubscription
FrameCaptionButton::AddBackgroundColorChangedCallback(
PropertyChangedCallback callback) { … }
void FrameCaptionButton::SetPaintAsActive(bool paint_as_active) { … }
bool FrameCaptionButton::GetPaintAsActive() const { … }
void FrameCaptionButton::DrawHighlight(gfx::Canvas* canvas,
cc::PaintFlags flags) { … }
void FrameCaptionButton::DrawIconContents(gfx::Canvas* canvas,
gfx::ImageSkia image,
int x,
int y,
cc::PaintFlags flags) { … }
gfx::Size FrameCaptionButton::GetInkDropSize() const { … }
gfx::Insets FrameCaptionButton::GetInkdropInsets(
const gfx::Size& button_size) const { … }
void FrameCaptionButton::MaybeRefreshIconAndInkdropBaseColor() { … }
void FrameCaptionButton::PaintButtonContents(gfx::Canvas* canvas) { … }
void FrameCaptionButton::OnThemeChanged() { … }
SkAlpha FrameCaptionButton::GetAlphaForIcon(SkAlpha base_alpha) const { … }
void FrameCaptionButton::UpdateInkDropBaseColor() { … }
BEGIN_METADATA(…)
}
DEFINE_ENUM_CONVERTERS(…)