diff options
author | wjmaclean@chromium.org <wjmaclean@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-10 15:20:38 +0000 |
---|---|---|
committer | wjmaclean@chromium.org <wjmaclean@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-10 15:20:38 +0000 |
commit | e4cd82eb189ce76bb72726ac159242f9881f713e (patch) | |
tree | abb40ecf52c64c7525ba252e504f8ed0820783aa | |
parent | 6fcaf608a02de4bc6e91c3f07c7d72a408f6d1df (diff) | |
download | chromium_src-e4cd82eb189ce76bb72726ac159242f9881f713e.zip chromium_src-e4cd82eb189ce76bb72726ac159242f9881f713e.tar.gz chromium_src-e4cd82eb189ce76bb72726ac159242f9881f713e.tar.bz2 |
Enable pinch & pinch-zoom scrollbars by default for CrOS.
BUG=none
Review URL: https://chromiumcodereview.appspot.com/12722002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193387 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | cc/base/switches.cc | 4 | ||||
-rw-r--r-- | cc/base/switches.h | 2 | ||||
-rw-r--r-- | chrome/app/generated_resources.grd | 6 | ||||
-rw-r--r-- | chrome/browser/about_flags.cc | 10 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/chrome_restart_request.cc | 2 | ||||
-rw-r--r-- | content/browser/renderer_host/render_process_host_impl.cc | 3 | ||||
-rw-r--r-- | content/public/common/content_switches.cc | 1 | ||||
-rw-r--r-- | content/public/common/content_switches.h | 1 | ||||
-rw-r--r-- | content/renderer/gpu/render_widget_compositor.cc | 5 | ||||
-rw-r--r-- | content/renderer/render_view_impl.cc | 8 |
10 files changed, 36 insertions, 6 deletions
diff --git a/cc/base/switches.cc b/cc/base/switches.cc index 36e20ab..5cedee9 100644 --- a/cc/base/switches.cc +++ b/cc/base/switches.cc @@ -80,6 +80,10 @@ const char kMaxTilesForInterestArea[] = "max-tiles-for-interest-area"; const char kMaxUnusedResourceMemoryUsagePercentage[] = "max-unused-resource-memory-usage-percentage"; +// Causes overlay scrollbars to appear when zoomed in ChromeOS/Windows. +const char kEnablePinchZoomScrollbars[] = "enable-pinch-zoom-scrollbars"; +const char kDisablePinchZoomScrollbars[] = "disable-pinch-zoom-scrollbars"; + // Causes the compositor to render to textures which are then sent to the parent // through the texture mailbox mechanism. // Requires --enable-compositor-frame-message. diff --git a/cc/base/switches.h b/cc/base/switches.h index 2fd91ee..a1c9658 100644 --- a/cc/base/switches.h +++ b/cc/base/switches.h @@ -39,6 +39,8 @@ CC_EXPORT extern const char kCompositeToMailbox[]; CC_EXPORT extern const char kMaxPrepaintTileDistance[]; CC_EXPORT extern const char kMaxTilesForInterestArea[]; CC_EXPORT extern const char kMaxUnusedResourceMemoryUsagePercentage[]; +CC_EXPORT extern const char kEnablePinchZoomScrollbars[]; +CC_EXPORT extern const char kDisablePinchZoomScrollbars[]; // Switches for both the renderer and ui compositors. CC_EXPORT extern const char kEnablePartialSwap[]; diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index ed55572..89cf8bd 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -6882,6 +6882,12 @@ Keep your key file in a safe place. You will need it to create new versions of y <message name="IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION" desc="Description of the flag to turn on experiental pinch to scale."> Enables experimental support for scale using pinch. </message> + <message name="IDS_FLAGS_PINCH_ZOOM_SCROLLBARS_NAME" desc="Name for the Pinch Zoom Scrollbars feature."> + Enable overlay pinch-zoom scrollbars. + </message> + <message name="IDS_FLAGS_PINCH_ZOOM_SCROLLBARS_DESCRIPTION" desc="Description for the Pinch Zoom Scrollbars feature."> + While zoomed in, overlay scrollbars will be visible during scrolling. + </message> <message name="IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_NAME" desc="Name of the flag to show only apps in app list search."> Enable apps only search for app list. </message> diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index f457911..153c04d 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc @@ -967,7 +967,15 @@ const Experiment kExperiments[] = { IDS_FLAGS_ENABLE_PINCH_SCALE_NAME, IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION, kOsLinux | kOsWin | kOsCrOS, - SINGLE_VALUE_TYPE(switches::kEnablePinch), + ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePinch, switches::kDisablePinch), + }, + { + "pinch-zoom-scrollbars", + IDS_FLAGS_PINCH_ZOOM_SCROLLBARS_NAME, + IDS_FLAGS_PINCH_ZOOM_SCROLLBARS_DESCRIPTION, + kOsCrOS, + ENABLE_DISABLE_VALUE_TYPE(cc::switches::kEnablePinchZoomScrollbars, + cc::switches::kDisablePinchZoomScrollbars) }, { "app-list-show-apps-only", diff --git a/chrome/browser/chromeos/login/chrome_restart_request.cc b/chrome/browser/chromeos/login/chrome_restart_request.cc index c6cc17f..11738cd 100644 --- a/chrome/browser/chromeos/login/chrome_restart_request.cc +++ b/chrome/browser/chromeos/login/chrome_restart_request.cc @@ -132,11 +132,13 @@ std::string DeriveCommandLine(const GURL& start_url, cc::switches::kDisableCheapnessEstimator, cc::switches::kDisableColorEstimator, cc::switches::kDisableImplSidePainting, + cc::switches::kDisablePinchZoomScrollbars, cc::switches::kDisableThreadedAnimation, cc::switches::kEnableCompositorFrameMessage, cc::switches::kEnableImplSidePainting, cc::switches::kEnablePartialSwap, cc::switches::kEnablePerTilePainting, + cc::switches::kEnablePinchZoomScrollbars, cc::switches::kEnablePredictionBenchmarking, cc::switches::kEnableRightAlignedScheduling, cc::switches::kEnableTopControlsPositionCalculation, diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index f81ad0c0..251d35e 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -845,6 +845,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( switches::kEnablePreparsedJsCaching, switches::kEnablePruneGpuCommandBuffers, switches::kEnablePinch, + switches::kDisablePinch, #if defined(OS_MACOSX) // Allow this to be set when invoking the browser and relayed along. switches::kEnableSandboxLogging, @@ -917,6 +918,8 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( cc::switches::kEnableImplSidePainting, cc::switches::kEnablePartialSwap, cc::switches::kEnablePerTilePainting, + cc::switches::kEnablePinchZoomScrollbars, + cc::switches::kDisablePinchZoomScrollbars, cc::switches::kEnablePredictionBenchmarking, cc::switches::kEnableRightAlignedScheduling, cc::switches::kEnableTopControlsPositionCalculation, diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc index afe8ea7..bc64bfe 100644 --- a/content/public/common/content_switches.cc +++ b/content/public/common/content_switches.cc @@ -337,6 +337,7 @@ const char kEnableMonitorProfile[] = "enable-monitor-profile"; // Enables compositor-accelerated touch-screen pinch gestures. const char kEnablePinch[] = "enable-pinch"; +const char kDisablePinch[] = "disable-pinch"; // Enable caching of pre-parsed JS script data. See http://crbug.com/32407. const char kEnablePreparsedJsCaching[] = "enable-preparsed-js-caching"; diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h index 1b05490..b4b7be6 100644 --- a/content/public/common/content_switches.h +++ b/content/public/common/content_switches.h @@ -116,6 +116,7 @@ CONTENT_EXPORT extern const char kUseFakeDeviceForMediaStream[]; extern const char kEnableMonitorProfile[]; extern const char kEnableUserMediaScreenCapturing[]; extern const char kEnablePinch[]; +extern const char kDisablePinch[]; extern const char kEnablePreparsedJsCaching[]; CONTENT_EXPORT extern const char kEnablePrivilegedWebGLExtensions[]; extern const char kEnablePruneGpuCommandBuffers[]; diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc index 6c6513db..e8e1220 100644 --- a/content/renderer/gpu/render_widget_compositor.cc +++ b/content/renderer/gpu/render_widget_compositor.cc @@ -182,6 +182,11 @@ scoped_ptr<RenderWidgetCompositor> RenderWidgetCompositor::Create( settings.show_overdraw_in_tracing = cmd->HasSwitch(cc::switches::kTraceOverdraw); +#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) + settings.use_pinch_zoom_scrollbars = + cmd->HasSwitch(cc::switches::kEnablePinchZoomScrollbars); +#endif + // These flags should be mirrored by UI versions in ui/compositor/. settings.initial_debug_state.show_debug_borders = cmd->HasSwitch(cc::switches::kShowCompositedLayerBorders); diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc index 554df4d..742f1ab 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc @@ -3330,11 +3330,9 @@ void RenderViewImpl::ProcessViewLayoutFlags(const CommandLine& command_line) { webview()->setFixedLayoutSize(WebSize(width, height)); } } - - if (command_line.HasSwitch(switches::kEnablePinch)) - webview()->setPageScaleFactorLimits(1, 4); - else - webview()->setPageScaleFactorLimits(1, 1); + float maxPageScaleFactor = + command_line.HasSwitch(switches::kEnablePinch) ? 4.f : 1.f ; + webview()->setPageScaleFactorLimits(1, maxPageScaleFactor); } void RenderViewImpl::didStartProvisionalLoad(WebFrame* frame) { |