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 2753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2764 navigation_state = NavigationState::CreateContentInitiated(); | 2764 navigation_state = NavigationState::CreateContentInitiated(); |
2765 } | 2765 } |
2766 return navigation_state; | 2766 return navigation_state; |
2767 } | 2767 } |
2768 | 2768 |
2769 void RenderViewImpl::ProcessViewLayoutFlags(const CommandLine& command_line) { | 2769 void RenderViewImpl::ProcessViewLayoutFlags(const CommandLine& command_line) { |
2770 bool enable_viewport = | 2770 bool enable_viewport = |
2771 command_line.HasSwitch(switches::kEnableViewport); | 2771 command_line.HasSwitch(switches::kEnableViewport); |
2772 bool enable_fixed_layout = | 2772 bool enable_fixed_layout = |
2773 command_line.HasSwitch(switches::kEnableFixedLayout); | 2773 command_line.HasSwitch(switches::kEnableFixedLayout); |
2774 bool enable_pinch = enable_viewport || | |
2775 command_line.HasSwitch(switches::kEnablePinch); | |
danakj
2012/05/24 22:40:18
Currently you would only need to do this when kEna
sadrul
2012/05/24 22:51:37
I think that involves moving applyDefaultDeviceSca
danakj
2012/05/24 22:55:38
Can't you use WebPreferences instead?
sadrul
2012/05/24 22:59:58
Wha. We totally can! Done. Thanks!
| |
2774 | 2776 |
2775 webview()->enableFixedLayoutMode(enable_fixed_layout || enable_viewport); | 2777 webview()->enableFixedLayoutMode(enable_fixed_layout || enable_viewport); |
2776 webview()->settings()->setFixedElementsLayoutRelativeToFrame(true); | 2778 webview()->settings()->setFixedElementsLayoutRelativeToFrame(true); |
2779 if (enable_pinch) | |
2780 webview()->setPageScaleFactorLimits(-1, -1); | |
2777 | 2781 |
2778 if (enable_viewport) { | 2782 if (enable_viewport) { |
2779 webview()->settings()->setViewportEnabled(true); | 2783 webview()->settings()->setViewportEnabled(true); |
2780 } else if (enable_fixed_layout) { | 2784 } else if (enable_fixed_layout) { |
2781 std::string str = | 2785 std::string str = |
2782 command_line.GetSwitchValueASCII(switches::kEnableFixedLayout); | 2786 command_line.GetSwitchValueASCII(switches::kEnableFixedLayout); |
2783 std::vector<std::string> tokens; | 2787 std::vector<std::string> tokens; |
2784 base::SplitString(str, ',', &tokens); | 2788 base::SplitString(str, ',', &tokens); |
2785 if (tokens.size() == 2) { | 2789 if (tokens.size() == 2) { |
2786 int width, height; | 2790 int width, height; |
(...skipping 2686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5473 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 5477 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
5474 return !!RenderThreadImpl::current()->compositor_thread(); | 5478 return !!RenderThreadImpl::current()->compositor_thread(); |
5475 } | 5479 } |
5476 | 5480 |
5477 void RenderViewImpl::OnJavaBridgeInit() { | 5481 void RenderViewImpl::OnJavaBridgeInit() { |
5478 DCHECK(!java_bridge_dispatcher_); | 5482 DCHECK(!java_bridge_dispatcher_); |
5479 #if defined(ENABLE_JAVA_BRIDGE) | 5483 #if defined(ENABLE_JAVA_BRIDGE) |
5480 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); | 5484 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); |
5481 #endif | 5485 #endif |
5482 } | 5486 } |
OLD | NEW |