This source file includes following definitions.
- x
- y
- width
- height
- size
- location
- parent
- root
- setFrameRect
- frameRect
- invalidate
- invalidateRect
- scrollbarOverlayStyle
- getTickmarks
- isScrollableAreaActive
- isScrollViewScrollbar
- convertFromContainingWindow
- isCustomScrollbar
- orientation
- isLeftSideVerticalScrollbar
- value
- currentPos
- visibleSize
- totalSize
- maximum
- controlSize
- pressedPart
- hoveredPart
- styleChanged
- enabled
- setEnabled
- isOverlayScrollbar
- isAlphaLocked
- setIsAlphaLocked
#include "config.h"
#include "platform/exported/WebScrollbarThemeClientImpl.h"
#include "platform/scroll/ScrollbarTheme.h"
using blink::WebScrollbar;
namespace WebCore {
WebScrollbarThemeClientImpl::WebScrollbarThemeClientImpl(WebScrollbar* scrollbar)
: m_scrollbar(scrollbar)
{
ScrollbarTheme::theme()->registerScrollbar(this);
}
WebScrollbarThemeClientImpl::~WebScrollbarThemeClientImpl()
{
ScrollbarTheme::theme()->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 m_scrollbar->size();
}
IntPoint WebScrollbarThemeClientImpl::location() const
{
return m_scrollbar->location();
}
Widget* WebScrollbarThemeClientImpl::parent() const
{
ASSERT_NOT_REACHED();
return 0;
}
Widget* WebScrollbarThemeClientImpl::root() const
{
ASSERT_NOT_REACHED();
return 0;
}
void WebScrollbarThemeClientImpl::setFrameRect(const IntRect&)
{
ASSERT_NOT_REACHED();
}
IntRect WebScrollbarThemeClientImpl::frameRect() const
{
return IntRect(location(), size());
}
void WebScrollbarThemeClientImpl::invalidate()
{
ASSERT_NOT_REACHED();
}
void WebScrollbarThemeClientImpl::invalidateRect(const IntRect&)
{
ASSERT_NOT_REACHED();
}
WebCore::ScrollbarOverlayStyle WebScrollbarThemeClientImpl::scrollbarOverlayStyle() const
{
return static_cast<WebCore::ScrollbarOverlayStyle>(m_scrollbar->scrollbarOverlayStyle());
}
void WebScrollbarThemeClientImpl::getTickmarks(Vector<IntRect>& tickmarks) const
{
blink::WebVector<blink::WebRect> webTickmarks;
m_scrollbar->getTickmarks(webTickmarks);
tickmarks.resize(webTickmarks.size());
for (size_t i = 0; i < webTickmarks.size(); ++i)
tickmarks[i] = webTickmarks[i];
}
bool WebScrollbarThemeClientImpl::isScrollableAreaActive() const
{
return m_scrollbar->isScrollableAreaActive();
}
bool WebScrollbarThemeClientImpl::isScrollViewScrollbar() const
{
ASSERT_NOT_REACHED();
return false;
}
IntPoint WebScrollbarThemeClientImpl::convertFromContainingWindow(const IntPoint& windowPoint)
{
ASSERT_NOT_REACHED();
return windowPoint;
}
bool WebScrollbarThemeClientImpl::isCustomScrollbar() const
{
return m_scrollbar->isCustomScrollbar();
}
WebCore::ScrollbarOrientation WebScrollbarThemeClientImpl::orientation() const
{
return static_cast<WebCore::ScrollbarOrientation>(m_scrollbar->orientation());
}
bool WebScrollbarThemeClientImpl::isLeftSideVerticalScrollbar() const
{
return m_scrollbar->isLeftSideVerticalScrollbar();
}
int WebScrollbarThemeClientImpl::value() const
{
return m_scrollbar->value();
}
float WebScrollbarThemeClientImpl::currentPos() const
{
return value();
}
int WebScrollbarThemeClientImpl::visibleSize() const
{
return totalSize() - maximum();
}
int WebScrollbarThemeClientImpl::totalSize() const
{
return m_scrollbar->totalSize();
}
int WebScrollbarThemeClientImpl::maximum() const
{
return m_scrollbar->maximum();
}
WebCore::ScrollbarControlSize WebScrollbarThemeClientImpl::controlSize() const
{
return static_cast<WebCore::ScrollbarControlSize>(m_scrollbar->controlSize());
}
WebCore::ScrollbarPart WebScrollbarThemeClientImpl::pressedPart() const
{
return static_cast<WebCore::ScrollbarPart>(m_scrollbar->pressedPart());
}
WebCore::ScrollbarPart WebScrollbarThemeClientImpl::hoveredPart() const
{
return static_cast<WebCore::ScrollbarPart>(m_scrollbar->hoveredPart());
}
void WebScrollbarThemeClientImpl::styleChanged()
{
ASSERT_NOT_REACHED();
}
bool WebScrollbarThemeClientImpl::enabled() const
{
return m_scrollbar->enabled();
}
void WebScrollbarThemeClientImpl::setEnabled(bool)
{
ASSERT_NOT_REACHED();
}
bool WebScrollbarThemeClientImpl::isOverlayScrollbar() const
{
return m_scrollbar->isOverlay();
}
bool WebScrollbarThemeClientImpl::isAlphaLocked() const
{
return m_scrollbar->isAlphaLocked();
}
void WebScrollbarThemeClientImpl::setIsAlphaLocked(bool flag)
{
m_scrollbar->setIsAlphaLocked(flag);
}
}