summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkevers@chromium.org <kevers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-26 22:24:40 +0000
committerkevers@chromium.org <kevers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-26 22:24:40 +0000
commitb9c96ff2a94781a7c951718314335bf432278253 (patch)
treeddc4575abd2fdc69bdadd1923144baf9353e0c8e
parent4950d7075af64b6bd04131b0d20b6a32837d8fb4 (diff)
downloadchromium_src-b9c96ff2a94781a7c951718314335bf432278253.zip
chromium_src-b9c96ff2a94781a7c951718314335bf432278253.tar.gz
chromium_src-b9c96ff2a94781a7c951718314335bf432278253.tar.bz2
Add flag for disabling touch adjustment.
BUG=158759 Review URL: https://chromiumcodereview.appspot.com/11418037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169501 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/app/generated_resources.grd6
-rw-r--r--chrome/browser/about_flags.cc7
-rw-r--r--content/browser/renderer_host/render_process_host_impl.cc1
-rw-r--r--content/browser/web_contents/web_contents_impl.cc3
-rw-r--r--content/common/view_messages.h1
-rw-r--r--ui/base/ui_base_switches.cc3
-rw-r--r--ui/base/ui_base_switches.h1
-rw-r--r--webkit/glue/webpreferences.cc2
-rw-r--r--webkit/glue/webpreferences.h1
9 files changed, 25 insertions, 0 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index ae4d71c..c33a2b1 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -6098,6 +6098,12 @@ Keep your key file in a safe place. You will need it to create new versions of y
<message name="IDS_TOUCH_EVENTS_DESCRIPTION" desc="Description of the touch-events flag.">
Enables experimental support for touch screens.
</message>
+ <message name="IDS_DISABLE_TOUCH_ADJUSTMENT_NAME" desc="Title of the disable touch adjustment flag.">
+ Disable touch adjustment.
+ </message>
+ <message name="IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION" desc="Description of the disable touch adjustment flag.">
+ Disables touch adjustment support. Touch adjustment is the process of refining the position of a touch gesture in order to compensate for touches having poor resolution compared to a mouse.
+ </message>
<message name="IDS_ENABLE_TAB_CAPTURE_NAME" desc="Title of the enable tab capture flag." >
Enable Tab Capture API
</message>
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index ac8ceac..d900367 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -783,6 +783,13 @@ const Experiment kExperiments[] = {
SINGLE_VALUE_TYPE(gfx::switches::kEnableWebkitTextSubpixelPositioning)
},
{
+ "disable-touch-adjustment",
+ IDS_DISABLE_TOUCH_ADJUSTMENT_NAME,
+ IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION,
+ kOsWin | kOsLinux | kOsCrOS,
+ SINGLE_VALUE_TYPE(switches::kDisableTouchAdjustment)
+ },
+ {
"enable-tab-capture",
IDS_ENABLE_TAB_CAPTURE_NAME,
IDS_ENABLE_TAB_CAPTURE_DESCRIPTION,
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 695490d..a32a14f 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -822,6 +822,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
switches::kEnableStatsTable,
switches::kEnableThreadedCompositing,
switches::kDisableThreadedCompositing,
+ switches::kDisableTouchAdjustment,
switches::kEnableViewport,
switches::kForceDeviceScaleFactor,
switches::kFullMemoryCrashReport,
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 73260d3..7872c6a 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -561,6 +561,9 @@ WebPreferences WebContentsImpl::GetWebkitPrefs(RenderViewHost* rvh,
prefs.device_supports_mouse = false;
#endif
+ prefs.touch_adjustment_enabled =
+ !command_line.HasSwitch(switches::kDisableTouchAdjustment);
+
#if defined(OS_MACOSX)
bool default_enable_scroll_animator = true;
#else
diff --git a/content/common/view_messages.h b/content/common/view_messages.h
index 4630c09..606ab61 100644
--- a/content/common/view_messages.h
+++ b/content/common/view_messages.h
@@ -222,6 +222,7 @@ IPC_STRUCT_TRAITS_BEGIN(webkit_glue::WebPreferences)
IPC_STRUCT_TRAITS_MEMBER(touch_enabled)
IPC_STRUCT_TRAITS_MEMBER(device_supports_touch)
IPC_STRUCT_TRAITS_MEMBER(device_supports_mouse)
+ IPC_STRUCT_TRAITS_MEMBER(touch_adjustment_enabled)
IPC_STRUCT_TRAITS_MEMBER(default_tile_width)
IPC_STRUCT_TRAITS_MEMBER(default_tile_height)
IPC_STRUCT_TRAITS_MEMBER(max_untiled_layer_width)
diff --git a/ui/base/ui_base_switches.cc b/ui/base/ui_base_switches.cc
index eb61a2c..bddd721 100644
--- a/ui/base/ui_base_switches.cc
+++ b/ui/base/ui_base_switches.cc
@@ -9,6 +9,9 @@ namespace switches {
// Enable support for bezel touch.
const char kEnableBezelTouch[] = "enable-bezel-touch";
+// Disable touch adjustment.
+const char kDisableTouchAdjustment[] = "disable-touch-adjustment";
+
// Enables the Views textfield on Windows.
const char kEnableViewsTextfield[] = "enable-views-textfield";
diff --git a/ui/base/ui_base_switches.h b/ui/base/ui_base_switches.h
index d3096e39..352de96 100644
--- a/ui/base/ui_base_switches.h
+++ b/ui/base/ui_base_switches.h
@@ -13,6 +13,7 @@
namespace switches {
UI_EXPORT extern const char kEnableBezelTouch[];
+UI_EXPORT extern const char kDisableTouchAdjustment[];
UI_EXPORT extern const char kEnableViewsTextfield[];
UI_EXPORT extern const char kForceDeviceScaleFactor[];
UI_EXPORT extern const char kHighlightMissingScaledResources[];
diff --git a/webkit/glue/webpreferences.cc b/webkit/glue/webpreferences.cc
index 54d4111..f795248 100644
--- a/webkit/glue/webpreferences.cc
+++ b/webkit/glue/webpreferences.cc
@@ -114,6 +114,7 @@ WebPreferences::WebPreferences()
touch_enabled(false),
device_supports_touch(false),
device_supports_mouse(true),
+ touch_adjustment_enabled(true),
default_tile_width(256),
default_tile_height(256),
max_untiled_layer_width(512),
@@ -430,6 +431,7 @@ void WebPreferences::Apply(WebView* web_view) const {
WebRuntimeFeatures::enableTouch(touch_enabled);
settings->setDeviceSupportsTouch(device_supports_touch);
settings->setDeviceSupportsMouse(device_supports_mouse);
+ settings->setEnableTouchAdjustment(touch_adjustment_enabled);
settings->setDefaultTileSize(
WebSize(default_tile_width, default_tile_height));
diff --git a/webkit/glue/webpreferences.h b/webkit/glue/webpreferences.h
index d13462e..0a07a5a 100644
--- a/webkit/glue/webpreferences.h
+++ b/webkit/glue/webpreferences.h
@@ -132,6 +132,7 @@ struct WEBKIT_GLUE_EXPORT WebPreferences {
bool touch_enabled;
bool device_supports_touch;
bool device_supports_mouse;
+ bool touch_adjustment_enabled;
int default_tile_width;
int default_tile_height;
int max_untiled_layer_width;