Commit 97e1e77c authored by Kyle Milka's avatar Kyle Milka Committed by Commit Bot

[Sharing Hub] Add user actions for sharing hub

Add users actions to various points in the sharing hub.

Bug: 1009124
Change-Id: I92379ef1153d54d64257d4b32f369ec402119534
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2055689Reviewed-by: default avatarJeffrey Cohen <jeffreycohen@chromium.org>
Reviewed-by: default avatarSteven Holte <holte@chromium.org>
Commit-Queue: Kyle Milka <kmilka@chromium.org>
Cr-Commit-Position: refs/heads/master@{#744032}
parent 1236d45e
......@@ -13,6 +13,7 @@ import android.support.v7.content.res.AppCompatResources;
import androidx.annotation.VisibleForTesting;
import org.chromium.base.metrics.RecordHistogram;
import org.chromium.base.metrics.RecordUserAction;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.ActivityTabProvider;
import org.chromium.chrome.browser.flags.ChromeFeatureList;
......@@ -79,6 +80,7 @@ public class ShareSheetCoordinator {
activity.getResources().getString(R.string.qr_code_share_icon_label),
(currentActivity)
-> {
RecordUserAction.record("SharingHubAndroid.QRCodeSelected");
mBottomSheetController.hideContent(bottomSheet, true);
QrCodeCoordinator qrCodeCoordinator = new QrCodeCoordinator(activity);
qrCodeCoordinator.show();
......@@ -95,6 +97,8 @@ public class ShareSheetCoordinator {
R.string.send_tab_to_self_share_activity_title),
(shareParams)
-> {
RecordUserAction.record(
"SharingHubAndroid.SendTabToSelfSelected");
mBottomSheetController.hideContent(bottomSheet, true);
SendTabToSelfShareActivity.actionHandler(activity,
mActivityTabProvider.get()
......@@ -110,6 +114,7 @@ public class ShareSheetCoordinator {
PropertyModel copyPropertyModel = mPropertyModelBuilder.createPropertyModel(
AppCompatResources.getDrawable(activity, R.drawable.ic_content_copy_black),
activity.getResources().getString(R.string.sharing_copy_url), (params) -> {
RecordUserAction.record("SharingHubAndroid.CopyURLSelected");
mBottomSheetController.hideContent(bottomSheet, true);
Tab tab = mActivityTabProvider.get();
NavigationEntry entry =
......@@ -132,6 +137,7 @@ public class ShareSheetCoordinator {
activity.getResources().getString(R.string.sharing_screenshot),
(shareParams)
-> {
RecordUserAction.record("SharingHubAndroid.ScreenshotSelected");
mBottomSheetController.hideContent(bottomSheet, true);
Tab tab = mActivityTabProvider.get();
ScreenshotCoordinator screenshotCoordinator =
......@@ -156,6 +162,7 @@ public class ShareSheetCoordinator {
activity.getResources().getString(R.string.sharing_more_icon_label),
(shareParams)
-> {
RecordUserAction.record("SharingHubAndroid.MoreSelected");
mBottomSheetController.hideContent(bottomSheet, true);
ShareHelper.showDefaultShareUi(params);
},
......
......@@ -13,6 +13,7 @@ import android.content.pm.ResolveInfo;
import android.graphics.drawable.Drawable;
import android.view.View.OnClickListener;
import org.chromium.base.metrics.RecordUserAction;
import org.chromium.chrome.browser.widget.bottomsheet.BottomSheetController;
import org.chromium.ui.modelutil.PropertyModel;
......@@ -54,6 +55,7 @@ class ShareSheetPropertyModelBuilder {
PropertyModel propertyModel =
createPropertyModel(ShareHelper.loadIconForResolveInfo(info, mPackageManager),
(String) info.loadLabel(mPackageManager), (shareParams) -> {
RecordUserAction.record("SharingHubAndroid.ThirdPartyAppSelected");
ActivityInfo ai = info.activityInfo;
ComponentName component =
......
......@@ -18907,6 +18907,48 @@ should be able to be added at any place in this file.
</description>
</action>
<action name="SharingHubAndroid.CopyURLSelected">
<owner>src/components/send_tab_to_self/OWNERS</owner>
<description>
The &quot;Copy URL&quot; option was selected in the sharing hub.
</description>
</action>
<action name="SharingHubAndroid.MoreSelected">
<owner>src/components/send_tab_to_self/OWNERS</owner>
<description>
The &quot;More...&quot; option was selected in the sharing hub.
</description>
</action>
<action name="SharingHubAndroid.QRCodeSelected">
<owner>src/components/send_tab_to_self/OWNERS</owner>
<description>
The &quot;QR Code&quot; option was selected in the sharing hub.
</description>
</action>
<action name="SharingHubAndroid.ScreenshotSelected">
<owner>src/components/send_tab_to_self/OWNERS</owner>
<description>
The &quot;Screenshot&quot; option was selected in the sharing hub.
</description>
</action>
<action name="SharingHubAndroid.SendTabToSelfSelected">
<owner>src/components/send_tab_to_self/OWNERS</owner>
<description>
The &quot;Send to your devices&quot; option was selected in the sharing hub.
</description>
</action>
<action name="SharingHubAndroid.ThirdPartyAppSelected">
<owner>src/components/send_tab_to_self/OWNERS</owner>
<description>
A third party option was selected in the sharing hub.
</description>
</action>
<action name="Shelf_AlignmentSetBottom">
<owner>Please list the metric's owners. Add more owner tags as needed.</owner>
<description>Please enter the description of this user action.</description>
......
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