Commit 0e2f41df authored by Eugene But's avatar Eugene But Committed by Commit Bot

Log User Actions from crash restore toolbar.

This CL adds user Actions for closing or tapping "Restore". These
actions are helpful for Breadcrumbs feature that attaches steps to
reproduce to crash reports.

Bug: 1046231
Change-Id: I536c0de815a0bc0e4b14afe3c35ff06bc14474ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2089860
Auto-Submit: Eugene But <eugenebut@chromium.org>
Reviewed-by: default avatarRobert Kaplow <rkaplow@chromium.org>
Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Commit-Queue: Eugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#747894}
parent 10bfb977
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
#include <utility> #include <utility>
#include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_functions.h"
#include "base/metrics/user_metrics.h"
#include "base/metrics/user_metrics_action.h"
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
#include "components/infobars/core/confirm_infobar_delegate.h" #include "components/infobars/core/confirm_infobar_delegate.h"
#include "components/infobars/core/infobar.h" #include "components/infobars/core/infobar.h"
...@@ -179,6 +181,7 @@ base::string16 SessionCrashedInfoBarDelegate::GetButtonLabel( ...@@ -179,6 +181,7 @@ base::string16 SessionCrashedInfoBarDelegate::GetButtonLabel(
} }
bool SessionCrashedInfoBarDelegate::Accept() { bool SessionCrashedInfoBarDelegate::Accept() {
base::RecordAction(base::UserMetricsAction("SessionCrashedInfobarRestore"));
NSTimeInterval duration = NSTimeInterval duration =
[NSDate timeIntervalSinceReferenceDate] - delegate_creation_time_; [NSDate timeIntervalSinceReferenceDate] - delegate_creation_time_;
[ConfirmInfobarMetricsRecorder [ConfirmInfobarMetricsRecorder
...@@ -194,6 +197,7 @@ bool SessionCrashedInfoBarDelegate::Accept() { ...@@ -194,6 +197,7 @@ bool SessionCrashedInfoBarDelegate::Accept() {
} }
void SessionCrashedInfoBarDelegate::InfoBarDismissed() { void SessionCrashedInfoBarDelegate::InfoBarDismissed() {
base::RecordAction(base::UserMetricsAction("SessionCrashedInfobarClose"));
[ConfirmInfobarMetricsRecorder [ConfirmInfobarMetricsRecorder
recordConfirmInfobarEvent:MobileMessagesConfirmInfobarEvents::Dismissed recordConfirmInfobarEvent:MobileMessagesConfirmInfobarEvents::Dismissed
forInfobarConfirmType:InfobarConfirmType::kInfobarConfirmTypeRestore]; forInfobarConfirmType:InfobarConfirmType::kInfobarConfirmTypeRestore];
......
...@@ -18812,6 +18812,24 @@ should be able to be added at any place in this file. ...@@ -18812,6 +18812,24 @@ should be able to be added at any place in this file.
</description> </description>
</action> </action>
<action name="SessionCrashedInfobarClose">
<owner>eugenebut@chromium.org</owner>
<owner>olivierrobin@chromium.org</owner>
<description>
Logged when user taps on close button that dismisses tab restoration UI when
the app was relaunched after the crash. iOS only.
</description>
</action>
<action name="SessionCrashedInfobarRestore">
<owner>eugenebut@chromium.org</owner>
<owner>olivierrobin@chromium.org</owner>
<description>
Logged when user taps on Restore button that restores tabs when the app was
relaunched after the crash. iOS only.
</description>
</action>
<action name="Settings.Searching"> <action name="Settings.Searching">
<owner>dschuyler@chromium.org</owner> <owner>dschuyler@chromium.org</owner>
<description> <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