Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(563)

Unified Diff: chrome/browser/ui/sad_tab.cc

Issue 2869223002: Metrics logging for user engagement of the Reload and Feedback buttons (Closed)
Patch Set: Migrating Desktop to use shared symbols, explicitly setting enum values" Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ios/chrome/browser/ui/sad_tab/sad_tab_view.mm » ('j') | ui/base/ui_metrics_types.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/sad_tab.cc
diff --git a/chrome/browser/ui/sad_tab.cc b/chrome/browser/ui/sad_tab.cc
index 2a9d3b9365f6d615fa943d92d9cd6c5a1b61485e..32b795f1695ae33b480956325a9d37ec32c4e41d 100644
--- a/chrome/browser/ui/sad_tab.cc
+++ b/chrome/browser/ui/sad_tab.cc
@@ -19,6 +19,7 @@
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/web_contents.h"
#include "ui/base/l10n/l10n_util.h"
+#include "ui/base/ui_metrics_types.h"
#if defined(OS_CHROMEOS)
#include "chrome/browser/memory/oom_memory_details.h"
@@ -39,23 +40,13 @@ namespace {
UMA_HISTOGRAM_COUNTS_1000(histogram_name, count); \
}
-// This enum backs an UMA histogram, so it should be treated as append-only.
-// A Java counterpart will be generated for this enum.
-// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.tab
-enum SadTabEvent {
- DISPLAYED,
- BUTTON_CLICKED,
- HELP_LINK_CLICKED,
- MAX_SAD_TAB_EVENT
-};
-
-void RecordEvent(bool feedback, SadTabEvent event) {
+void RecordEvent(bool feedback, ui::SadTabEvent event) {
if (feedback) {
- UMA_HISTOGRAM_ENUMERATION("Tabs.SadTab.Feedback.Event", event,
- SadTabEvent::MAX_SAD_TAB_EVENT);
+ UMA_HISTOGRAM_ENUMERATION(ui::kSadTabFeedbackHistogramKey, event,
+ ui::SadTabEvent::SAD_TAB_EVENT_MAX);
} else {
- UMA_HISTOGRAM_ENUMERATION("Tabs.SadTab.Reload.Event", event,
- SadTabEvent::MAX_SAD_TAB_EVENT);
+ UMA_HISTOGRAM_ENUMERATION(ui::kSadTabReloadHistogramKey, event,
+ ui::SadTabEvent::SAD_TAB_EVENT_MAX);
}
}
@@ -224,14 +215,15 @@ void SadTab::RecordFirstPaint() {
break;
}
- RecordEvent(show_feedback_button_, SadTabEvent::DISPLAYED);
+ RecordEvent(show_feedback_button_, ui::SadTabEvent::SAD_TAB_EVENT_DISPLAYED);
}
void SadTab::PerformAction(SadTab::Action action) {
DCHECK(recorded_paint_);
switch (action) {
case Action::BUTTON:
- RecordEvent(show_feedback_button_, SadTabEvent::BUTTON_CLICKED);
+ RecordEvent(show_feedback_button_,
+ ui::SadTabEvent::SAD_TAB_EVENT_BUTTON_CLICKED);
if (show_feedback_button_) {
ShowFeedbackPage(
FindBrowserWithWebContents(web_contents_),
@@ -246,7 +238,8 @@ void SadTab::PerformAction(SadTab::Action action) {
}
break;
case Action::HELP_LINK:
- RecordEvent(show_feedback_button_, SadTabEvent::HELP_LINK_CLICKED);
+ RecordEvent(show_feedback_button_,
+ ui::SadTabEvent::SAD_TAB_EVENT_HELP_LINK_CLICKED);
content::OpenURLParams params(GURL(GetHelpLinkURL()), content::Referrer(),
WindowOpenDisposition::CURRENT_TAB,
ui::PAGE_TRANSITION_LINK, false);
« no previous file with comments | « no previous file | ios/chrome/browser/ui/sad_tab/sad_tab_view.mm » ('j') | ui/base/ui_metrics_types.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698