chromium/third_party/blink/renderer/core/scroll/scrollbar_theme_aura.cc

/*
 * Copyright (c) 2008, 2009, Google Inc. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 *
 *     * Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above
 * copyright notice, this list of conditions and the following disclaimer
 * in the documentation and/or other materials provided with the
 * distribution.
 *     * Neither the name of Google Inc. nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT{
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,{
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#include "third_party/blink/renderer/core/scroll/scrollbar_theme_aura.h"

#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "cc/input/scrollbar.h"
#include "third_party/blink/public/common/input/web_mouse_event.h"
#include "third_party/blink/renderer/core/scroll/scrollbar.h"
#include "third_party/blink/renderer/core/scroll/scrollbar_theme_fluent.h"
#include "third_party/blink/renderer/core/scroll/scrollbar_theme_overlay.h"
#include "third_party/blink/renderer/core/style/computed_style_base_constants.h"
#include "third_party/blink/renderer/platform/graphics/graphics_context.h"
#include "third_party/blink/renderer/platform/graphics/paint/drawing_recorder.h"
#include "third_party/blink/renderer/platform/theme/web_theme_engine_helper.h"
#include "third_party/blink/renderer/platform/web_test_support.h"
#include "ui/gfx/geometry/point_conversions.h"

namespace blink {

namespace {

// Use fixed scrollbar thickness for web_tests because many tests are
// expecting that. Rebaselining is relatively easy for platform differences,
// but tens of testharness tests will fail without this on Windows.
// TODO(crbug.com/953847): Adapt testharness tests to native themes and remove
// this.
constexpr int kScrollbarThicknessForWebTests =;

// While the theme does not have specific values for scrollbar-width: thin
// we just use a fixed 2/3 ratio of the default value.
constexpr float kAutoProportion =;
constexpr float kThinProportion =;

// Contains a flag indicating whether WebThemeEngine should paint a UI widget
// for a scrollbar part, and if so, what part and state apply.
//
// If the PartPaintingParams are not affected by a change in the scrollbar
// state, then the corresponding scrollbar part does not need to be repainted.
struct PartPaintingParams {};

bool operator==(const PartPaintingParams& a, const PartPaintingParams& b) {}

bool operator!=(const PartPaintingParams& a, const PartPaintingParams& b) {}

PartPaintingParams ButtonPartPaintingParams(const Scrollbar& scrollbar,
                                            float position,
                                            ScrollbarPart part) {}

}  // namespace

ScrollbarTheme& ScrollbarTheme::NativeTheme() {}

bool ScrollbarThemeAura::SupportsDragSnapBack() const {}

int ScrollbarThemeAura::ScrollbarThickness(
    float scale_from_dip,
    EScrollbarWidth scrollbar_width) const {}

bool ScrollbarThemeAura::HasThumb(const Scrollbar& scrollbar) const {}

gfx::Rect ScrollbarThemeAura::BackButtonRect(const Scrollbar& scrollbar) const {}

gfx::Rect ScrollbarThemeAura::ForwardButtonRect(
    const Scrollbar& scrollbar) const {}

gfx::Rect ScrollbarThemeAura::TrackRect(const Scrollbar& scrollbar) const {}

int ScrollbarThemeAura::MinimumThumbLength(const Scrollbar& scrollbar) const {}

void ScrollbarThemeAura::PaintTrackBackgroundAndButtons(
    GraphicsContext& context,
    const Scrollbar& scrollbar,
    const gfx::Rect& rect) {}

void ScrollbarThemeAura::PaintTrackBackground(GraphicsContext& context,
                                              const Scrollbar& scrollbar,
                                              const gfx::Rect& rect) {}

void ScrollbarThemeAura::PaintButton(GraphicsContext& gc,
                                     const Scrollbar& scrollbar,
                                     const gfx::Rect& rect,
                                     ScrollbarPart part) {}

void ScrollbarThemeAura::PaintThumb(GraphicsContext& gc,
                                    const Scrollbar& scrollbar,
                                    const gfx::Rect& rect) {}

WebThemeEngine::ScrollbarThumbExtraParams
ScrollbarThemeAura::BuildScrollbarThumbExtraParams(
    const Scrollbar& scrollbar) const {}

bool ScrollbarThemeAura::ShouldRepaintAllPartsOnInvalidation() const {}

ScrollbarPart ScrollbarThemeAura::PartsToInvalidateOnThumbPositionChange(
    const Scrollbar& scrollbar,
    float old_position,
    float new_position) const {}

bool ScrollbarThemeAura::ShouldCenterOnThumb(const Scrollbar& scrollbar,
                                             const WebMouseEvent& event) const {}

bool ScrollbarThemeAura::ShouldSnapBackToDragOrigin(
    const Scrollbar& scrollbar,
    const WebMouseEvent& event) const {}

float ScrollbarThemeAura::Proportion(EScrollbarWidth scrollbar_width) const {}

bool ScrollbarThemeAura::HasScrollbarButtons(
    ScrollbarOrientation orientation) const {}

gfx::Size ScrollbarThemeAura::ButtonSize(const Scrollbar& scrollbar) const {}

bool ScrollbarThemeAura::UsesSolidColorThumb() const {}

gfx::Insets ScrollbarThemeAura::SolidColorThumbInsets(
    const Scrollbar& scrollbar) const {}

SkColor4f ScrollbarThemeAura::ThumbColor(const Scrollbar& scrollbar) const {}

bool ScrollbarThemeAura::UsesNinePatchTrackAndButtonsResource() const {}

gfx::Size ScrollbarThemeAura::NinePatchTrackAndButtonsCanvasSize(
    const Scrollbar& scrollbar) const {}

gfx::Rect ScrollbarThemeAura::NinePatchTrackAndButtonsAperture(
    const Scrollbar& scrollbar) const {}

}  // namespace blink