| 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "core/frame/PinchViewport.h" | 7 #include "core/frame/PinchViewport.h" |
| 8 | 8 |
| 9 #include "core/frame/FrameHost.h" | 9 #include "core/frame/FrameHost.h" |
| 10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 return webScrollLayer; | 137 return webScrollLayer; |
| 138 } | 138 } |
| 139 | 139 |
| 140 WebViewImpl* webViewImpl() const { return m_helper.webViewImpl(); } | 140 WebViewImpl* webViewImpl() const { return m_helper.webViewImpl(); } |
| 141 LocalFrame* frame() const { return m_helper.webViewImpl()->mainFrameImpl()->
frame(); } | 141 LocalFrame* frame() const { return m_helper.webViewImpl()->mainFrameImpl()->
frame(); } |
| 142 | 142 |
| 143 static void configureSettings(WebSettings* settings) | 143 static void configureSettings(WebSettings* settings) |
| 144 { | 144 { |
| 145 settings->setJavaScriptEnabled(true); | 145 settings->setJavaScriptEnabled(true); |
| 146 settings->setAcceleratedCompositingEnabled(true); | 146 settings->setAcceleratedCompositingEnabled(true); |
| 147 settings->setAcceleratedCompositingForFixedPositionEnabled(true); | 147 settings->setPreferCompositingToLCDTextEnabled(true); |
| 148 settings->setAcceleratedCompositingForOverflowScrollEnabled(true); | 148 settings->setAcceleratedCompositingForOverflowScrollEnabled(true); |
| 149 settings->setCompositedScrollingForFramesEnabled(true); | 149 settings->setCompositedScrollingForFramesEnabled(true); |
| 150 settings->setPinchVirtualViewportEnabled(true); | 150 settings->setPinchVirtualViewportEnabled(true); |
| 151 } | 151 } |
| 152 | 152 |
| 153 static void configureAndroidSettings(WebSettings* settings) | 153 static void configureAndroidSettings(WebSettings* settings) |
| 154 { | 154 { |
| 155 configureSettings(settings); | 155 configureSettings(settings); |
| 156 settings->setViewportEnabled(true); | 156 settings->setViewportEnabled(true); |
| 157 settings->setViewportMetaEnabled(true); | 157 settings->setViewportMetaEnabled(true); |
| (...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 796 pinchViewport.scrollIntoView(FloatRect(50, 75, 50, 75)); | 796 pinchViewport.scrollIntoView(FloatRect(50, 75, 50, 75)); |
| 797 EXPECT_POINT_EQ(IntPoint(50, 75), frame()->view()->scrollPosition()); | 797 EXPECT_POINT_EQ(IntPoint(50, 75), frame()->view()->scrollPosition()); |
| 798 EXPECT_FLOAT_POINT_EQ(FloatPoint(), pinchViewport.visibleRect().location()); | 798 EXPECT_FLOAT_POINT_EQ(FloatPoint(), pinchViewport.visibleRect().location()); |
| 799 | 799 |
| 800 pinchViewport.scrollIntoView(FloatRect(190, 290, 10, 10)); | 800 pinchViewport.scrollIntoView(FloatRect(190, 290, 10, 10)); |
| 801 EXPECT_POINT_EQ(IntPoint(100, 150), frame()->view()->scrollPosition()); | 801 EXPECT_POINT_EQ(IntPoint(100, 150), frame()->view()->scrollPosition()); |
| 802 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 75), pinchViewport.visibleRect().locati
on()); | 802 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 75), pinchViewport.visibleRect().locati
on()); |
| 803 } | 803 } |
| 804 | 804 |
| 805 } // namespace | 805 } // namespace |
| OLD | NEW |