Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(336)

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 10454019: Unset the page-scale-factor limits if enable-pinch flag is turned on. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: webkit_preferences_.apply_default_device_scale_factor_in_compositor Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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);
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 webkit_preferences_.apply_default_device_scale_factor_in_compositor)
2781 webview()->setPageScaleFactorLimits(-1, -1);
sadrul 2012/05/25 00:34:08 Perhaps there could be removePageScaleFactorLimits
danakj 2012/05/25 04:17:57 I do like the idea of WebViewImpl::setDefaultPageS
2777 2782
2778 if (enable_viewport) { 2783 if (enable_viewport) {
2779 webview()->settings()->setViewportEnabled(true); 2784 webview()->settings()->setViewportEnabled(true);
2780 } else if (enable_fixed_layout) { 2785 } else if (enable_fixed_layout) {
2781 std::string str = 2786 std::string str =
2782 command_line.GetSwitchValueASCII(switches::kEnableFixedLayout); 2787 command_line.GetSwitchValueASCII(switches::kEnableFixedLayout);
2783 std::vector<std::string> tokens; 2788 std::vector<std::string> tokens;
2784 base::SplitString(str, ',', &tokens); 2789 base::SplitString(str, ',', &tokens);
2785 if (tokens.size() == 2) { 2790 if (tokens.size() == 2) {
2786 int width, height; 2791 int width, height;
(...skipping 2686 matching lines...) Expand 10 before | Expand all | Expand 10 after
5473 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { 5478 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const {
5474 return !!RenderThreadImpl::current()->compositor_thread(); 5479 return !!RenderThreadImpl::current()->compositor_thread();
5475 } 5480 }
5476 5481
5477 void RenderViewImpl::OnJavaBridgeInit() { 5482 void RenderViewImpl::OnJavaBridgeInit() {
5478 DCHECK(!java_bridge_dispatcher_); 5483 DCHECK(!java_bridge_dispatcher_);
5479 #if defined(ENABLE_JAVA_BRIDGE) 5484 #if defined(ENABLE_JAVA_BRIDGE)
5480 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); 5485 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this);
5481 #endif 5486 #endif
5482 } 5487 }
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698