Commit 8dcfda48 authored by Andrew Xu's avatar Andrew Xu Committed by Commit Bot

[Shelf Metrics] Avoid over-counting gesture events

In overview mode, only the gesture tap event will end the overview.
Hotseat state does not update for the other gestures, such as scrolling
(it is usually used to drag a window). It is the reason why the current
code - recording the metrics for the ET_GESTURE_BEGIN event, causes
unnecessary recordings.

Bug: 1124345
Change-Id: If9931368a98776338beb893b2f5c326603849437
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2389322Reviewed-by: default avatarXiyuan Slow <xiyuan@chromium.org>
Commit-Queue: Andrew Xu <andrewxu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#803926}
parent a499a384
......@@ -707,8 +707,16 @@ void ShelfLayoutManager::ProcessGestureEventOfInAppHotseat(
base::AutoReset<bool> hide_hotseat(&should_hide_hotseat_, true);
// Record gesture metrics only for ET_GESTURE_BEGIN to avoid over counting.
if (event->type() == ui::ET_GESTURE_BEGIN) {
// In overview mode, only the gesture tap event is able to make the hotseat
// exit the extended mode.
const bool in_overview =
Shell::Get()->overview_controller() &&
Shell::Get()->overview_controller()->InOverviewSession();
ui::EventType interesting_type =
in_overview ? ui::ET_GESTURE_TAP : ui::ET_GESTURE_BEGIN;
// Record gesture metrics only for `interesting_type` to avoid over counting.
if (event->type() == interesting_type) {
UMA_HISTOGRAM_ENUMERATION(
kHotseatGestureHistogramName,
InAppShelfGestures::kHotseatHiddenDueToInteractionOutsideOfShelf);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment