OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 2816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2827 navigation_state = NavigationState::CreateContentInitiated(); | 2827 navigation_state = NavigationState::CreateContentInitiated(); |
2828 } | 2828 } |
2829 return navigation_state; | 2829 return navigation_state; |
2830 } | 2830 } |
2831 | 2831 |
2832 void RenderViewImpl::ProcessViewLayoutFlags(const CommandLine& command_line) { | 2832 void RenderViewImpl::ProcessViewLayoutFlags(const CommandLine& command_line) { |
2833 bool enable_viewport = | 2833 bool enable_viewport = |
2834 command_line.HasSwitch(switches::kEnableViewport); | 2834 command_line.HasSwitch(switches::kEnableViewport); |
2835 bool enable_fixed_layout = | 2835 bool enable_fixed_layout = |
2836 command_line.HasSwitch(switches::kEnableFixedLayout); | 2836 command_line.HasSwitch(switches::kEnableFixedLayout); |
| 2837 bool enable_pinch = enable_viewport || |
| 2838 command_line.HasSwitch(switches::kEnablePinch); |
2837 | 2839 |
2838 webview()->enableFixedLayoutMode(enable_fixed_layout || enable_viewport); | 2840 webview()->enableFixedLayoutMode(enable_fixed_layout || enable_viewport); |
2839 webview()->settings()->setFixedElementsLayoutRelativeToFrame(true); | 2841 webview()->settings()->setFixedElementsLayoutRelativeToFrame(true); |
| 2842 if (!enable_pinch && |
| 2843 webkit_preferences_.apply_default_device_scale_factor_in_compositor && |
| 2844 webkit_preferences_.default_device_scale_factor != 1) { |
| 2845 // Page scaling is disabled by default when applying a scale factor in the |
| 2846 // compositor since they are currently incompatible. |
| 2847 webview()->setPageScaleFactorLimits(1, 1); |
| 2848 } |
2840 | 2849 |
2841 if (enable_viewport) { | 2850 if (enable_viewport) { |
2842 webview()->settings()->setViewportEnabled(true); | 2851 webview()->settings()->setViewportEnabled(true); |
2843 } else if (enable_fixed_layout) { | 2852 } else if (enable_fixed_layout) { |
2844 std::string str = | 2853 std::string str = |
2845 command_line.GetSwitchValueASCII(switches::kEnableFixedLayout); | 2854 command_line.GetSwitchValueASCII(switches::kEnableFixedLayout); |
2846 std::vector<std::string> tokens; | 2855 std::vector<std::string> tokens; |
2847 base::SplitString(str, ',', &tokens); | 2856 base::SplitString(str, ',', &tokens); |
2848 if (tokens.size() == 2) { | 2857 if (tokens.size() == 2) { |
2849 int width, height; | 2858 int width, height; |
(...skipping 2744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5594 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 5603 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
5595 return !!RenderThreadImpl::current()->compositor_thread(); | 5604 return !!RenderThreadImpl::current()->compositor_thread(); |
5596 } | 5605 } |
5597 | 5606 |
5598 void RenderViewImpl::OnJavaBridgeInit() { | 5607 void RenderViewImpl::OnJavaBridgeInit() { |
5599 DCHECK(!java_bridge_dispatcher_); | 5608 DCHECK(!java_bridge_dispatcher_); |
5600 #if defined(ENABLE_JAVA_BRIDGE) | 5609 #if defined(ENABLE_JAVA_BRIDGE) |
5601 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); | 5610 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); |
5602 #endif | 5611 #endif |
5603 } | 5612 } |
OLD | NEW |