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

Unified Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 2531413002: Reset the default value of touch event flag back to "Auto". (Closed)
Patch Set: Keep firing dom events. Created 4 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
Index: content/browser/renderer_host/render_view_host_impl.cc
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
index 4e00e0974ed3cb8cdd9867e5cb097d6bcd76884d..da25e25dba061bf6d295ac506f2598c0685f23fc 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -442,12 +442,17 @@ WebPreferences RenderViewHostImpl::ComputeWebkitPrefs() {
prefs.use_solid_color_scrollbars = true;
#endif
- prefs.touch_event_api_enabled =
- !command_line.HasSwitch(switches::kTouchEvents) ||
- command_line.GetSwitchValueASCII(switches::kTouchEvents) !=
- switches::kTouchEventsDisabled;
prefs.device_supports_touch = ui::GetTouchScreensAvailability() ==
ui::TouchScreensAvailability::ENABLED;
+ const std::string touch_enabled_switch =
+ command_line.HasSwitch(switches::kTouchEvents)
+ ? command_line.GetSwitchValueASCII(switches::kTouchEvents)
+ : switches::kTouchEventsAuto;
+ prefs.touch_event_api_enabled =
+ (touch_enabled_switch == switches::kTouchEventsAuto)
+ ? prefs.device_supports_touch
+ : (touch_enabled_switch.empty() ||
+ touch_enabled_switch == switches::kTouchEventsEnabled);
std::tie(prefs.available_pointer_types, prefs.available_hover_types) =
ui::GetAvailablePointerAndHoverTypes();
prefs.primary_pointer_type =

Powered by Google App Engine
This is Rietveld 408576698