PassRefPtr<Scrollbar> RenderLayerScrollableArea::createScrollbar(ScrollbarOrientation orientation)
{
    RefPtr<Scrollbar> widget = Scrollbar::create(this, orientation);
    if (orientation == HorizontalScrollbar)
        didAddScrollbar(widget.get(), HorizontalScrollbar);
    else
        didAddScrollbar(widget.get(), VerticalScrollbar);
    return widget.release();
}
Esempio n. 2
0
void ScrollbarGroup::scrollbarCreated(WebPluginScrollbarImpl* scrollbar)
{
    bool hadScrollbars = m_horizontalScrollbar || m_verticalScrollbar;
    if (scrollbar->scrollbar()->orientation() == HorizontalScrollbar) {
        ASSERT(!m_horizontalScrollbar);
        m_horizontalScrollbar = scrollbar;
        didAddScrollbar(scrollbar->scrollbar(), HorizontalScrollbar);
    } else {
        ASSERT(!m_verticalScrollbar);
        m_verticalScrollbar = scrollbar;
        didAddScrollbar(scrollbar->scrollbar(), VerticalScrollbar);
    }

    if (!hadScrollbars) {
        m_frameView->addScrollableArea(this);
        m_frameView->setNeedsLayout();
    }
}