Skip to content

Commit

Permalink
Remove Blink.Input.GestureScrollBeginAsCursorControl
Browse files Browse the repository at this point in the history
Fixed: 1195887
Change-Id: I18affee7493c2046a1cdff6805b8ef1eba4adef6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3553500
Reviewed-by: Robert Flack <flackr@chromium.org>
Reviewed-by: Ian Clelland <iclelland@chromium.org>
Commit-Queue: Shimi Zhang <ctzsm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#988206}
  • Loading branch information
Shimi Zhang authored and Chromium LUCI CQ committed Apr 2, 2022
1 parent dc8a9d3 commit 740afe1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 24 deletions.
21 changes: 0 additions & 21 deletions content/browser/renderer_host/input/touch_action_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "content/browser/renderer_host/input/synthetic_gesture.h"
Expand Down Expand Up @@ -838,7 +837,6 @@ IN_PROC_BROWSER_TEST_F(TouchActionBrowserTestEnableCursorControl,
BasicCursorControl) {
if (!::features::IsSwipeToMoveCursorEnabled())
return;
base::HistogramTester histograms;
LoadURL(kContentEditableDataURL.c_str());

EXPECT_EQ(32,
Expand All @@ -857,10 +855,6 @@ IN_PROC_BROWSER_TEST_F(TouchActionBrowserTestEnableCursorControl,

EXPECT_EQ(anchor_offset, focus_offset);
EXPECT_GT(32, anchor_offset);
histograms.ExpectBucketCount("Blink.Input.GestureScrollBeginAsCursorControl",
true, 1);
histograms.ExpectBucketCount("Blink.Input.GestureScrollBeginAsCursorControl",
false, 0);
}

// Perform a horizontal swipe over an editable element from right to left (the
Expand All @@ -871,7 +865,6 @@ IN_PROC_BROWSER_TEST_F(TouchActionBrowserTestEnableCursorControl,
NoCursorControlForHorizontalScrollable) {
if (!::features::IsSwipeToMoveCursorEnabled())
return;
base::HistogramTester histograms;
LoadURL(kContentEditableHorizontalScrollableDataURL.c_str());

EXPECT_EQ(32,
Expand All @@ -892,10 +885,6 @@ IN_PROC_BROWSER_TEST_F(TouchActionBrowserTestEnableCursorControl,
EXPECT_EQ(32, anchor_offset);
EXPECT_LT(0.f, ExecuteScriptAndExtractDouble(
"document.getElementById('scroller').scrollLeft"));
histograms.ExpectBucketCount("Blink.Input.GestureScrollBeginAsCursorControl",
true, 0);
histograms.ExpectBucketCount("Blink.Input.GestureScrollBeginAsCursorControl",
false, 1);
}

// Perform a horizontal swipe over an editable element from right to left
Expand Down Expand Up @@ -931,7 +920,6 @@ IN_PROC_BROWSER_TEST_F(TouchActionBrowserTestEnableCursorControl,
CursorControlOnInput) {
if (!::features::IsSwipeToMoveCursorEnabled())
return;
base::HistogramTester histograms;
// input size larger than the text size, not horizontally scrollable.
LoadURL(base::StringPrintf(kInputTagCursorControl.c_str(), 40).c_str());

Expand All @@ -949,10 +937,6 @@ IN_PROC_BROWSER_TEST_F(TouchActionBrowserTestEnableCursorControl,

EXPECT_EQ(selection_start, selection_end);
EXPECT_GT(32, selection_start);
histograms.ExpectBucketCount("Blink.Input.GestureScrollBeginAsCursorControl",
true, 1);
histograms.ExpectBucketCount("Blink.Input.GestureScrollBeginAsCursorControl",
false, 0);
}

// Perform a horizontal swipe over an horizontal scrollable input element from
Expand All @@ -961,7 +945,6 @@ IN_PROC_BROWSER_TEST_F(TouchActionBrowserTestEnableCursorControl,
NoCursorControlOnHorizontalScrollableInput) {
if (!::features::IsSwipeToMoveCursorEnabled())
return;
base::HistogramTester histograms;
// Make the input size smaller than the text size, so it horizontally
// scrollable.
LoadURL(base::StringPrintf(kInputTagCursorControl.c_str(), 20).c_str());
Expand All @@ -980,10 +963,6 @@ IN_PROC_BROWSER_TEST_F(TouchActionBrowserTestEnableCursorControl,

EXPECT_EQ(selection_start, selection_end);
EXPECT_EQ(32, selection_start);
histograms.ExpectBucketCount("Blink.Input.GestureScrollBeginAsCursorControl",
true, 0);
histograms.ExpectBucketCount("Blink.Input.GestureScrollBeginAsCursorControl",
false, 1);
}

} // namespace content
3 changes: 0 additions & 3 deletions content/browser/renderer_host/input/touch_action_filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "base/check_op.h"
#include "base/debug/crash_logging.h"
#include "base/debug/dump_without_crashing.h"
#include "base/metrics/histogram_macros.h"
#include "base/notreached.h"
#include "base/strings/string_number_conversions.h"
#include "base/trace_event/trace_event.h"
Expand Down Expand Up @@ -117,8 +116,6 @@ FilterGestureEventResult TouchActionFilter::FilterGestureEvent(
FilterGestureEventResult res;
if (!drop_scroll_events_) {
SetCursorControlIfNecessary(gesture_event, touch_action);
UMA_HISTOGRAM_BOOLEAN("Blink.Input.GestureScrollBeginAsCursorControl",
gesture_event->data.scroll_begin.cursor_control);
res = FilterGestureEventResult::kFilterGestureEventAllowed;
} else if (active_touch_action_.has_value()) {
res = FilterGestureEventResult::kFilterGestureEventFiltered;
Expand Down
4 changes: 4 additions & 0 deletions tools/metrics/histograms/metadata/blink/histograms.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1525,6 +1525,10 @@ chromium-metrics-reviews@google.com.

<histogram name="Blink.Input.GestureScrollBeginAsCursorControl"
enum="BooleanSuccess" expires_after="M91">
<obsolete>
Cursor Control feature is launched, the metrics is no longer needed. Removed
in March 2022.
</obsolete>
<owner>ctzsm@chromium.org</owner>
<owner>changwan@chromium.org</owner>
<owner>input-dev@chromium.org</owner>
Expand Down

0 comments on commit 740afe1

Please sign in to comment.