Commit df26f4e5 authored by Zentaro Kavanagh's avatar Zentaro Kavanagh Committed by Commit Bot

Metrics: Add user action for search+click -> right click

- Logs a user action when the user presses search+click
  combination to emulate right click.
- The action will only be counted when flags/settings are mapping
  search+click to right click. If the default alt-click
  behavior is enabled then pressing search+click won't be counted
- This is to measure the transition of users from the legacy
  alt+click behavior to the new search+click.
- Code that uses this is in a follow up CL

BUG=chromium:248762

Change-Id: Ia72520cd6dfcc0e2521c895b1e3bf298da28c95c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1603543
Commit-Queue: Zentaro Kavanagh <zentaro@chromium.org>
Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
Reviewed-by: default avatarMark Pearson <mpearson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664584}
parent 10fa9630
......@@ -17075,6 +17075,15 @@ should be able to be added at any place in this file.
<description>User interacts with an answer card.</description>
</action>
<action name="SearchClickMappedToRightClick">
<owner>zentaro@chromium.org</owner>
<description>
User pressed search click on a touchpad device to generate right click. This
is measuring the transition of use from the legacy alt click behaviour that
is tracked by AltClickMappedToRightClick.
</description>
</action>
<action name="SearchEngine_ManualChange">
<owner>ianwen@chromium.org</owner>
<description>
......
......@@ -623,11 +623,13 @@ bool EventRewriterChromeOS::ShouldRemapToRightClick(
*matched_mask = 0;
if (base::FeatureList::IsEnabled(
::chromeos::features::kUseSearchClickForRightClick)) {
if (AreFlagsSet(flags, kSearchLeftButton))
if (AreFlagsSet(flags, kSearchLeftButton)) {
*matched_mask = kSearchLeftButton;
}
} else {
if (AreFlagsSet(flags, kAltLeftButton))
if (AreFlagsSet(flags, kAltLeftButton)) {
*matched_mask = kAltLeftButton;
}
}
return (*matched_mask != 0) &&
......@@ -1294,7 +1296,14 @@ int EventRewriterChromeOS::RewriteModifierClick(
*flags |= ui::EF_RIGHT_MOUSE_BUTTON;
if (mouse_event.type() == ui::ET_MOUSE_PRESSED) {
pressed_device_ids_.insert(mouse_event.source_device_id());
base::RecordAction(base::UserMetricsAction("AltClickMappedToRightClick"));
if (matched_mask == kSearchLeftButton) {
base::RecordAction(
base::UserMetricsAction("SearchClickMappedToRightClick"));
} else {
DCHECK(matched_mask == kAltLeftButton);
base::RecordAction(
base::UserMetricsAction("AltClickMappedToRightClick"));
}
} else {
pressed_device_ids_.erase(mouse_event.source_device_id());
}
......
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