| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/frame/VisualViewport.h" | 5 #include "core/frame/VisualViewport.h" |
| 6 | 6 |
| 7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/frame/FrameHost.h" | 8 #include "core/frame/FrameHost.h" |
| 9 #include "core/frame/FrameView.h" | 9 #include "core/frame/FrameView.h" |
| 10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 WebLayer* getRootScrollLayer() | 155 WebLayer* getRootScrollLayer() |
| 156 { | 156 { |
| 157 PaintLayerCompositor* compositor = frame()->contentLayoutItem().composit
or(); | 157 PaintLayerCompositor* compositor = frame()->contentLayoutItem().composit
or(); |
| 158 DCHECK(compositor); | 158 DCHECK(compositor); |
| 159 DCHECK(compositor->scrollLayer()); | 159 DCHECK(compositor->scrollLayer()); |
| 160 | 160 |
| 161 WebLayer* webScrollLayer = compositor->scrollLayer()->platformLayer(); | 161 WebLayer* webScrollLayer = compositor->scrollLayer()->platformLayer(); |
| 162 return webScrollLayer; | 162 return webScrollLayer; |
| 163 } | 163 } |
| 164 | 164 |
| 165 WebViewImpl* webViewImpl() const { return m_helper.webViewImpl(); } | 165 WebViewImpl* webViewImpl() const { return m_helper.webView(); } |
| 166 LocalFrame* frame() const { return m_helper.webViewImpl()->mainFrameImpl()->
frame(); } | 166 LocalFrame* frame() const { return m_helper.webView()->mainFrameImpl()->fram
e(); } |
| 167 | 167 |
| 168 static void configureSettings(WebSettings* settings) | 168 static void configureSettings(WebSettings* settings) |
| 169 { | 169 { |
| 170 settings->setJavaScriptEnabled(true); | 170 settings->setJavaScriptEnabled(true); |
| 171 settings->setPreferCompositingToLCDTextEnabled(true); | 171 settings->setPreferCompositingToLCDTextEnabled(true); |
| 172 } | 172 } |
| 173 | 173 |
| 174 static void configureAndroidSettings(WebSettings* settings) | 174 static void configureAndroidSettings(WebSettings* settings) |
| 175 { | 175 { |
| 176 configureSettings(settings); | 176 configureSettings(settings); |
| (...skipping 1642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1819 webViewImpl()->handleInputEvent(pinchUpdate); | 1819 webViewImpl()->handleInputEvent(pinchUpdate); |
| 1820 | 1820 |
| 1821 VisualViewport& visualViewport = webViewImpl()->page()->frameHost().visualVi
ewport(); | 1821 VisualViewport& visualViewport = webViewImpl()->page()->frameHost().visualVi
ewport(); |
| 1822 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView(); | 1822 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView(); |
| 1823 | 1823 |
| 1824 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 50), visualViewport.location()); | 1824 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 50), visualViewport.location()); |
| 1825 EXPECT_FLOAT_POINT_EQ(FloatPoint(0, 0), frameView.scrollPositionDouble()); | 1825 EXPECT_FLOAT_POINT_EQ(FloatPoint(0, 0), frameView.scrollPositionDouble()); |
| 1826 } | 1826 } |
| 1827 | 1827 |
| 1828 } // namespace | 1828 } // namespace |
| OLD | NEW |