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

Unified Diff: content/renderer/render_view_impl.cc

Issue 11348353: Simplify pinch flags. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add early out if not compositing. Created 8 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/common/content_switches.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index bf789db64077005ed1540d96a5ae1d4b1f06f1f8..f8edbcf585106f1fa835a364e448e0d2fee74327 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -3175,25 +3175,19 @@ void RenderViewImpl::ProcessViewLayoutFlags(const CommandLine& command_line) {
void RenderViewImpl::ProcessAcceleratedPinchZoomFlags(
const CommandLine& command_line) {
- bool enable_viewport =
- command_line.HasSwitch(switches::kEnableViewport);
- bool enable_pinch = enable_viewport ||
- command_line.HasSwitch(switches::kEnablePinch);
- bool enable_pinch_in_compositor =
- command_line.HasSwitch(cc::switches::kEnablePinchInCompositor);
-
- if (!enable_pinch &&
- webview()->isAcceleratedCompositingActive() &&
- webkit_preferences_.apply_default_device_scale_factor_in_compositor &&
- device_scale_factor_ != 1) {
- // Page scaling is disabled by default when applying a scale factor in the
- // compositor since they are currently incompatible.
- webview()->setPageScaleFactorLimits(1, 1);
- }
+ if (!webview()->isAcceleratedCompositingActive())
+ return;
- if (enable_pinch_in_compositor &&
- webview()->isAcceleratedCompositingActive())
+ bool enable_viewport = command_line.HasSwitch(switches::kEnableViewport);
+ bool enable_pinch = command_line.HasSwitch(switches::kEnablePinch);
+
+ if (enable_viewport)
+ return;
+
+ if (enable_pinch)
webview()->setPageScaleFactorLimits(1, 4);
+ else
+ webview()->setPageScaleFactorLimits(1, 1);
}
void RenderViewImpl::didStartProvisionalLoad(WebFrame* frame) {
« no previous file with comments | « content/public/common/content_switches.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698