Commit 52e5afde authored by Melissa Zhang's avatar Melissa Zhang Committed by Commit Bot

Reland "[Sharesheet] Record ShareAction invocations." with fix.

We are relanding the commit to record ShareAction invocations.
This was previously reverted because we are adding a new enum
to record this metric but did not add the enum to enums.xml.

Original CL: https://crrev.com/c/2537505

Bug: 1148694
Change-Id: I8b6b12eea5aaec5239ceedd99cc9c7d5bbf4cdfa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2554742
Auto-Submit: Melissa Zhang <melzhang@chromium.org>
Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
Commit-Queue: Dominick Ng <dominickn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#830816}
parent b9619648
......@@ -14,7 +14,8 @@ class SharesheetMetrics {
enum class UserAction {
kCancelled = 0, // User cancelled sharesheet.
kArc, // Opened an ARC app.
kMaxValue = kArc,
kAction, // User selected an action.
kMaxValue = kAction,
};
SharesheetMetrics();
......
......@@ -86,6 +86,8 @@ void SharesheetService::OnTargetSelected(uint32_t delegate_id,
sharesheet_action_cache_->GetActionFromName(target_name);
if (share_action == nullptr)
return;
sharesheet::SharesheetMetrics::RecordSharesheetActionMetrics(
sharesheet::SharesheetMetrics::UserAction::kAction);
delegate->OnActionLaunched();
share_action->LaunchAction(delegate, share_action_view, std::move(intent));
} else if (type == TargetType::kApp) {
......
......@@ -10026,6 +10026,7 @@ histogram as enum -->
<summary>Defines Chrome OS sharesheet actions.</summary>
<int value="0" label="Cancelled by user"/>
<int value="1" label="Launch ARC app"/>
<int value="2" label="Launch share action"/>
</enum>
<enum name="ChromeOSUICommands">
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