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

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: Typo 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..c3cfae2e0e097bab57443036389f3feb54b928c8 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -450,12 +450,17 @@ 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;
+ 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