Skip to content

Commit c4e3ca9

Browse files
committed
Revert "Disable legacy touch event APIs on desktop"
This CL reverts commit a6a203c. (crrev.com/c/729220) We'll leave these feature detection API disabled in canary and dev channel to gather some feedback. But don't let it in Beta and Stable channel because it breaks embed map. This revert will merge into into M68, but not landed in master branch Bug: 804890 Change-Id: Ib017006081baf12b69fe137ba9aeae915b5274a3 Reviewed-on: https://chromium-review.googlesource.com/1081874 Reviewed-by: Ella Ge <[email protected]> Cr-Commit-Position: refs/branch-heads/3440@{#85} Cr-Branched-From: 010ddcf-refs/heads/master@{#561733}
1 parent c1d1d4e commit c4e3ca9

File tree

4 files changed

+5
-21
lines changed

4 files changed

+5
-21
lines changed

chrome/browser/about_flags.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,13 +190,13 @@ const unsigned kOsAura = kOsWin | kOsLinux | kOsCrOS;
190190
#endif // USE_AURA
191191

192192
const FeatureEntry::Choice kTouchEventFeatureDetectionChoices[] = {
193-
{flags_ui::kGenericExperimentChoiceDisabled, "", ""},
193+
{flags_ui::kGenericExperimentChoiceAutomatic, "", ""},
194194
{flags_ui::kGenericExperimentChoiceEnabled,
195195
switches::kTouchEventFeatureDetection,
196196
switches::kTouchEventFeatureDetectionEnabled},
197-
{flags_ui::kGenericExperimentChoiceAutomatic,
197+
{flags_ui::kGenericExperimentChoiceDisabled,
198198
switches::kTouchEventFeatureDetection,
199-
switches::kTouchEventFeatureDetectionAuto}};
199+
switches::kTouchEventFeatureDetectionDisabled}};
200200

201201
#if defined(USE_AURA)
202202
const FeatureEntry::Choice kOverscrollHistoryNavigationChoices[] = {

chrome/browser/flag_descriptions.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1687,7 +1687,7 @@ const char kTouchEventsName[] = "Touch Events API";
16871687
const char kTouchEventsDescription[] =
16881688
"Force Touch Events API feature detection to always be enabled or "
16891689
"disabled, or to be enabled when a touchscreen is detected on startup "
1690-
"(Automatic).";
1690+
"(Automatic, the default).";
16911691

16921692
const char kTouchSelectionStrategyName[] = "Touch text selection strategy";
16931693
const char kTouchSelectionStrategyDescription[] =

chrome/browser/prefs/chrome_pref_service_unittest.cc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
#include "base/command_line.h"
66
#include "base/strings/utf_string_conversions.h"
7-
#include "build/build_config.h"
87
#include "chrome/browser/prefs/chrome_command_line_pref_store.h"
98
#include "chrome/common/chrome_switches.h"
109
#include "chrome/common/pref_names.h"
@@ -99,11 +98,4 @@ TEST_F(ChromePrefServiceWebKitPrefs, PrefsCopied) {
9998
EXPECT_EQ(base::ASCIIToUTF16(kDefaultFont),
10099
webkit_prefs.standard_font_family_map[prefs::kWebKitCommonScript]);
101100
EXPECT_TRUE(webkit_prefs.javascript_enabled);
102-
103-
#if defined(OS_ANDROID)
104-
// Touch event enabled only on Android.
105-
EXPECT_TRUE(webkit_prefs.touch_event_feature_detection_enabled);
106-
#else
107-
EXPECT_FALSE(webkit_prefs.touch_event_feature_detection_enabled);
108-
#endif
109101
}

content/browser/renderer_host/render_view_host_impl.cc

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -460,26 +460,18 @@ WebPreferences RenderViewHostImpl::ComputeWebkitPrefs() {
460460
NOTREACHED();
461461
}
462462

463-
// On Android, Touch event feature detection is enabled by default,
464-
// Otherwise default is disabled.
465-
std::string touch_enabled_default_switch =
466-
switches::kTouchEventFeatureDetectionDisabled;
467-
#if defined(OS_ANDROID)
468-
touch_enabled_default_switch = switches::kTouchEventFeatureDetectionEnabled;
469-
#endif // defined(OS_ANDROID)
470463
const std::string touch_enabled_switch =
471464
command_line.HasSwitch(switches::kTouchEventFeatureDetection)
472465
? command_line.GetSwitchValueASCII(
473466
switches::kTouchEventFeatureDetection)
474-
: touch_enabled_default_switch;
467+
: switches::kTouchEventFeatureDetectionAuto;
475468
prefs.touch_event_feature_detection_enabled =
476469
(touch_enabled_switch == switches::kTouchEventFeatureDetectionAuto)
477470
? (ui::GetTouchScreensAvailability() ==
478471
ui::TouchScreensAvailability::ENABLED)
479472
: (touch_enabled_switch.empty() ||
480473
touch_enabled_switch ==
481474
switches::kTouchEventFeatureDetectionEnabled);
482-
483475
std::tie(prefs.available_pointer_types, prefs.available_hover_types) =
484476
ui::GetAvailablePointerAndHoverTypes();
485477
prefs.primary_pointer_type =

0 commit comments

Comments
 (0)