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

// Copyright 2016 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/toggle_button.h"

#include <memory>
#include <utility>
#include <vector>

#include "base/callback_list.h"
#include "base/functional/bind.h"
#include "cc/paint/paint_flags.h"
#include "third_party/skia/include/core/SkRect.h"
#include "ui/accessibility/ax_enums.mojom.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/base/metadata/metadata_header_macros.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/color/color_id.h"
#include "ui/color/color_provider.h"
#include "ui/events/event.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/color_palette.h"
#include "ui/gfx/color_utils.h"
#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/gfx/geometry/skia_conversions.h"
#include "ui/gfx/shadow_value.h"
#include "ui/gfx/skia_paint_util.h"
#include "ui/views/accessibility/view_accessibility.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/animation/square_ink_drop_ripple.h"
#include "ui/views/controls/focus_ring.h"
#include "ui/views/controls/highlight_path_generator.h"
#include "ui/views/painter.h"

namespace views {

namespace {

// Constants are measured in dip.
constexpr gfx::Size kTrackSize =;
constexpr int kThumbInset =;
constexpr int kThumbInsetSelected =;
constexpr int kThumbPressedOutset =;
constexpr int kHoverDiameter =;
constexpr float kBorderStrokeWidth =;

const gfx::Size GetTrackSize() {}

int GetThumbInset(bool is_on) {}

std::optional<SkColor> GetSkColorFromVariant(
    const absl::variant<ui::ColorId, SkColor>& color_variant) {}

SkColor ConvertVariantToSkColor(
    const absl::variant<ui::ColorId, SkColor> color_variant,
    const ui::ColorProvider* color_provider) {}

}  // namespace

class ToggleButton::FocusRingHighlightPathGenerator
    : public views::HighlightPathGenerator {};

// Class representing the thumb (the circle that slides horizontally).
class ToggleButton::ThumbView : public View {};

ToggleButton::ToggleButton(PressedCallback callback)
    :{}

ToggleButton::ToggleButton(PressedCallback callback, bool has_thumb_shadow)
    :{}

ToggleButton::~ToggleButton() {}

void ToggleButton::AnimateIsOn(bool is_on) {}

void ToggleButton::SetIsOn(bool is_on) {}

bool ToggleButton::GetIsOn() const {}

void ToggleButton::SetThumbOnColor(SkColor thumb_on_color) {}

std::optional<SkColor> ToggleButton::GetThumbOnColor() const {}

void ToggleButton::SetThumbOffColor(SkColor thumb_off_color) {}

std::optional<SkColor> ToggleButton::GetThumbOffColor() const {}

void ToggleButton::SetTrackOnColor(SkColor track_on_color) {}

std::optional<SkColor> ToggleButton::GetTrackOnColor() const {}

void ToggleButton::SetTrackOffColor(SkColor track_off_color) {}

std::optional<SkColor> ToggleButton::GetTrackOffColor() const {}

void ToggleButton::SetInnerBorderEnabled(bool enabled) {}

bool ToggleButton::GetInnerBorderEnabled() const {}

void ToggleButton::SetAcceptsEvents(bool accepts_events) {}

bool ToggleButton::GetAcceptsEvents() const {}

void ToggleButton::AddLayerToRegion(ui::Layer* layer,
                                    views::LayerRegion region) {}

void ToggleButton::RemoveLayerFromRegions(ui::Layer* layer) {}

gfx::Size ToggleButton::CalculatePreferredSize(
    const SizeBounds& /*available_size*/) const {}

gfx::Rect ToggleButton::GetTrackBounds() const {}

gfx::Rect ToggleButton::GetThumbBounds() const {}

double ToggleButton::GetAnimationProgress() const {}

void ToggleButton::UpdateThumb() {}

SkColor ToggleButton::GetTrackColor(bool is_on) const {}

SkColor ToggleButton::GetHoverColor() const {}

SkColor ToggleButton::GetPressedColor() const {}

bool ToggleButton::CanAcceptEvent(const ui::Event& event) {}

void ToggleButton::OnBoundsChanged(const gfx::Rect& previous_bounds) {}

void ToggleButton::OnThemeChanged() {}

void ToggleButton::NotifyClick(const ui::Event& event) {}

void ToggleButton::StateChanged(ButtonState old_state) {}

SkPath ToggleButton::GetFocusRingPath() const {}

void ToggleButton::PaintButtonContents(gfx::Canvas* canvas) {}

void ToggleButton::AnimationEnded(const gfx::Animation* animation) {}

void ToggleButton::AnimationProgressed(const gfx::Animation* animation) {}

BEGIN_METADATA()
END_METADATA

BEGIN_METADATA()

}  // namespace views