Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(932)

Unified Diff: Source/core/frame/VisualViewport.cpp

Issue 1308053003: Replace pinch scrollbars with regular scrollbars. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix webkit_unit_tests Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/frame/VisualViewport.cpp
diff --git a/Source/core/frame/VisualViewport.cpp b/Source/core/frame/VisualViewport.cpp
index 95c5d1416348fae715a163656e7097708bdb2ab6..d52decdc70a7c01efee0cafd6db82cdb4c19199d 100644
--- a/Source/core/frame/VisualViewport.cpp
+++ b/Source/core/frame/VisualViewport.cpp
@@ -273,11 +273,9 @@ bool VisualViewport::magnifyScaleAroundAnchor(float magnifyDelta, const FloatPoi
// | +-- outerViewportContainerLayer (fixed pos container) [frame container layer in DeprecatedPaintLayerCompositor]
// | | +-- outerViewportScrollLayer [frame scroll layer in DeprecatedPaintLayerCompositor]
// | | +-- content layers ...
-// | +-- horizontal ScrollbarLayer (non-overlay)
-// | +-- verticalScrollbarLayer (non-overlay)
-// | +-- scroll corner (non-overlay)
-// +- *horizontalScrollbarLayer (overlay)
-// +- *verticalScrollbarLayer (overlay)
+// +- horizontalScrollbarLayer
+// +- verticalScrollbarLayer
+// +- scroll corner (non-overlay only)
//
void VisualViewport::attachToLayerTree(GraphicsLayer* currentLayerTreeRoot, GraphicsLayerFactory* graphicsLayerFactory)
{
@@ -324,8 +322,11 @@ void VisualViewport::attachToLayerTree(GraphicsLayer* currentLayerTreeRoot, Grap
m_innerViewportContainerLayer->addChild(m_overscrollElasticityLayer.get());
m_overscrollElasticityLayer->addChild(m_pageScaleLayer.get());
m_pageScaleLayer->addChild(m_innerViewportScrollLayer.get());
- m_innerViewportContainerLayer->addChild(m_overlayScrollbarHorizontal.get());
- m_innerViewportContainerLayer->addChild(m_overlayScrollbarVertical.get());
+
+ if (visualViewportSuppliesScrollbars()) {
+ m_innerViewportContainerLayer->addChild(m_overlayScrollbarHorizontal.get());
+ m_innerViewportContainerLayer->addChild(m_overlayScrollbarVertical.get());
+ }
// Ensure this class is set as the scroll layer's ScrollableArea.
coordinator->scrollableAreaScrollLayerDidChange(this);
@@ -370,7 +371,6 @@ void VisualViewport::setupScrollbar(WebScrollbar::Orientation orientation)
// The compositor will control the scrollbar's visibility. Set to invisible by defualt
// so scrollbars don't show up in layout tests.
webScrollbarLayer->layer()->setOpacity(0);
-
scrollbarGraphicsLayer->setContentsToPlatformLayer(webScrollbarLayer->layer());
scrollbarGraphicsLayer->setDrawsContent(false);
}
@@ -409,6 +409,14 @@ void VisualViewport::registerLayersWithTreeView(WebLayerTreeView* layerTreeView)
m_pageScaleLayer->platformLayer(),
m_innerViewportScrollLayer->platformLayer(),
scrollLayer);
+
+ // TODO(aelias): Remove this call after this setting is deleted.
+ layerTreeView->setHidePinchScrollbarsNearMinScale(false);
+}
+
+bool VisualViewport::visualViewportSuppliesScrollbars() const
+{
+ return frameHost().settings().viewportMetaEnabled();
}
void VisualViewport::clearLayersForTreeView(WebLayerTreeView* layerTreeView) const

Powered by Google App Engine
This is Rietveld 408576698