Commit fd620b69 authored by Jeremy Roman's avatar Jeremy Roman Committed by Commit Bot

Radically simplify Blink scrollbar painting.

This collapses most of the logic for painting composited
scrollbars into ScrollbarLayerDelegate. There was only one
path and lots of indirection before, most of which can now
go away.

This allows WebScrollbarImpl, WebScrollbarThemeClientImpl,
WebScrollbarThemeGeometryNative and WebScrollbarThemePainter
to be deleted. Bits of WebScrollbar remain, since there are
a handful of places that still use enums defined in its header.

Bug: 841751
Change-Id: Id37c75bc50e5138b44c5d6ba0add08f73ad71f0c
Reviewed-on: https://chromium-review.googlesource.com/1052919
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: default avatarDavid Bokan <bokan@chromium.org>
Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557591}
parent fcc24258
...@@ -381,8 +381,6 @@ source_set("blink_headers") { ...@@ -381,8 +381,6 @@ source_set("blink_headers") {
"platform/web_scrollbar_behavior.h", "platform/web_scrollbar_behavior.h",
"platform/web_scrollbar_buttons_placement.h", "platform/web_scrollbar_buttons_placement.h",
"platform/web_scrollbar_overlay_color_theme.h", "platform/web_scrollbar_overlay_color_theme.h",
"platform/web_scrollbar_theme_geometry.h",
"platform/web_scrollbar_theme_painter.h",
"platform/web_security_origin.h", "platform/web_security_origin.h",
"platform/web_security_style.h", "platform/web_security_style.h",
"platform/web_selection_bound.h", "platform/web_selection_bound.h",
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
#include "third_party/blink/public/platform/web_float_point.h" #include "third_party/blink/public/platform/web_float_point.h"
#include "third_party/blink/public/platform/web_layer_tree_view.h" #include "third_party/blink/public/platform/web_layer_tree_view.h"
#include "third_party/blink/public/platform/web_scrollbar.h" #include "third_party/blink/public/platform/web_scrollbar.h"
#include "third_party/blink/public/platform/web_scrollbar_theme_painter.h"
#include <memory> #include <memory>
......
...@@ -25,71 +25,13 @@ ...@@ -25,71 +25,13 @@
#ifndef THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_SCROLLBAR_H_ #ifndef THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_SCROLLBAR_H_
#define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_SCROLLBAR_H_ #define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_SCROLLBAR_H_
#include "third_party/blink/public/platform/web_point.h"
#include "third_party/blink/public/platform/web_rect.h"
#include "third_party/blink/public/platform/web_scrollbar_overlay_color_theme.h"
#include "third_party/blink/public/platform/web_size.h"
#include "third_party/blink/public/platform/web_vector.h"
namespace blink { namespace blink {
// A const accessor interface for a WebKit scrollbar // TODO(jbroman): Clean up these, which are used elsewhere.
class BLINK_PLATFORM_EXPORT WebScrollbar { class WebScrollbar {
public: public:
enum Orientation { kHorizontal, kVertical }; enum Orientation { kHorizontal, kVertical };
enum ScrollDirection { kScrollBackward, kScrollForward };
enum ScrollGranularity {
kScrollByLine,
kScrollByPage,
kScrollByDocument,
kScrollByPixel
};
enum ScrollbarControlSize { kRegularScrollbar, kSmallScrollbar };
enum ScrollbarPart {
kNoPart = 0,
kBackButtonStartPart = 1,
kForwardButtonStartPart = 1 << 1,
kBackTrackPart = 1 << 2,
kThumbPart = 1 << 3,
kForwardTrackPart = 1 << 4,
kBackButtonEndPart = 1 << 5,
kForwardButtonEndPart = 1 << 6,
kScrollbarBGPart = 1 << 7,
kTrackBGPart = 1 << 8,
kAllParts = 0xffffffff
};
enum class ScrollingMode { kAuto, kAlwaysOff, kAlwaysOn, kLast = kAlwaysOn }; enum class ScrollingMode { kAuto, kAlwaysOff, kAlwaysOn, kLast = kAlwaysOn };
virtual ~WebScrollbar() = default;
// Return true if this is an overlay scrollbar.
virtual bool IsOverlay() const = 0;
// Gets the current value (i.e. position inside the region).
virtual int Value() const = 0;
virtual WebPoint Location() const = 0;
virtual WebSize Size() const = 0;
virtual bool Enabled() const = 0;
virtual int Maximum() const = 0;
virtual int TotalSize() const = 0;
virtual bool IsScrollableAreaActive() const = 0;
virtual bool HasTickmarks() const = 0;
virtual void GetTickmarks(WebVector<WebRect>& tickmarks) const = 0;
virtual ScrollbarControlSize GetControlSize() const = 0;
virtual ScrollbarPart PressedPart() const = 0;
virtual ScrollbarPart HoveredPart() const = 0;
virtual WebScrollbarOverlayColorTheme ScrollbarOverlayColorTheme() const = 0;
virtual bool IsCustomScrollbar() const = 0;
virtual Orientation GetOrientation() const = 0;
virtual bool IsLeftSideVerticalScrollbar() const = 0;
virtual float ElasticOverscroll() const = 0;
virtual void SetElasticOverscroll(float) = 0;
}; };
} // namespace blink } // namespace blink
......
/*
* Copyright (C) 2012 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:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. 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.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.
*/
#ifndef THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_SCROLLBAR_THEME_GEOMETRY_H_
#define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_SCROLLBAR_THEME_GEOMETRY_H_
#include "third_party/blink/public/platform/web_rect.h"
#include "third_party/blink/public/platform/web_size.h"
namespace blink {
class WebScrollbar;
class BLINK_PLATFORM_EXPORT WebScrollbarThemeGeometry {
public:
virtual ~WebScrollbarThemeGeometry() = default;
virtual bool HasButtons(WebScrollbar*) = 0;
virtual bool HasThumb(WebScrollbar*) = 0;
virtual WebRect TrackRect(WebScrollbar*) = 0;
virtual WebRect ThumbRect(WebScrollbar*) = 0;
virtual WebRect BackButtonStartRect(WebScrollbar*) = 0;
virtual WebRect BackButtonEndRect(WebScrollbar*) = 0;
virtual WebRect ForwardButtonStartRect(WebScrollbar*) = 0;
virtual WebRect ForwardButtonEndRect(WebScrollbar*) = 0;
virtual WebSize NinePatchThumbCanvasSize(WebScrollbar*) = 0;
virtual WebRect NinePatchThumbAperture(WebScrollbar*) = 0;
};
} // namespace blink
#endif
/*
* Copyright (C) 2012 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:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. 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.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.
*/
#ifndef THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_SCROLLBAR_THEME_PAINTER_H_
#define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_SCROLLBAR_THEME_PAINTER_H_
#include "third_party/blink/public/platform/web_canvas.h"
#include "third_party/blink/public/platform/web_private_ptr.h"
#include "third_party/blink/public/platform/web_rect.h"
#include "third_party/blink/public/platform/web_size.h"
namespace blink {
class ScrollbarTheme;
class Scrollbar;
class WebScrollbar;
class WebScrollbarThemePainter {
public:
WebScrollbarThemePainter() : theme_(0), device_scale_factor_(1.0) {}
WebScrollbarThemePainter(const WebScrollbarThemePainter& painter) {
Assign(painter);
}
virtual ~WebScrollbarThemePainter() { Reset(); }
WebScrollbarThemePainter& operator=(const WebScrollbarThemePainter& painter) {
Assign(painter);
return *this;
}
BLINK_PLATFORM_EXPORT void Assign(const WebScrollbarThemePainter&);
BLINK_PLATFORM_EXPORT void Reset();
BLINK_PLATFORM_EXPORT void PaintScrollbarBackground(WebCanvas*,
const WebRect&);
BLINK_PLATFORM_EXPORT void PaintTrackBackground(WebCanvas*, const WebRect&);
BLINK_PLATFORM_EXPORT void PaintBackTrackPart(WebCanvas*, const WebRect&);
BLINK_PLATFORM_EXPORT void PaintForwardTrackPart(WebCanvas*, const WebRect&);
BLINK_PLATFORM_EXPORT void PaintBackButtonStart(WebCanvas*, const WebRect&);
BLINK_PLATFORM_EXPORT void PaintBackButtonEnd(WebCanvas*, const WebRect&);
BLINK_PLATFORM_EXPORT void PaintForwardButtonStart(WebCanvas*,
const WebRect&);
BLINK_PLATFORM_EXPORT void PaintForwardButtonEnd(WebCanvas*, const WebRect&);
BLINK_PLATFORM_EXPORT void PaintTickmarks(WebCanvas*, const WebRect&);
BLINK_PLATFORM_EXPORT void PaintThumb(WebCanvas*, const WebRect&);
// This opacity is applied on top of the content that is painted for the
// thumb.
BLINK_PLATFORM_EXPORT float ThumbOpacity() const;
BLINK_PLATFORM_EXPORT bool TrackNeedsRepaint() const;
BLINK_PLATFORM_EXPORT bool ThumbNeedsRepaint() const;
BLINK_PLATFORM_EXPORT bool UsesNinePatchThumbResource() const;
#if INSIDE_BLINK
BLINK_PLATFORM_EXPORT WebScrollbarThemePainter(ScrollbarTheme&,
Scrollbar&,
float device_scale_factor);
#endif
BLINK_PLATFORM_EXPORT float DeviceScaleFactor() const {
return device_scale_factor_;
}
private:
// The theme is not owned by this class. It is assumed that the theme is a
// static pointer and its lifetime is essentially infinite. The functions
// called from the painter may not be thread-safe, so all calls must be made
// from the same thread that it is created on.
ScrollbarTheme* theme_;
// It is assumed that the constructor of this paint object is responsible
// for the lifetime of this scrollbar. The painter has to use the real
// scrollbar (and not a WebScrollbar wrapper) due to static_casts for
// LayoutScrollbar and pointer-based HashMap lookups for Lion scrollbars.
WebPrivatePtr<Scrollbar> scrollbar_;
float device_scale_factor_;
};
} // namespace blink
#endif
...@@ -54,8 +54,6 @@ ...@@ -54,8 +54,6 @@
#include "third_party/blink/renderer/core/paint/compositing/paint_layer_compositor.h" #include "third_party/blink/renderer/core/paint/compositing/paint_layer_compositor.h"
#include "third_party/blink/renderer/platform/animation/compositor_animation_host.h" #include "third_party/blink/renderer/platform/animation/compositor_animation_host.h"
#include "third_party/blink/renderer/platform/animation/compositor_animation_timeline.h" #include "third_party/blink/renderer/platform/animation/compositor_animation_timeline.h"
#include "third_party/blink/renderer/platform/exported/web_scrollbar_impl.h"
#include "third_party/blink/renderer/platform/exported/web_scrollbar_theme_geometry_native.h"
#include "third_party/blink/renderer/platform/geometry/region.h" #include "third_party/blink/renderer/platform/geometry/region.h"
#include "third_party/blink/renderer/platform/geometry/transform_state.h" #include "third_party/blink/renderer/platform/geometry/transform_state.h"
#include "third_party/blink/renderer/platform/graphics/graphics_layer.h" #include "third_party/blink/renderer/platform/graphics/graphics_layer.h"
...@@ -69,8 +67,6 @@ ...@@ -69,8 +67,6 @@
#include "third_party/blink/public/platform/web_compositor_support.h" #include "third_party/blink/public/platform/web_compositor_support.h"
#include "third_party/blink/public/platform/web_layer.h" #include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_layer_tree_view.h" #include "third_party/blink/public/platform/web_layer_tree_view.h"
#include "third_party/blink/public/platform/web_scrollbar_theme_geometry.h"
#include "third_party/blink/public/platform/web_scrollbar_theme_painter.h"
#include "third_party/blink/renderer/platform/scroll/main_thread_scrolling_reason.h" #include "third_party/blink/renderer/platform/scroll/main_thread_scrolling_reason.h"
#include "third_party/blink/renderer/platform/scroll/scroll_animator_base.h" #include "third_party/blink/renderer/platform/scroll/scroll_animator_base.h"
#include "third_party/blink/renderer/platform/scroll/scrollbar_layer_delegate.h" #include "third_party/blink/renderer/platform/scroll/scrollbar_layer_delegate.h"
...@@ -329,10 +325,8 @@ void ScrollingCoordinator::RemoveScrollbarLayerGroup( ...@@ -329,10 +325,8 @@ void ScrollingCoordinator::RemoveScrollbarLayerGroup(
static std::unique_ptr<ScrollingCoordinator::ScrollbarLayerGroup> static std::unique_ptr<ScrollingCoordinator::ScrollbarLayerGroup>
CreateScrollbarLayer(Scrollbar& scrollbar, float device_scale_factor) { CreateScrollbarLayer(Scrollbar& scrollbar, float device_scale_factor) {
ScrollbarTheme& theme = scrollbar.GetTheme(); ScrollbarTheme& theme = scrollbar.GetTheme();
auto scrollbar_delegate = std::make_unique<ScrollbarLayerDelegate>( auto scrollbar_delegate =
WebScrollbarImpl::Create(&scrollbar), std::make_unique<ScrollbarLayerDelegate>(scrollbar, device_scale_factor);
WebScrollbarThemePainter(theme, scrollbar, device_scale_factor),
WebScrollbarThemeGeometryNative::Create(theme));
auto layer_group = auto layer_group =
std::make_unique<ScrollingCoordinator::ScrollbarLayerGroup>(); std::make_unique<ScrollingCoordinator::ScrollbarLayerGroup>();
......
...@@ -586,13 +586,6 @@ jumbo_component("platform") { ...@@ -586,13 +586,6 @@ jumbo_component("platform") {
"exported/web_rtc_stats_response.cc", "exported/web_rtc_stats_response.cc",
"exported/web_rtc_void_request.cc", "exported/web_rtc_void_request.cc",
"exported/web_runtime_features.cc", "exported/web_runtime_features.cc",
"exported/web_scrollbar_impl.cc",
"exported/web_scrollbar_impl.h",
"exported/web_scrollbar_theme_client_impl.cc",
"exported/web_scrollbar_theme_client_impl.h",
"exported/web_scrollbar_theme_geometry_native.cc",
"exported/web_scrollbar_theme_geometry_native.h",
"exported/web_scrollbar_theme_painter.cc",
"exported/web_security_origin.cc", "exported/web_security_origin.cc",
"exported/web_service_worker_installed_scripts_manager.cc", "exported/web_service_worker_installed_scripts_manager.cc",
"exported/web_service_worker_request.cc", "exported/web_service_worker_request.cc",
......
/*
* Copyright (C) 2012 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:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. 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.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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/platform/exported/web_scrollbar_impl.h"
#include "third_party/blink/renderer/platform/geometry/int_rect.h"
#include "third_party/blink/renderer/platform/scroll/scrollbar.h"
namespace blink {
WebScrollbarImpl::WebScrollbarImpl(Scrollbar* scrollbar)
: scrollbar_(scrollbar) {}
bool WebScrollbarImpl::IsOverlay() const {
return scrollbar_->IsOverlayScrollbar();
}
int WebScrollbarImpl::Value() const {
return scrollbar_->Value();
}
WebPoint WebScrollbarImpl::Location() const {
return scrollbar_->Location();
}
WebSize WebScrollbarImpl::Size() const {
return scrollbar_->Size();
}
bool WebScrollbarImpl::Enabled() const {
return scrollbar_->Enabled();
}
int WebScrollbarImpl::Maximum() const {
return scrollbar_->Maximum();
}
int WebScrollbarImpl::TotalSize() const {
return scrollbar_->TotalSize();
}
bool WebScrollbarImpl::IsScrollableAreaActive() const {
return scrollbar_->IsScrollableAreaActive();
}
bool WebScrollbarImpl::HasTickmarks() const {
Vector<IntRect> tickmarks;
scrollbar_->GetTickmarks(tickmarks);
return !tickmarks.IsEmpty();
}
void WebScrollbarImpl::GetTickmarks(WebVector<WebRect>& web_tickmarks) const {
Vector<IntRect> tickmarks;
scrollbar_->GetTickmarks(tickmarks);
WebVector<WebRect> result(tickmarks.size());
for (size_t i = 0; i < tickmarks.size(); ++i)
result[i] = tickmarks[i];
web_tickmarks.Swap(result);
}
WebScrollbar::ScrollbarControlSize WebScrollbarImpl::GetControlSize() const {
return static_cast<WebScrollbar::ScrollbarControlSize>(
scrollbar_->GetControlSize());
}
WebScrollbar::ScrollbarPart WebScrollbarImpl::PressedPart() const {
return static_cast<WebScrollbar::ScrollbarPart>(scrollbar_->PressedPart());
}
WebScrollbar::ScrollbarPart WebScrollbarImpl::HoveredPart() const {
return static_cast<WebScrollbar::ScrollbarPart>(scrollbar_->HoveredPart());
}
WebScrollbarOverlayColorTheme WebScrollbarImpl::ScrollbarOverlayColorTheme()
const {
return static_cast<WebScrollbarOverlayColorTheme>(
scrollbar_->GetScrollbarOverlayColorTheme());
}
WebScrollbar::Orientation WebScrollbarImpl::GetOrientation() const {
return static_cast<WebScrollbar::Orientation>(scrollbar_->Orientation());
}
bool WebScrollbarImpl::IsLeftSideVerticalScrollbar() const {
return scrollbar_->IsLeftSideVerticalScrollbar();
}
bool WebScrollbarImpl::IsCustomScrollbar() const {
return scrollbar_->IsCustomScrollbar();
}
float WebScrollbarImpl::ElasticOverscroll() const {
return scrollbar_->ElasticOverscroll();
}
void WebScrollbarImpl::SetElasticOverscroll(float elastic_overscroll) {
scrollbar_->SetElasticOverscroll(elastic_overscroll);
}
} // namespace blink
/*
* Copyright (C) 2012 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:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. 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.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
*/
#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_EXPORTED_WEB_SCROLLBAR_IMPL_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_EXPORTED_WEB_SCROLLBAR_IMPL_H_
#include "base/memory/ptr_util.h"
#include "third_party/blink/public/platform/web_scrollbar.h"
#include "third_party/blink/renderer/platform/heap/handle.h"
#include "third_party/blink/renderer/platform/platform_export.h"
#include "third_party/blink/renderer/platform/wtf/allocator.h"
#include "third_party/blink/renderer/platform/wtf/noncopyable.h"
#include <memory>
namespace blink {
class Scrollbar;
class PLATFORM_EXPORT WebScrollbarImpl final : public WebScrollbar {
USING_FAST_MALLOC(WebScrollbarImpl);
WTF_MAKE_NONCOPYABLE(WebScrollbarImpl);
public:
static std::unique_ptr<WebScrollbarImpl> Create(Scrollbar* scrollbar) {
return base::WrapUnique(new WebScrollbarImpl(scrollbar));
}
// Implement WebScrollbar methods
bool IsOverlay() const override;
int Value() const override;
WebPoint Location() const override;
WebSize Size() const override;
bool Enabled() const override;
int Maximum() const override;
int TotalSize() const override;
bool IsScrollableAreaActive() const override;
bool HasTickmarks() const override;
void GetTickmarks(WebVector<WebRect>& tickmarks) const override;
ScrollbarControlSize GetControlSize() const override;
ScrollbarPart PressedPart() const override;
ScrollbarPart HoveredPart() const override;
WebScrollbarOverlayColorTheme ScrollbarOverlayColorTheme() const override;
bool IsCustomScrollbar() const override;
Orientation GetOrientation() const override;
bool IsLeftSideVerticalScrollbar() const override;
float ElasticOverscroll() const override;
void SetElasticOverscroll(float) override;
private:
explicit WebScrollbarImpl(Scrollbar*);
// Accessed by main and compositor threads, e.g., the compositor thread
// checks |orientation()|.
//
// TODO: minimize or avoid cross-thread use, if possible.
CrossThreadPersistent<Scrollbar> scrollbar_;
};
} // namespace blink
#endif
/*
* Copyright (C) 2012 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:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. 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.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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/platform/exported/web_scrollbar_theme_client_impl.h"
#include "third_party/blink/renderer/platform/scroll/scrollbar_theme.h"
namespace blink {
WebScrollbarThemeClientImpl::WebScrollbarThemeClientImpl(
WebScrollbar& scrollbar)
: scrollbar_(scrollbar) {
ScrollbarTheme::DeprecatedStaticGetTheme().RegisterScrollbar(*this);
}
WebScrollbarThemeClientImpl::~WebScrollbarThemeClientImpl() {
ScrollbarTheme::DeprecatedStaticGetTheme().UnregisterScrollbar(*this);
}
int WebScrollbarThemeClientImpl::X() const {
return Location().X();
}
int WebScrollbarThemeClientImpl::Y() const {
return Location().Y();
}
int WebScrollbarThemeClientImpl::Width() const {
return Size().Width();
}
int WebScrollbarThemeClientImpl::Height() const {
return Size().Height();
}
IntSize WebScrollbarThemeClientImpl::Size() const {
return scrollbar_.Size();
}
IntPoint WebScrollbarThemeClientImpl::Location() const {
return scrollbar_.Location();
}
void WebScrollbarThemeClientImpl::SetFrameRect(const IntRect&) {
// Unused by Chromium scrollbar themes.
NOTREACHED();
}
IntRect WebScrollbarThemeClientImpl::FrameRect() const {
return IntRect(Location(), Size());
}
void WebScrollbarThemeClientImpl::Invalidate() {
// Unused by Chromium scrollbar themes.
NOTREACHED();
}
void WebScrollbarThemeClientImpl::InvalidateRect(const IntRect&) {
// Unused by Chromium scrollbar themes.
NOTREACHED();
}
ScrollbarOverlayColorTheme
WebScrollbarThemeClientImpl::GetScrollbarOverlayColorTheme() const {
return static_cast<ScrollbarOverlayColorTheme>(
scrollbar_.ScrollbarOverlayColorTheme());
}
void WebScrollbarThemeClientImpl::GetTickmarks(
Vector<IntRect>& tickmarks) const {
WebVector<WebRect> web_tickmarks;
scrollbar_.GetTickmarks(web_tickmarks);
tickmarks.resize(web_tickmarks.size());
for (size_t i = 0; i < web_tickmarks.size(); ++i)
tickmarks[i] = web_tickmarks[i];
}
bool WebScrollbarThemeClientImpl::IsScrollableAreaActive() const {
return scrollbar_.IsScrollableAreaActive();
}
IntPoint WebScrollbarThemeClientImpl::ConvertFromRootFrame(
const IntPoint& point_in_root_frame) const {
// Unused by Chromium scrollbar themes.
NOTREACHED();
return point_in_root_frame;
}
bool WebScrollbarThemeClientImpl::IsCustomScrollbar() const {
return scrollbar_.IsCustomScrollbar();
}
ScrollbarOrientation WebScrollbarThemeClientImpl::Orientation() const {
return static_cast<ScrollbarOrientation>(scrollbar_.GetOrientation());
}
bool WebScrollbarThemeClientImpl::IsLeftSideVerticalScrollbar() const {
return scrollbar_.IsLeftSideVerticalScrollbar();
}
int WebScrollbarThemeClientImpl::Value() const {
return scrollbar_.Value();
}
float WebScrollbarThemeClientImpl::CurrentPos() const {
return Value();
}
int WebScrollbarThemeClientImpl::VisibleSize() const {
return TotalSize() - Maximum();
}
int WebScrollbarThemeClientImpl::TotalSize() const {
return scrollbar_.TotalSize();
}
int WebScrollbarThemeClientImpl::Maximum() const {
return scrollbar_.Maximum();
}
ScrollbarControlSize WebScrollbarThemeClientImpl::GetControlSize() const {
return static_cast<ScrollbarControlSize>(scrollbar_.GetControlSize());
}
ScrollbarPart WebScrollbarThemeClientImpl::PressedPart() const {
return static_cast<ScrollbarPart>(scrollbar_.PressedPart());
}
ScrollbarPart WebScrollbarThemeClientImpl::HoveredPart() const {
return static_cast<ScrollbarPart>(scrollbar_.HoveredPart());
}
void WebScrollbarThemeClientImpl::StyleChanged() {
NOTREACHED();
}
void WebScrollbarThemeClientImpl::SetScrollbarsHiddenIfOverlay(bool hidden) {
NOTREACHED();
}
bool WebScrollbarThemeClientImpl::Enabled() const {
return scrollbar_.Enabled();
}
void WebScrollbarThemeClientImpl::SetEnabled(bool) {
NOTREACHED();
}
bool WebScrollbarThemeClientImpl::IsOverlayScrollbar() const {
return scrollbar_.IsOverlay();
}
float WebScrollbarThemeClientImpl::ElasticOverscroll() const {
return scrollbar_.ElasticOverscroll();
}
void WebScrollbarThemeClientImpl::SetElasticOverscroll(
float elastic_overscroll) {
return scrollbar_.SetElasticOverscroll(elastic_overscroll);
}
} // namespace blink
/*
* Copyright (C) 2012 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:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. 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.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.
*/
#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_EXPORTED_WEB_SCROLLBAR_THEME_CLIENT_IMPL_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_EXPORTED_WEB_SCROLLBAR_THEME_CLIENT_IMPL_H_
#include "third_party/blink/public/platform/web_scrollbar.h"
#include "third_party/blink/renderer/platform/platform_export.h"
#include "third_party/blink/renderer/platform/scroll/scrollbar_theme_client.h"
#include "third_party/blink/renderer/platform/wtf/allocator.h"
#include "third_party/blink/renderer/platform/wtf/noncopyable.h"
namespace blink {
// Adapts a WebScrollbar to the ScrollbarThemeClient interface
class PLATFORM_EXPORT WebScrollbarThemeClientImpl
: public ScrollbarThemeClient {
DISALLOW_NEW();
WTF_MAKE_NONCOPYABLE(WebScrollbarThemeClientImpl);
public:
// Caller must retain ownership of this pointer and ensure that its lifetime
// exceeds this instance.
WebScrollbarThemeClientImpl(WebScrollbar&);
~WebScrollbarThemeClientImpl() override;
// Implement ScrollbarThemeClient interface
int X() const override;
int Y() const override;
int Width() const override;
int Height() const override;
IntSize Size() const override;
IntPoint Location() const override;
void SetFrameRect(const IntRect&) override;
IntRect FrameRect() const override;
void Invalidate() override;
void InvalidateRect(const IntRect&) override;
ScrollbarOverlayColorTheme GetScrollbarOverlayColorTheme() const override;
void GetTickmarks(Vector<IntRect>&) const override;
bool IsScrollableAreaActive() const override;
IntPoint ConvertFromRootFrame(const IntPoint&) const override;
bool IsCustomScrollbar() const override;
ScrollbarOrientation Orientation() const override;
bool IsLeftSideVerticalScrollbar() const override;
int Value() const override;
float CurrentPos() const override;
int VisibleSize() const override;
int TotalSize() const override;
int Maximum() const override;
ScrollbarControlSize GetControlSize() const override;
ScrollbarPart PressedPart() const override;
ScrollbarPart HoveredPart() const override;
void StyleChanged() override;
void SetScrollbarsHiddenIfOverlay(bool) override;
bool Enabled() const override;
void SetEnabled(bool) override;
bool IsOverlayScrollbar() const override;
float ElasticOverscroll() const override;
void SetElasticOverscroll(float) override;
private:
WebScrollbar& scrollbar_;
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_EXPORTED_WEB_SCROLLBAR_THEME_CLIENT_IMPL_H_
/*
* Copyright (C) 2012 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:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. 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.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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/platform/exported/web_scrollbar_theme_geometry_native.h"
#include <memory>
#include "base/memory/ptr_util.h"
#include "third_party/blink/public/platform/web_scrollbar.h"
#include "third_party/blink/renderer/platform/exported/web_scrollbar_theme_client_impl.h"
#include "third_party/blink/renderer/platform/scroll/scrollbar_theme.h"
namespace blink {
std::unique_ptr<WebScrollbarThemeGeometryNative>
WebScrollbarThemeGeometryNative::Create(ScrollbarTheme& theme) {
return base::WrapUnique(new WebScrollbarThemeGeometryNative(theme));
}
WebScrollbarThemeGeometryNative::WebScrollbarThemeGeometryNative(
ScrollbarTheme& theme)
: theme_(theme) {}
bool WebScrollbarThemeGeometryNative::HasButtons(WebScrollbar* scrollbar) {
return theme_.HasButtons(WebScrollbarThemeClientImpl(*scrollbar));
}
bool WebScrollbarThemeGeometryNative::HasThumb(WebScrollbar* scrollbar) {
return theme_.HasThumb(WebScrollbarThemeClientImpl(*scrollbar));
}
WebRect WebScrollbarThemeGeometryNative::TrackRect(WebScrollbar* scrollbar) {
return theme_.TrackRect(WebScrollbarThemeClientImpl(*scrollbar));
}
WebRect WebScrollbarThemeGeometryNative::ThumbRect(WebScrollbar* scrollbar) {
return theme_.ThumbRect(WebScrollbarThemeClientImpl(*scrollbar));
}
WebRect WebScrollbarThemeGeometryNative::BackButtonStartRect(
WebScrollbar* scrollbar) {
return theme_.BackButtonRect(WebScrollbarThemeClientImpl(*scrollbar),
kBackButtonStartPart, false);
}
WebRect WebScrollbarThemeGeometryNative::BackButtonEndRect(
WebScrollbar* scrollbar) {
return theme_.BackButtonRect(WebScrollbarThemeClientImpl(*scrollbar),
kBackButtonEndPart, false);
}
WebRect WebScrollbarThemeGeometryNative::ForwardButtonStartRect(
WebScrollbar* scrollbar) {
return theme_.ForwardButtonRect(WebScrollbarThemeClientImpl(*scrollbar),
kForwardButtonStartPart, false);
}
WebRect WebScrollbarThemeGeometryNative::ForwardButtonEndRect(
WebScrollbar* scrollbar) {
return theme_.ForwardButtonRect(WebScrollbarThemeClientImpl(*scrollbar),
kForwardButtonEndPart, false);
}
WebSize WebScrollbarThemeGeometryNative::NinePatchThumbCanvasSize(
WebScrollbar* scrollbar) {
DCHECK(theme_.UsesNinePatchThumbResource());
return theme_.NinePatchThumbCanvasSize(
WebScrollbarThemeClientImpl(*scrollbar));
}
WebRect WebScrollbarThemeGeometryNative::NinePatchThumbAperture(
WebScrollbar* scrollbar) {
DCHECK(theme_.UsesNinePatchThumbResource());
return theme_.NinePatchThumbAperture(WebScrollbarThemeClientImpl(*scrollbar));
}
} // namespace blink
/*
* Copyright (C) 2012 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:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. 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.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.
*/
#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_EXPORTED_WEB_SCROLLBAR_THEME_GEOMETRY_NATIVE_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_EXPORTED_WEB_SCROLLBAR_THEME_GEOMETRY_NATIVE_H_
#include <memory>
#include "third_party/blink/public/platform/web_rect.h"
#include "third_party/blink/public/platform/web_scrollbar_theme_geometry.h"
#include "third_party/blink/renderer/platform/platform_export.h"
#include "third_party/blink/renderer/platform/wtf/allocator.h"
#include "third_party/blink/renderer/platform/wtf/noncopyable.h"
namespace blink {
class ScrollbarTheme;
class WebScrollbar;
class PLATFORM_EXPORT WebScrollbarThemeGeometryNative
: public WebScrollbarThemeGeometry {
USING_FAST_MALLOC(WebScrollbarThemeGeometryNative);
WTF_MAKE_NONCOPYABLE(WebScrollbarThemeGeometryNative);
public:
static std::unique_ptr<WebScrollbarThemeGeometryNative> Create(
ScrollbarTheme&);
bool HasButtons(WebScrollbar*) override;
bool HasThumb(WebScrollbar*) override;
WebRect TrackRect(WebScrollbar*) override;
WebRect ThumbRect(WebScrollbar*) override;
WebRect BackButtonStartRect(WebScrollbar*) override;
WebRect BackButtonEndRect(WebScrollbar*) override;
WebRect ForwardButtonStartRect(WebScrollbar*) override;
WebRect ForwardButtonEndRect(WebScrollbar*) override;
WebSize NinePatchThumbCanvasSize(WebScrollbar*) override;
WebRect NinePatchThumbAperture(WebScrollbar*) override;
private:
explicit WebScrollbarThemeGeometryNative(ScrollbarTheme&);
// The theme is not owned by this class. It is assumed that the theme is a
// static pointer and its lifetime is essentially infinite. Only thread-safe
// functions on the theme can be called by this theme.
ScrollbarTheme& theme_;
};
} // namespace blink
#endif
/*
* Copyright (C) 2012 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:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. 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.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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/public/platform/web_scrollbar_theme_painter.h"
#include "third_party/blink/public/platform/web_rect.h"
#include "third_party/blink/renderer/platform/graphics/graphics_context.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_canvas.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_record_builder.h"
#include "third_party/blink/renderer/platform/scroll/scrollbar.h"
#include "third_party/blink/renderer/platform/scroll/scrollbar_theme.h"
namespace blink {
// WebScrollbarThemeMac uses GraphicsContextCanvas which doesn't quite support
// device clip rects not at the origin. This class translates the recording
// canvas to the origin and then adjusts it back during playback.
class ScopedScrollbarPainter {
public:
ScopedScrollbarPainter(WebScrollbarThemePainter* painter,
WebCanvas* canvas,
const WebRect& rect)
: int_rect_(IntRect(IntPoint(), IntSize(rect.width, rect.height))),
canvas_(canvas),
rect_(rect) {
builder_.Context().SetDeviceScaleFactor(painter->DeviceScaleFactor());
}
GraphicsContext& Context() { return builder_.Context(); }
const IntRect& Rect() const { return int_rect_; }
~ScopedScrollbarPainter() {
canvas_->save();
canvas_->translate(rect_.x, rect_.y);
canvas_->drawPicture(builder_.EndRecording());
canvas_->restore();
}
protected:
IntRect int_rect_;
PaintRecordBuilder builder_;
WebCanvas* canvas_;
const WebRect& rect_;
};
void WebScrollbarThemePainter::Assign(const WebScrollbarThemePainter& painter) {
// This is a pointer to a static object, so no ownership transferral.
theme_ = painter.theme_;
scrollbar_ = painter.scrollbar_;
device_scale_factor_ = painter.device_scale_factor_;
}
void WebScrollbarThemePainter::Reset() {
scrollbar_ = nullptr;
}
void WebScrollbarThemePainter::PaintScrollbarBackground(WebCanvas* canvas,
const WebRect& rect) {
SkRect clip = SkRect::MakeXYWH(rect.x, rect.y, rect.width, rect.height);
canvas->clipRect(clip);
ScopedScrollbarPainter painter(this, canvas, rect);
theme_->PaintScrollbarBackground(painter.Context(), *scrollbar_);
}
void WebScrollbarThemePainter::PaintTrackBackground(WebCanvas* canvas,
const WebRect& rect) {
ScopedScrollbarPainter painter(this, canvas, rect);
theme_->PaintTrackBackground(painter.Context(), *scrollbar_, painter.Rect());
if (!theme_->ShouldRepaintAllPartsOnInvalidation())
scrollbar_->ClearTrackNeedsRepaint();
}
void WebScrollbarThemePainter::PaintBackTrackPart(WebCanvas* canvas,
const WebRect& rect) {
ScopedScrollbarPainter painter(this, canvas, rect);
theme_->PaintTrackPiece(painter.Context(), *scrollbar_, painter.Rect(),
kBackTrackPart);
}
void WebScrollbarThemePainter::PaintForwardTrackPart(WebCanvas* canvas,
const WebRect& rect) {
ScopedScrollbarPainter painter(this, canvas, rect);
theme_->PaintTrackPiece(painter.Context(), *scrollbar_, painter.Rect(),
kForwardTrackPart);
}
void WebScrollbarThemePainter::PaintBackButtonStart(WebCanvas* canvas,
const WebRect& rect) {
ScopedScrollbarPainter painter(this, canvas, rect);
theme_->PaintButton(painter.Context(), *scrollbar_, painter.Rect(),
kBackButtonStartPart);
}
void WebScrollbarThemePainter::PaintBackButtonEnd(WebCanvas* canvas,
const WebRect& rect) {
ScopedScrollbarPainter painter(this, canvas, rect);
theme_->PaintButton(painter.Context(), *scrollbar_, painter.Rect(),
kBackButtonEndPart);
}
void WebScrollbarThemePainter::PaintForwardButtonStart(WebCanvas* canvas,
const WebRect& rect) {
ScopedScrollbarPainter painter(this, canvas, rect);
theme_->PaintButton(painter.Context(), *scrollbar_, painter.Rect(),
kForwardButtonStartPart);
}
void WebScrollbarThemePainter::PaintForwardButtonEnd(WebCanvas* canvas,
const WebRect& rect) {
ScopedScrollbarPainter painter(this, canvas, rect);
theme_->PaintButton(painter.Context(), *scrollbar_, painter.Rect(),
kForwardButtonEndPart);
}
void WebScrollbarThemePainter::PaintTickmarks(WebCanvas* canvas,
const WebRect& rect) {
ScopedScrollbarPainter painter(this, canvas, rect);
theme_->PaintTickmarks(painter.Context(), *scrollbar_, painter.Rect());
}
void WebScrollbarThemePainter::PaintThumb(WebCanvas* canvas,
const WebRect& rect) {
ScopedScrollbarPainter painter(this, canvas, rect);
theme_->PaintThumb(painter.Context(), *scrollbar_, painter.Rect());
if (!theme_->ShouldRepaintAllPartsOnInvalidation())
scrollbar_->ClearThumbNeedsRepaint();
}
WebScrollbarThemePainter::WebScrollbarThemePainter(ScrollbarTheme& theme,
Scrollbar& scrollbar,
float device_scale_factor)
: theme_(&theme),
scrollbar_(&scrollbar),
device_scale_factor_(device_scale_factor) {}
float WebScrollbarThemePainter::ThumbOpacity() const {
return theme_->ThumbOpacity(*scrollbar_);
}
bool WebScrollbarThemePainter::TrackNeedsRepaint() const {
return scrollbar_->TrackNeedsRepaint();
}
bool WebScrollbarThemePainter::ThumbNeedsRepaint() const {
return scrollbar_->ThumbNeedsRepaint();
}
bool WebScrollbarThemePainter::UsesNinePatchThumbResource() const {
return theme_->UsesNinePatchThumbResource();
}
} // namespace blink
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "third_party/blink/renderer/platform/geometry/int_point.h" #include "third_party/blink/renderer/platform/geometry/int_point.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
#include "ui/gfx/geometry/point.h"
namespace blink { namespace blink {
...@@ -12,6 +13,10 @@ std::ostream& operator<<(std::ostream& ostream, const IntPoint& point) { ...@@ -12,6 +13,10 @@ std::ostream& operator<<(std::ostream& ostream, const IntPoint& point) {
return ostream << point.ToString(); return ostream << point.ToString();
} }
IntPoint::operator gfx::Point() const {
return gfx::Point(X(), Y());
}
String IntPoint::ToString() const { String IntPoint::ToString() const {
return String::Format("%d,%d", X(), Y()); return String::Format("%d,%d", X(), Y());
} }
......
...@@ -43,6 +43,10 @@ typedef struct CGPoint CGPoint; ...@@ -43,6 +43,10 @@ typedef struct CGPoint CGPoint;
#endif #endif
#endif #endif
namespace gfx {
class Point;
}
namespace blink { namespace blink {
class PLATFORM_EXPORT IntPoint { class PLATFORM_EXPORT IntPoint {
...@@ -100,6 +104,8 @@ class PLATFORM_EXPORT IntPoint { ...@@ -100,6 +104,8 @@ class PLATFORM_EXPORT IntPoint {
operator CGPoint() const; operator CGPoint() const;
#endif #endif
operator gfx::Point() const;
String ToString() const; String ToString() const;
private: private:
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "third_party/blink/public/platform/web_gesture_event.h" #include "third_party/blink/public/platform/web_gesture_event.h"
#include "third_party/blink/public/platform/web_mouse_event.h" #include "third_party/blink/public/platform/web_mouse_event.h"
#include "third_party/blink/public/platform/web_scrollbar.h" #include "third_party/blink/public/platform/web_scrollbar.h"
#include "third_party/blink/public/platform/web_scrollbar_overlay_color_theme.h"
#include "third_party/blink/renderer/platform/geometry/float_rect.h" #include "third_party/blink/renderer/platform/geometry/float_rect.h"
#include "third_party/blink/renderer/platform/graphics/paint/cull_rect.h" #include "third_party/blink/renderer/platform/graphics/paint/cull_rect.h"
#include "third_party/blink/renderer/platform/platform_chrome_client.h" #include "third_party/blink/renderer/platform/platform_chrome_client.h"
...@@ -644,25 +645,6 @@ STATIC_ASSERT_ENUM(WebScrollbar::ScrollingMode::kAlwaysOn, kScrollbarAlwaysOn); ...@@ -644,25 +645,6 @@ STATIC_ASSERT_ENUM(WebScrollbar::ScrollingMode::kAlwaysOn, kScrollbarAlwaysOn);
STATIC_ASSERT_ENUM(WebScrollbar::kHorizontal, kHorizontalScrollbar); STATIC_ASSERT_ENUM(WebScrollbar::kHorizontal, kHorizontalScrollbar);
STATIC_ASSERT_ENUM(WebScrollbar::kVertical, kVerticalScrollbar); STATIC_ASSERT_ENUM(WebScrollbar::kVertical, kVerticalScrollbar);
STATIC_ASSERT_ENUM(WebScrollbar::kScrollByLine, kScrollByLine);
STATIC_ASSERT_ENUM(WebScrollbar::kScrollByPage, kScrollByPage);
STATIC_ASSERT_ENUM(WebScrollbar::kScrollByDocument, kScrollByDocument);
STATIC_ASSERT_ENUM(WebScrollbar::kScrollByPixel, kScrollByPixel);
STATIC_ASSERT_ENUM(WebScrollbar::kRegularScrollbar, kRegularScrollbar);
STATIC_ASSERT_ENUM(WebScrollbar::kSmallScrollbar, kSmallScrollbar);
STATIC_ASSERT_ENUM(WebScrollbar::kNoPart, kNoPart);
STATIC_ASSERT_ENUM(WebScrollbar::kBackButtonStartPart, kBackButtonStartPart);
STATIC_ASSERT_ENUM(WebScrollbar::kForwardButtonStartPart,
kForwardButtonStartPart);
STATIC_ASSERT_ENUM(WebScrollbar::kBackTrackPart, kBackTrackPart);
STATIC_ASSERT_ENUM(WebScrollbar::kThumbPart, kThumbPart);
STATIC_ASSERT_ENUM(WebScrollbar::kForwardTrackPart, kForwardTrackPart);
STATIC_ASSERT_ENUM(WebScrollbar::kBackButtonEndPart, kBackButtonEndPart);
STATIC_ASSERT_ENUM(WebScrollbar::kForwardButtonEndPart, kForwardButtonEndPart);
STATIC_ASSERT_ENUM(WebScrollbar::kScrollbarBGPart, kScrollbarBGPart);
STATIC_ASSERT_ENUM(WebScrollbar::kTrackBGPart, kTrackBGPart);
STATIC_ASSERT_ENUM(WebScrollbar::kAllParts, kAllParts);
STATIC_ASSERT_ENUM(kWebScrollbarOverlayColorThemeDark, STATIC_ASSERT_ENUM(kWebScrollbarOverlayColorThemeDark,
kScrollbarOverlayColorThemeDark); kScrollbarOverlayColorThemeDark);
STATIC_ASSERT_ENUM(kWebScrollbarOverlayColorThemeLight, STATIC_ASSERT_ENUM(kWebScrollbarOverlayColorThemeLight,
......
...@@ -7,22 +7,43 @@ ...@@ -7,22 +7,43 @@
#include "third_party/blink/public/platform/web_point.h" #include "third_party/blink/public/platform/web_point.h"
#include "third_party/blink/public/platform/web_rect.h" #include "third_party/blink/public/platform/web_rect.h"
#include "third_party/blink/public/platform/web_scrollbar.h" #include "third_party/blink/public/platform/web_scrollbar.h"
#include "third_party/blink/public/platform/web_scrollbar_theme_geometry.h" #include "third_party/blink/renderer/platform/graphics/paint/paint_record_builder.h"
#include "third_party/blink/renderer/platform/scroll/scroll_types.h"
#include "third_party/blink/renderer/platform/scroll/scrollbar.h"
#include "third_party/blink/renderer/platform/scroll/scrollbar_theme.h"
#include "ui/gfx/skia_util.h"
namespace blink { namespace blink {
ScrollbarLayerDelegate::ScrollbarLayerDelegate( namespace {
std::unique_ptr<WebScrollbar> scrollbar,
WebScrollbarThemePainter painter, class ScopedScrollbarPainter {
std::unique_ptr<WebScrollbarThemeGeometry> geometry) public:
: scrollbar_(std::move(scrollbar)), ScopedScrollbarPainter(cc::PaintCanvas& canvas, float device_scale_factor)
painter_(painter), : canvas_(canvas) {
geometry_(std::move(geometry)) {} builder_.Context().SetDeviceScaleFactor(device_scale_factor);
}
~ScopedScrollbarPainter() { canvas_.drawPicture(builder_.EndRecording()); }
GraphicsContext& Context() { return builder_.Context(); }
private:
cc::PaintCanvas& canvas_;
PaintRecordBuilder builder_;
};
} // namespace
ScrollbarLayerDelegate::ScrollbarLayerDelegate(blink::Scrollbar& scrollbar,
float device_scale_factor)
: scrollbar_(&scrollbar),
theme_(scrollbar.GetTheme()),
device_scale_factor_(device_scale_factor) {}
ScrollbarLayerDelegate::~ScrollbarLayerDelegate() = default; ScrollbarLayerDelegate::~ScrollbarLayerDelegate() = default;
cc::ScrollbarOrientation ScrollbarLayerDelegate::Orientation() const { cc::ScrollbarOrientation ScrollbarLayerDelegate::Orientation() const {
if (scrollbar_->GetOrientation() == WebScrollbar::kHorizontal) if (scrollbar_->Orientation() == kHorizontalScrollbar)
return cc::HORIZONTAL; return cc::HORIZONTAL;
return cc::VERTICAL; return cc::VERTICAL;
} }
...@@ -32,109 +53,122 @@ bool ScrollbarLayerDelegate::IsLeftSideVerticalScrollbar() const { ...@@ -32,109 +53,122 @@ bool ScrollbarLayerDelegate::IsLeftSideVerticalScrollbar() const {
} }
bool ScrollbarLayerDelegate::HasThumb() const { bool ScrollbarLayerDelegate::HasThumb() const {
return geometry_->HasThumb(scrollbar_.get()); return theme_.HasThumb(*scrollbar_);
} }
bool ScrollbarLayerDelegate::IsOverlay() const { bool ScrollbarLayerDelegate::IsOverlay() const {
return scrollbar_->IsOverlay(); return scrollbar_->IsOverlayScrollbar();
} }
gfx::Point ScrollbarLayerDelegate::Location() const { gfx::Point ScrollbarLayerDelegate::Location() const {
return static_cast<gfx::Point>(scrollbar_->Location()); return scrollbar_->Location();
} }
int ScrollbarLayerDelegate::ThumbThickness() const { int ScrollbarLayerDelegate::ThumbThickness() const {
auto thumb_rect = IntRect thumb_rect = theme_.ThumbRect(*scrollbar_);
static_cast<gfx::Rect>(geometry_->ThumbRect(scrollbar_.get())); if (scrollbar_->Orientation() == kHorizontalScrollbar)
if (scrollbar_->GetOrientation() == WebScrollbar::kHorizontal) return thumb_rect.Height();
return thumb_rect.height(); return thumb_rect.Width();
return thumb_rect.width();
} }
int ScrollbarLayerDelegate::ThumbLength() const { int ScrollbarLayerDelegate::ThumbLength() const {
auto thumb_rect = IntRect thumb_rect = theme_.ThumbRect(*scrollbar_);
static_cast<gfx::Rect>(geometry_->ThumbRect(scrollbar_.get())); if (scrollbar_->Orientation() == kHorizontalScrollbar)
if (scrollbar_->GetOrientation() == WebScrollbar::kHorizontal) return thumb_rect.Width();
return thumb_rect.width(); return thumb_rect.Height();
return thumb_rect.height();
} }
gfx::Rect ScrollbarLayerDelegate::TrackRect() const { gfx::Rect ScrollbarLayerDelegate::TrackRect() const {
return static_cast<gfx::Rect>(geometry_->TrackRect(scrollbar_.get())); return theme_.TrackRect(*scrollbar_);
} }
float ScrollbarLayerDelegate::ThumbOpacity() const { float ScrollbarLayerDelegate::ThumbOpacity() const {
return painter_.ThumbOpacity(); return theme_.ThumbOpacity(*scrollbar_);
} }
bool ScrollbarLayerDelegate::NeedsPaintPart(cc::ScrollbarPart part) const { bool ScrollbarLayerDelegate::NeedsPaintPart(cc::ScrollbarPart part) const {
if (part == cc::THUMB) if (part == cc::THUMB)
return painter_.ThumbNeedsRepaint(); return scrollbar_->ThumbNeedsRepaint();
return painter_.TrackNeedsRepaint(); return scrollbar_->TrackNeedsRepaint();
} }
bool ScrollbarLayerDelegate::UsesNinePatchThumbResource() const { bool ScrollbarLayerDelegate::UsesNinePatchThumbResource() const {
return painter_.UsesNinePatchThumbResource(); return theme_.UsesNinePatchThumbResource();
} }
gfx::Size ScrollbarLayerDelegate::NinePatchThumbCanvasSize() const { gfx::Size ScrollbarLayerDelegate::NinePatchThumbCanvasSize() const {
return static_cast<gfx::Size>( DCHECK(theme_.UsesNinePatchThumbResource());
geometry_->NinePatchThumbCanvasSize(scrollbar_.get())); return static_cast<gfx::Size>(theme_.NinePatchThumbCanvasSize(*scrollbar_));
} }
gfx::Rect ScrollbarLayerDelegate::NinePatchThumbAperture() const { gfx::Rect ScrollbarLayerDelegate::NinePatchThumbAperture() const {
return static_cast<gfx::Rect>( DCHECK(theme_.UsesNinePatchThumbResource());
geometry_->NinePatchThumbAperture(scrollbar_.get())); return theme_.NinePatchThumbAperture(*scrollbar_);
} }
bool ScrollbarLayerDelegate::HasTickmarks() const { bool ScrollbarLayerDelegate::HasTickmarks() const {
return scrollbar_->HasTickmarks(); Vector<IntRect> tickmarks;
scrollbar_->GetTickmarks(tickmarks);
return !tickmarks.IsEmpty();
} }
void ScrollbarLayerDelegate::PaintPart(cc::PaintCanvas* canvas, void ScrollbarLayerDelegate::PaintPart(cc::PaintCanvas* canvas,
cc::ScrollbarPart part, cc::ScrollbarPart part,
const gfx::Rect& content_rect) { const gfx::Rect& content_rect) {
PaintCanvasAutoRestore auto_restore(canvas, true);
blink::Scrollbar& scrollbar = *scrollbar_;
if (part == cc::THUMB) { if (part == cc::THUMB) {
painter_.PaintThumb(canvas, WebRect(content_rect)); ScopedScrollbarPainter painter(*canvas, device_scale_factor_);
theme_.PaintThumb(painter.Context(), scrollbar, IntRect(content_rect));
if (!theme_.ShouldRepaintAllPartsOnInvalidation())
scrollbar.ClearThumbNeedsRepaint();
return; return;
} }
if (part == cc::TICKMARKS) { if (part == cc::TICKMARKS) {
painter_.PaintTickmarks(canvas, WebRect(content_rect)); ScopedScrollbarPainter painter(*canvas, device_scale_factor_);
theme_.PaintTickmarks(painter.Context(), scrollbar, IntRect(content_rect));
return; return;
} }
// The following is a simplification of ScrollbarThemeComposite::paint. canvas->clipRect(gfx::RectToSkRect(content_rect));
painter_.PaintScrollbarBackground(canvas, WebRect(content_rect)); ScopedScrollbarPainter painter(*canvas, device_scale_factor_);
GraphicsContext& context = painter.Context();
if (geometry_->HasButtons(scrollbar_.get())) {
WebRect back_button_start_paint_rect = theme_.PaintScrollbarBackground(context, scrollbar);
geometry_->BackButtonStartRect(scrollbar_.get());
painter_.PaintBackButtonStart(canvas, back_button_start_paint_rect); if (theme_.HasButtons(scrollbar)) {
theme_.PaintButton(context, scrollbar,
WebRect back_button_end_paint_rect = theme_.BackButtonRect(scrollbar, kBackButtonStartPart),
geometry_->BackButtonEndRect(scrollbar_.get()); kBackButtonStartPart);
painter_.PaintBackButtonEnd(canvas, back_button_end_paint_rect); theme_.PaintButton(context, scrollbar,
theme_.BackButtonRect(scrollbar, kBackButtonEndPart),
WebRect forward_button_start_paint_rect = kBackButtonEndPart);
geometry_->ForwardButtonStartRect(scrollbar_.get()); theme_.PaintButton(
painter_.PaintForwardButtonStart(canvas, forward_button_start_paint_rect); context, scrollbar,
theme_.ForwardButtonRect(scrollbar, kForwardButtonStartPart),
WebRect forward_button_end_paint_rect = kForwardButtonStartPart);
geometry_->ForwardButtonEndRect(scrollbar_.get()); theme_.PaintButton(
painter_.PaintForwardButtonEnd(canvas, forward_button_end_paint_rect); context, scrollbar,
theme_.ForwardButtonRect(scrollbar, kForwardButtonEndPart),
kForwardButtonEndPart);
} }
WebRect track_paint_rect = geometry_->TrackRect(scrollbar_.get()); IntRect track_paint_rect = theme_.TrackRect(scrollbar);
painter_.PaintTrackBackground(canvas, track_paint_rect); theme_.PaintTrackBackground(context, scrollbar, track_paint_rect);
bool thumb_present = geometry_->HasThumb(scrollbar_.get()); if (theme_.HasThumb(scrollbar)) {
if (thumb_present) { theme_.PaintTrackPiece(painter.Context(), scrollbar, track_paint_rect,
painter_.PaintForwardTrackPart(canvas, track_paint_rect); kForwardTrackPart);
painter_.PaintBackTrackPart(canvas, track_paint_rect); theme_.PaintTrackPiece(painter.Context(), scrollbar, track_paint_rect,
kBackTrackPart);
} }
painter_.PaintTickmarks(canvas, track_paint_rect); theme_.PaintTickmarks(painter.Context(), scrollbar, track_paint_rect);
if (!theme_.ShouldRepaintAllPartsOnInvalidation())
scrollbar.ClearTrackNeedsRepaint();
} }
} // namespace blink } // namespace blink
...@@ -10,20 +10,20 @@ ...@@ -10,20 +10,20 @@
#include "base/macros.h" #include "base/macros.h"
#include "cc/input/scrollbar.h" #include "cc/input/scrollbar.h"
#include "cc/paint/paint_canvas.h" #include "cc/paint/paint_canvas.h"
#include "third_party/blink/public/platform/web_scrollbar_theme_painter.h" #include "third_party/blink/renderer/platform/heap/handle.h"
#include "third_party/blink/renderer/platform/platform_export.h" #include "third_party/blink/renderer/platform/platform_export.h"
namespace blink { namespace blink {
class WebScrollbar;
class WebScrollbarThemeGeometry; class Scrollbar;
class ScrollbarTheme;
// Implementation of cc::Scrollbar, providing a delegate to query about // Implementation of cc::Scrollbar, providing a delegate to query about
// scrollbar state and to paint the image in the scrollbar. // scrollbar state and to paint the image in the scrollbar.
class PLATFORM_EXPORT ScrollbarLayerDelegate : public cc::Scrollbar { class PLATFORM_EXPORT ScrollbarLayerDelegate : public cc::Scrollbar {
public: public:
ScrollbarLayerDelegate(std::unique_ptr<WebScrollbar> scrollbar, ScrollbarLayerDelegate(blink::Scrollbar& scrollbar,
WebScrollbarThemePainter painter, float device_scale_factor);
std::unique_ptr<WebScrollbarThemeGeometry> geometry);
~ScrollbarLayerDelegate() override; ~ScrollbarLayerDelegate() override;
// cc::Scrollbar implementation. // cc::Scrollbar implementation.
...@@ -47,9 +47,12 @@ class PLATFORM_EXPORT ScrollbarLayerDelegate : public cc::Scrollbar { ...@@ -47,9 +47,12 @@ class PLATFORM_EXPORT ScrollbarLayerDelegate : public cc::Scrollbar {
gfx::Rect NinePatchThumbAperture() const override; gfx::Rect NinePatchThumbAperture() const override;
private: private:
std::unique_ptr<WebScrollbar> scrollbar_; // Accessed by main and compositor threads, e.g., the compositor thread
WebScrollbarThemePainter painter_; // checks |Orientation()|.
std::unique_ptr<WebScrollbarThemeGeometry> geometry_; CrossThreadPersistent<blink::Scrollbar> scrollbar_;
ScrollbarTheme& theme_;
float device_scale_factor_;
DISALLOW_COPY_AND_ASSIGN(ScrollbarLayerDelegate); DISALLOW_COPY_AND_ASSIGN(ScrollbarLayerDelegate);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment