diff options
author | wjmaclean@chromium.org <wjmaclean@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-27 18:16:43 +0000 |
---|---|---|
committer | wjmaclean@chromium.org <wjmaclean@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-27 18:16:43 +0000 |
commit | de0aaedf4bbced8a935201e2b2e7f48d3a2bf502 (patch) | |
tree | 51f8a43ec845497299db4bc91455df7363f2774e | |
parent | 53286292d6369b4a7afac8f5b27be8b0029d048e (diff) | |
download | chromium_src-de0aaedf4bbced8a935201e2b2e7f48d3a2bf502.zip chromium_src-de0aaedf4bbced8a935201e2b2e7f48d3a2bf502.tar.gz chromium_src-de0aaedf4bbced8a935201e2b2e7f48d3a2bf502.tar.bz2 |
Plumb pinch virtual viewport flag to CC.
This flag will protect the refactoring work for the pinch virtual viewport.
TBR=cevans@chromium.org
BUG=none
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/15567005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202453 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | cc/base/switches.cc | 3 | ||||
-rw-r--r-- | cc/base/switches.h | 1 | ||||
-rw-r--r-- | chrome/app/generated_resources.grd | 6 | ||||
-rw-r--r-- | chrome/browser/about_flags.cc | 7 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/chrome_restart_request.cc | 1 | ||||
-rw-r--r-- | content/browser/renderer_host/render_process_host_impl.cc | 1 | ||||
-rw-r--r-- | content/browser/web_contents/web_contents_impl.cc | 2 | ||||
-rw-r--r-- | content/public/common/common_param_traits_macros.h | 1 | ||||
-rw-r--r-- | content/renderer/gpu/render_widget_compositor.cc | 2 | ||||
-rw-r--r-- | webkit/glue/webpreferences.cc | 3 | ||||
-rw-r--r-- | webkit/glue/webpreferences.h | 1 |
11 files changed, 28 insertions, 0 deletions
diff --git a/cc/base/switches.cc b/cc/base/switches.cc index 9886ae8..57984af 100644 --- a/cc/base/switches.cc +++ b/cc/base/switches.cc @@ -81,6 +81,9 @@ const char kCompositeToMailbox[] = "composite-to-mailbox"; const char kStrictLayerPropertyChangeChecking[] = "strict-layer-property-change-checking"; +// Virtual viewport for fixed-position elements, scrollbars during pinch. +const char kEnablePinchVirtualViewport[] = "enable-pinch-virtual-viewport"; + const char kEnablePartialSwap[] = "enable-partial-swap"; // Disable partial swap which is needed for some OpenGL drivers / emulators. const char kUIDisablePartialSwap[] = "ui-disable-partial-swap"; diff --git a/cc/base/switches.h b/cc/base/switches.h index 240b002..32c3826 100644 --- a/cc/base/switches.h +++ b/cc/base/switches.h @@ -36,6 +36,7 @@ CC_EXPORT extern const char kLowResolutionContentsScaleFactor[]; CC_EXPORT extern const char kCompositeToMailbox[]; CC_EXPORT extern const char kMaxTilesForInterestArea[]; CC_EXPORT extern const char kMaxUnusedResourceMemoryUsagePercentage[]; +CC_EXPORT extern const char kEnablePinchVirtualViewport[]; CC_EXPORT extern const char kEnablePartialSwap[]; CC_EXPORT extern const char kStrictLayerPropertyChangeChecking[]; CC_EXPORT extern const char kUseMapImage[]; diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 226cea1..ba2f5e1 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -6966,6 +6966,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_ENABLE_PINCH_VIRTUAL_VIEWPORT_NAME" desc="Name of the flag to turn on experimental pinch virtual viewport."> + Enable pinch virtual viewport. + </message> + <message name="IDS_FLAGS_ENABLE_PINCH_VIRTUAL_VIEWPORT_DESCRIPTION" desc="Description of the flag to turn on experimental pinch virtual viewport."> + When zoomed in, fixed-position elements and scaled scrollbars attach to this viewport. + </message> <message name="IDS_FLAGS_NEW_DIALOG_STYLE_NAME" desc="Name of the flag to use the classic or new dialog style."> New Dialog Style. </message> diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 70b3a5d..fbb1e8d 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc @@ -1016,6 +1016,13 @@ const Experiment kExperiments[] = { ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePinch, switches::kDisablePinch), }, { + "enable-pinch-virtual-viewport", + IDS_FLAGS_ENABLE_PINCH_VIRTUAL_VIEWPORT_NAME, + IDS_FLAGS_ENABLE_PINCH_VIRTUAL_VIEWPORT_DESCRIPTION, + kOsLinux | kOsWin | kOsCrOS, + SINGLE_VALUE_TYPE(cc::switches::kEnablePinchVirtualViewport), + }, + { "forced-maximize-mode", IDS_FLAGS_FORCE_MAXIMIZE_MODE_NAME, IDS_FLAGS_FORCE_MAXIMIZE_MODE_DESCRIPTION, diff --git a/chrome/browser/chromeos/login/chrome_restart_request.cc b/chrome/browser/chromeos/login/chrome_restart_request.cc index ba3f98b..d2683c4 100644 --- a/chrome/browser/chromeos/login/chrome_restart_request.cc +++ b/chrome/browser/chromeos/login/chrome_restart_request.cc @@ -140,6 +140,7 @@ std::string DeriveCommandLine(const GURL& start_url, cc::switches::kEnableImplSidePainting, cc::switches::kEnablePartialSwap, cc::switches::kEnablePerTilePainting, + cc::switches::kEnablePinchVirtualViewport, cc::switches::kEnableRightAlignedScheduling, cc::switches::kEnableTopControlsPositionCalculation, cc::switches::kForceDirectLayerDrawing, diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index b08f4d0..e864f81 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -965,6 +965,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( cc::switches::kEnableImplSidePainting, cc::switches::kEnablePartialSwap, cc::switches::kEnablePerTilePainting, + cc::switches::kEnablePinchVirtualViewport, cc::switches::kEnableRightAlignedScheduling, cc::switches::kEnableTopControlsPositionCalculation, cc::switches::kForceDirectLayerDrawing, diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index eeba6d3..8a400cd 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc @@ -538,6 +538,8 @@ WebPreferences WebContentsImpl::GetWebkitPrefs(RenderViewHost* rvh, !command_line.HasSwitch(switches::kDisableThreadedHTMLParser); prefs.experimental_websocket_enabled = command_line.HasSwitch(switches::kEnableExperimentalWebSocket); + prefs.pinch_virtual_viewport_enabled = + command_line.HasSwitch(cc::switches::kEnablePinchVirtualViewport); #if defined(OS_ANDROID) prefs.user_gesture_required_for_media_playback = !command_line.HasSwitch( diff --git a/content/public/common/common_param_traits_macros.h b/content/public/common/common_param_traits_macros.h index 75c5d34..e15699e 100644 --- a/content/public/common/common_param_traits_macros.h +++ b/content/public/common/common_param_traits_macros.h @@ -137,6 +137,7 @@ IPC_STRUCT_TRAITS_BEGIN(WebPreferences) IPC_STRUCT_TRAITS_MEMBER(webaudio_enabled) IPC_STRUCT_TRAITS_MEMBER(experimental_webgl_enabled) IPC_STRUCT_TRAITS_MEMBER(experimental_websocket_enabled) + IPC_STRUCT_TRAITS_MEMBER(pinch_virtual_viewport_enabled) IPC_STRUCT_TRAITS_MEMBER(flash_3d_enabled) IPC_STRUCT_TRAITS_MEMBER(flash_stage3d_enabled) IPC_STRUCT_TRAITS_MEMBER(flash_stage3d_baseline_enabled) diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc index 7e4e21c..572ccfd 100644 --- a/content/renderer/gpu/render_widget_compositor.cc +++ b/content/renderer/gpu/render_widget_compositor.cc @@ -190,6 +190,8 @@ scoped_ptr<RenderWidgetCompositor> RenderWidgetCompositor::Create( cmd->HasSwitch(cc::switches::kBackgroundColorInsteadOfCheckerboard); settings.show_overdraw_in_tracing = cmd->HasSwitch(cc::switches::kTraceOverdraw); + settings.use_pinch_virtual_viewport = + cmd->HasSwitch(cc::switches::kEnablePinchVirtualViewport); // These flags should be mirrored by UI versions in ui/compositor/. settings.initial_debug_state.show_debug_borders = diff --git a/webkit/glue/webpreferences.cc b/webkit/glue/webpreferences.cc index 820c4b3..ab9f2f5 100644 --- a/webkit/glue/webpreferences.cc +++ b/webkit/glue/webpreferences.cc @@ -130,6 +130,7 @@ WebPreferences::WebPreferences() #endif spatial_navigation_enabled(false), experimental_websocket_enabled(false), + pinch_virtual_viewport_enabled(false), cookie_enabled(true) #if defined(OS_ANDROID) , @@ -480,6 +481,8 @@ void ApplyWebPreferences(const WebPreferences& prefs, WebView* web_view) { WebNetworkStateNotifier::setOnLine(prefs.is_online); settings->setExperimentalWebSocketEnabled( prefs.experimental_websocket_enabled); + settings->setPinchVirtualViewportEnabled( + prefs.pinch_virtual_viewport_enabled); } #define COMPILE_ASSERT_MATCHING_ENUMS(webkit_glue_name, webkit_name) \ diff --git a/webkit/glue/webpreferences.h b/webkit/glue/webpreferences.h index dcba537..6e71406 100644 --- a/webkit/glue/webpreferences.h +++ b/webkit/glue/webpreferences.h @@ -155,6 +155,7 @@ struct WEBKIT_GLUE_EXPORT WebPreferences { bool smart_insert_delete_enabled; bool spatial_navigation_enabled; bool experimental_websocket_enabled; + bool pinch_virtual_viewport_enabled; // This flags corresponds to a Page's Settings' setCookieEnabled state. It // only controls whether or not the "document.cookie" field is properly |