void ScrollingCoordinator::frameViewVerticalScrollbarLayerDidChange(FrameView* frameView, GraphicsLayer* verticalScrollbarLayer) { if (!verticalScrollbarLayer || !coordinatesScrollingForFrameView(frameView)) return; m_private->setVerticalScrollbarLayer(createScrollbarLayer(frameView->verticalScrollbar(), m_private->scrollLayer(), verticalScrollbarLayer, frameView)); }
void ScrollingCoordinator::frameViewHorizontalScrollbarLayerDidChange(FrameView* frameView, GraphicsLayer* horizontalScrollbarLayer) { if (!horizontalScrollbarLayer || !coordinatesScrollingForFrameView(frameView)) return; m_private->setHorizontalScrollbarLayer(createScrollbarLayer(frameView->horizontalScrollbar(), m_private->scrollLayer(), horizontalScrollbarLayer, frameView)); }
void ScrollingCoordinatorChromium::frameViewVerticalScrollbarLayerDidChange(FrameView* frameView, GraphicsLayer* verticalScrollbarLayer) { if (!verticalScrollbarLayer || !coordinatesScrollingForFrameView(frameView)) return; setScrollLayer(scrollLayerForFrameView(m_page->mainFrame()->view())); m_private->setVerticalScrollbarLayer(createScrollbarLayer(frameView->verticalScrollbar(), m_private->scrollLayer(), verticalScrollbarLayer, frameView)); }
void ScrollingCoordinatorChromium::scrollableAreaScrollbarLayerDidChange(ScrollableArea* scrollableArea, ScrollbarOrientation orientation) { #if OS(DARWIN) static const bool platformSupportsCoordinatedScrollbar = false; static const bool platformSupportsMainFrameOnly = false; // Don't care. #elif OS(WINDOWS) static const bool platformSupportsCoordinatedScrollbar = true; static const bool platformSupportsMainFrameOnly = true; #else static const bool platformSupportsCoordinatedScrollbar = true; static const bool platformSupportsMainFrameOnly = false; #endif if (!platformSupportsCoordinatedScrollbar) return; bool isMainFrame = (scrollableArea == static_cast<ScrollableArea*>(m_page->mainFrame()->view())); if (!isMainFrame && platformSupportsMainFrameOnly) return; GraphicsLayer* scrollbarGraphicsLayer = orientation == HorizontalScrollbar ? horizontalScrollbarLayerForScrollableArea(scrollableArea) : verticalScrollbarLayerForScrollableArea(scrollableArea); if (scrollbarGraphicsLayer) { Scrollbar* scrollbar = orientation == HorizontalScrollbar ? scrollableArea->horizontalScrollbar() : scrollableArea->verticalScrollbar(); if (scrollbar->isCustomScrollbar()) { detachScrollbarLayer(scrollbarGraphicsLayer); return; } WebScrollbarLayer* scrollbarLayer = getWebScrollbarLayer(scrollableArea, orientation); if (!scrollbarLayer) scrollbarLayer = addWebScrollbarLayer(scrollableArea, orientation, createScrollbarLayer(scrollbar)); // Root layer non-overlay scrollbars should be marked opaque to disable // blending. bool isOpaqueScrollbar = !scrollbar->isOverlayScrollbar(); if (!scrollbarGraphicsLayer->contentsOpaque()) scrollbarGraphicsLayer->setContentsOpaque(isMainFrame && isOpaqueScrollbar); scrollbarLayer->layer()->setOpaque(scrollbarGraphicsLayer->contentsOpaque()); setupScrollbarLayer(scrollbarGraphicsLayer, scrollbarLayer, scrollingWebLayerForScrollableArea(scrollableArea)); } else removeWebScrollbarLayer(scrollableArea, orientation); }