| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "core/frame/VisualViewport.h" | 31 #include "core/frame/VisualViewport.h" |
| 32 | 32 |
| 33 #include "core/dom/DOMNodeIds.h" | 33 #include "core/dom/DOMNodeIds.h" |
| 34 #include "core/dom/TaskRunnerHelper.h" |
| 34 #include "core/frame/FrameHost.h" | 35 #include "core/frame/FrameHost.h" |
| 35 #include "core/frame/FrameView.h" | 36 #include "core/frame/FrameView.h" |
| 36 #include "core/frame/LocalFrame.h" | 37 #include "core/frame/LocalFrame.h" |
| 37 #include "core/frame/PageScaleConstraints.h" | 38 #include "core/frame/PageScaleConstraints.h" |
| 38 #include "core/frame/PageScaleConstraintsSet.h" | 39 #include "core/frame/PageScaleConstraintsSet.h" |
| 39 #include "core/frame/RootFrameViewport.h" | 40 #include "core/frame/RootFrameViewport.h" |
| 40 #include "core/frame/Settings.h" | 41 #include "core/frame/Settings.h" |
| 41 #include "core/inspector/InspectorInstrumentation.h" | 42 #include "core/inspector/InspectorInstrumentation.h" |
| 42 #include "core/layout/TextAutosizer.h" | 43 #include "core/layout/TextAutosizer.h" |
| 43 #include "core/layout/compositing/PaintLayerCompositor.h" | 44 #include "core/layout/compositing/PaintLayerCompositor.h" |
| (...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 if (scrollbarInclusion == ExcludeScrollbars) { | 623 if (scrollbarInclusion == ExcludeScrollbars) { |
| 623 RootFrameViewport* rootFrameViewport = | 624 RootFrameViewport* rootFrameViewport = |
| 624 mainFrame()->view()->getRootFrameViewport(); | 625 mainFrame()->view()->getRootFrameViewport(); |
| 625 DCHECK(rootFrameViewport); | 626 DCHECK(rootFrameViewport); |
| 626 rect.contract(rootFrameViewport->verticalScrollbarWidth() / m_scale, | 627 rect.contract(rootFrameViewport->verticalScrollbarWidth() / m_scale, |
| 627 rootFrameViewport->horizontalScrollbarHeight() / m_scale); | 628 rootFrameViewport->horizontalScrollbarHeight() / m_scale); |
| 628 } | 629 } |
| 629 return rect; | 630 return rect; |
| 630 } | 631 } |
| 631 | 632 |
| 633 RefPtr<WebTaskRunner> VisualViewport::getTimerTaskRunner() const { |
| 634 return TaskRunnerHelper::get(TaskType::UnspecedTimer, mainFrame()); |
| 635 } |
| 636 |
| 632 void VisualViewport::updateScrollOffset(const ScrollOffset& position, | 637 void VisualViewport::updateScrollOffset(const ScrollOffset& position, |
| 633 ScrollType scrollType) { | 638 ScrollType scrollType) { |
| 634 if (didSetScaleOrLocation(m_scale, FloatPoint(position)) && | 639 if (didSetScaleOrLocation(m_scale, FloatPoint(position)) && |
| 635 scrollType != AnchoringScroll) | 640 scrollType != AnchoringScroll) |
| 636 notifyRootFrameViewport(); | 641 notifyRootFrameViewport(); |
| 637 } | 642 } |
| 638 | 643 |
| 639 GraphicsLayer* VisualViewport::layerForContainer() const { | 644 GraphicsLayer* VisualViewport::layerForContainer() const { |
| 640 return m_innerViewportContainerLayer.get(); | 645 return m_innerViewportContainerLayer.get(); |
| 641 } | 646 } |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 841 } else if (graphicsLayer == m_rootTransformLayer.get()) { | 846 } else if (graphicsLayer == m_rootTransformLayer.get()) { |
| 842 name = "Root Transform Layer"; | 847 name = "Root Transform Layer"; |
| 843 } else { | 848 } else { |
| 844 ASSERT_NOT_REACHED(); | 849 ASSERT_NOT_REACHED(); |
| 845 } | 850 } |
| 846 | 851 |
| 847 return name; | 852 return name; |
| 848 } | 853 } |
| 849 | 854 |
| 850 } // namespace blink | 855 } // namespace blink |
| OLD | NEW |