#include "third_party/blink/renderer/core/scroll/scrollbar.h"
#include <algorithm>
#include "base/feature_list.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/input/web_gesture_event.h"
#include "third_party/blink/public/common/input/web_mouse_event.h"
#include "third_party/blink/public/common/input/web_pointer_event.h"
#include "third_party/blink/public/common/input/web_pointer_properties.h"
#include "third_party/blink/renderer/core/dom/element.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/layout/layout_box.h"
#include "third_party/blink/renderer/core/scroll/scroll_animator_base.h"
#include "third_party/blink/renderer/core/scroll/scrollable_area.h"
#include "third_party/blink/renderer/core/scroll/scrollbar_theme.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/blink/renderer/platform/text/text_direction.h"
#include "ui/base/ui_base_features.h"
#include "ui/gfx/geometry/point_conversions.h"
#include "ui/gfx/geometry/rect_f.h"
namespace blink {
bool ButtonInteractsWithScrollbar(const WebPointerProperties::Button button) { … }
Scrollbar* Scrollbar::CreateForTesting(ScrollableArea* scrollable_area,
ScrollbarOrientation orientation,
ScrollbarTheme* theme) { … }
Scrollbar::Scrollbar(ScrollableArea* scrollable_area,
ScrollbarOrientation orientation,
const LayoutObject* style_source,
ScrollbarTheme* theme)
: … { … }
Scrollbar::~Scrollbar() = default;
void Scrollbar::Trace(Visitor* visitor) const { … }
void Scrollbar::SetFrameRect(const gfx::Rect& frame_rect) { … }
bool Scrollbar::HasTickmarks() const { … }
Vector<gfx::Rect> Scrollbar::GetTickmarks() const { … }
bool Scrollbar::IsScrollableAreaActive() const { … }
bool Scrollbar::IsLeftSideVerticalScrollbar() const { … }
int Scrollbar::Maximum() const { … }
void Scrollbar::OffsetDidChange(mojom::blink::ScrollType scroll_type) { … }
void Scrollbar::DisconnectFromScrollableArea() { … }
void Scrollbar::SetProportion(int visible_size, int total_size) { … }
void Scrollbar::AutoscrollTimerFired(TimerBase*) { … }
bool Scrollbar::ThumbWillBeUnderMouse() const { … }
void Scrollbar::AutoscrollPressedPart(base::TimeDelta delay) { … }
void Scrollbar::StartTimerIfNeeded(base::TimeDelta delay) { … }
void Scrollbar::StopTimerIfNeeded() { … }
ScrollDirectionPhysical Scrollbar::PressedPartScrollDirectionPhysical() { … }
ui::ScrollGranularity Scrollbar::PressedPartScrollGranularity() { … }
void Scrollbar::MoveThumb(int pos, bool dragging_document) { … }
void Scrollbar::SetHoveredPart(ScrollbarPart part) { … }
void Scrollbar::SetPressedPart(ScrollbarPart part, WebInputEvent::Type type) { … }
bool Scrollbar::HandlePointerEvent(const WebPointerEvent& event) { … }
bool Scrollbar::HandleGestureTapOrPress(const WebGestureEvent& evt) { … }
bool Scrollbar::HandleTapGesture() { … }
void Scrollbar::MouseMoved(const WebMouseEvent& evt) { … }
void Scrollbar::MouseEntered() { … }
void Scrollbar::MouseExited() { … }
void Scrollbar::MouseUp(const WebMouseEvent& mouse_event) { … }
void Scrollbar::MouseDown(const WebMouseEvent& evt) { … }
void Scrollbar::InjectScrollGestureForPressedPart(
WebInputEvent::Type gesture_type) { … }
void Scrollbar::InjectGestureScrollUpdateForThumbMove(
float single_axis_target_offset) { … }
void Scrollbar::InjectScrollGesture(WebInputEvent::Type gesture_type,
ScrollOffset delta,
ui::ScrollGranularity granularity) { … }
bool Scrollbar::DeltaWillScroll(ScrollOffset delta) const { … }
void Scrollbar::SetScrollbarsHiddenFromExternalAnimator(bool hidden) { … }
void Scrollbar::SetEnabled(bool e) { … }
int Scrollbar::ScrollbarThickness() const { … }
bool Scrollbar::IsSolidColor() const { … }
bool Scrollbar::IsOverlayScrollbar() const { … }
bool Scrollbar::IsFluentOverlayScrollbarMinimalMode() const { … }
bool Scrollbar::UsesNinePatchTrackAndCanSkipRepaint(
const gfx::Rect& new_frame_rect) const { … }
bool Scrollbar::ShouldParticipateInHitTesting() { … }
bool Scrollbar::IsWindowActive() const { … }
gfx::Point Scrollbar::ConvertFromRootFrame(
const gfx::Point& point_in_root_frame) const { … }
gfx::Rect Scrollbar::ConvertToContainingEmbeddedContentView(
const gfx::Rect& local_rect) const { … }
gfx::Point Scrollbar::ConvertFromContainingEmbeddedContentView(
const gfx::Point& parent_point) const { … }
float Scrollbar::ScrollableAreaCurrentPos() const { … }
float Scrollbar::ScrollableAreaTargetPos() const { … }
void Scrollbar::SetNeedsPaintInvalidation(ScrollbarPart invalid_parts) { … }
CompositorElementId Scrollbar::GetElementId() const { … }
float Scrollbar::ScaleFromDIP() const { … }
float Scrollbar::EffectiveZoom() const { … }
bool Scrollbar::ContainerIsRightToLeft() const { … }
bool Scrollbar::ContainerIsFormControl() const { … }
EScrollbarWidth Scrollbar::CSSScrollbarWidth() const { … }
std::optional<blink::Color> Scrollbar::ScrollbarThumbColor() const { … }
std::optional<blink::Color> Scrollbar::ScrollbarTrackColor() const { … }
bool Scrollbar::IsOpaque() const { … }
mojom::blink::ColorScheme Scrollbar::UsedColorScheme() const { … }
LayoutBox* Scrollbar::GetLayoutBox() const { … }
bool Scrollbar::IsScrollCornerVisible() const { … }
bool Scrollbar::ShouldPaint() const { … }
bool Scrollbar::LastKnownMousePositionInFrameRect() const { … }
const ui::ColorProvider* Scrollbar::GetColorProvider(
mojom::blink::ColorScheme color_scheme) const { … }
bool Scrollbar::InForcedColorsMode() const { … }
}