Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / Source / web / ResizeViewportAnchor.cpp
blob94e7c862fc5a8cb51f9b189972d4ac4d52e6505c
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "config.h"
6 #include "web/ResizeViewportAnchor.h"
8 #include "core/frame/FrameView.h"
9 #include "core/frame/VisualViewport.h"
10 #include "platform/geometry/DoubleRect.h"
11 #include "platform/geometry/DoubleSize.h"
12 #include "platform/geometry/FloatSize.h"
14 namespace blink {
16 ResizeViewportAnchor::ResizeViewportAnchor(FrameView& rootFrameView, VisualViewport& visualViewport)
17 : ViewportAnchor(rootFrameView, visualViewport)
18 , m_visualViewportInDocument(rootFrameView.scrollableArea()->visibleContentRectDouble().location())
22 ResizeViewportAnchor::~ResizeViewportAnchor()
24 m_rootFrameView->scrollableArea()->setScrollPosition(m_visualViewportInDocument, ProgrammaticScroll);
27 } // namespace blink