Chromium Code Reviews| Index: ios/chrome/browser/ui/sad_tab/sad_tab_view.mm |
| diff --git a/ios/chrome/browser/ui/sad_tab/sad_tab_view.mm b/ios/chrome/browser/ui/sad_tab/sad_tab_view.mm |
| index ac2fc8a36cb6f9e02791d2df7247f4c3abae99db..c3c18ce555bd5a6d8de28b1d0964d620ef840b57 100644 |
| --- a/ios/chrome/browser/ui/sad_tab/sad_tab_view.mm |
| +++ b/ios/chrome/browser/ui/sad_tab/sad_tab_view.mm |
| @@ -4,6 +4,7 @@ |
| #import "ios/chrome/browser/ui/sad_tab/sad_tab_view.h" |
| +#include "base/metrics/histogram_macros.h" |
| #include "base/strings/sys_string_conversions.h" |
| #include "components/grit/components_scaled_resources.h" |
| #include "components/strings/grit/components_strings.h" |
| @@ -117,6 +118,15 @@ NSString* const kMessageLabelBulletRTLFormat = @"\u202E%@\u202C"; |
| @end |
| +// An enum for reporting interaction events to a UMA histogram. This |
| +// enumeration mimics that at sad_tab.cc |
| +typedef NS_ENUM(NSInteger, SadTabViewEvent) { |
|
PL
2017/05/09 22:38:23
This enumeration copies one reporting this metric
Eugene But (OOO till 7-30)
2017/05/09 22:45:58
I think it is C :). We should find a common place
PL
2017/05/09 22:57:20
Thanks! Reached out to isherman@ and sdy@ for disc
|
| + SadTabViewEventDisplayed = 0, |
| + SadTabViewEventButtonClicked, |
| + SadTabViewEventHelpLinkClicked, |
| + SadTabViewEventMaxSadTabEvent, |
| +}; |
| + |
| #pragma mark - SadTabView |
| @implementation SadTabView |
| @@ -523,9 +533,15 @@ NSString* const kMessageLabelBulletRTLFormat = @"\u202E%@\u202C"; |
| - (void)handleActionButtonTapped:(id)sender { |
| switch (self.mode) { |
| case SadTabViewMode::RELOAD: |
| + UMA_HISTOGRAM_ENUMERATION("Tabs.SadTab.Reload.Event", |
| + SadTabViewEventButtonClicked, |
| + SadTabViewEventMaxSadTabEvent); |
| self.navigationManager->Reload(web::ReloadType::NORMAL, true); |
| break; |
| case SadTabViewMode::FEEDBACK: { |
| + UMA_HISTOGRAM_ENUMERATION("Tabs.SadTab.Feedback.Event", |
| + SadTabViewEventButtonClicked, |
| + SadTabViewEventMaxSadTabEvent); |
| GenericChromeCommand* command = |
| [[GenericChromeCommand alloc] initWithTag:IDC_REPORT_AN_ISSUE]; |
| [self chromeExecuteCommand:command]; |