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

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: Created 4 years, 1 month 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 fc1f18772cea21eada1fe8ba4c1007a7653c45fb..6bc9f032c35671a423c698b70ea58962750f23eb 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -450,12 +450,15 @@ WebPreferences RenderViewHostImpl::ComputeWebkitPrefs() {
prefs.autoplay_experiment_mode = base::FieldTrialList::FindFullName(
"MediaElementGestureOverrideExperiment");
- 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;
+ prefs.touch_event_api_enabled =
+ (!command_line.HasSwitch(switches::kTouchEvents) ||
+ command_line.GetSwitchValueASCII(switches::kTouchEvents) ==
+ switches::kTouchEventsAuto)
+ ? prefs.device_supports_touch
+ : (command_line.GetSwitchValueASCII(switches::kTouchEvents) ==
+ 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