Chromium Code Reviews| Index: Source/core/frame/PinchViewport.cpp |
| diff --git a/Source/core/frame/PinchViewport.cpp b/Source/core/frame/PinchViewport.cpp |
| index 505a8895eadcbeeb9a3b05a04fe97c3095d78f88..4fc171b365f0e7e56395c440c100a0357a81a6a4 100644 |
| --- a/Source/core/frame/PinchViewport.cpp |
| +++ b/Source/core/frame/PinchViewport.cpp |
| @@ -91,6 +91,12 @@ void PinchViewport::setSize(const IntSize& size) |
| setupScrollbar(WebScrollbar::Vertical); |
| } |
| +void PinchViewport::reset() |
| +{ |
| + setLocation(FloatPoint(0, 0)); |
|
abarth-chromium
2014/05/09 14:11:23
setLocation(FloatPoint());
bokan
2014/05/09 14:32:57
Done.
|
| + setScale(1); |
| +} |
| + |
| void PinchViewport::mainFrameDidChangeSize() |
| { |
| // In unit tests we may not have initialized the layer tree. |
| @@ -120,12 +126,19 @@ void PinchViewport::setLocation(const FloatPoint& newLocation) |
| ScrollingCoordinator* coordinator = m_frameHost.page().scrollingCoordinator(); |
| ASSERT(coordinator); |
| coordinator->scrollableAreaScrollLayerDidChange(this); |
| + |
| + mainFrame()->loader().saveScrollState(); |
| } |
| void PinchViewport::setScale(float scale) |
| { |
| + if (scale == m_scale) |
| + return; |
| + |
| m_scale = scale; |
| + mainFrame()->loader().saveScrollState(); |
| + |
| // Old-style pinch sets scale here but we shouldn't call into the |
| // clamping code below. |
| if (!m_innerViewportScrollLayer) |
| @@ -133,6 +146,9 @@ void PinchViewport::setScale(float scale) |
| // Ensure we clamp so we remain within the bounds. |
| setLocation(visibleRect().location()); |
| + |
| + // TODO: We should probably be calling scaleDidChange type functions here. |
| + // see Page::setPageScaleFactor. |
| } |
| // Modifies the top of the graphics layer tree to add layers needed to support |