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

Unified Diff: chrome/browser/ui/webui/app_list/start_page_handler.cc

Issue 930243009: Add UMA for the app list doodle being clicked. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@uma
Patch Set: fix tests Created 5 years, 10 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 | « chrome/browser/ui/webui/app_list/start_page_handler.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/app_list/start_page_handler.cc
diff --git a/chrome/browser/ui/webui/app_list/start_page_handler.cc b/chrome/browser/ui/webui/app_list/start_page_handler.cc
index 124914b74c91e32453bcfab308d11f3e6977f50f..7868d7d128d7eddbc2a12662b525e8b0c8273d04 100644
--- a/chrome/browser/ui/webui/app_list/start_page_handler.cc
+++ b/chrome/browser/ui/webui/app_list/start_page_handler.cc
@@ -8,6 +8,7 @@
#include "base/bind.h"
#include "base/memory/scoped_ptr.h"
+#include "base/metrics/histogram_macros.h"
#include "base/values.h"
#include "base/version.h"
#include "chrome/browser/profiles/profile.h"
@@ -33,6 +34,18 @@ namespace app_list {
namespace {
+const char kAppListDoodleActionHistogram[] = "Apps.AppListDoodleAction";
+
+// Interactions a user has with the app list doodle. This enum must not have its
+// order altered as it is used in histograms.
+enum DoodleAction {
+ DOODLE_SHOWN = 0,
+ DOODLE_CLICKED,
+ // Add values here.
+
+ DOODLE_ACTION_LAST,
+};
+
#if defined(OS_CHROMEOS)
const char kOldHotwordExtensionVersionString[] = "0.1.1.5023";
#endif
@@ -47,6 +60,12 @@ StartPageHandler::~StartPageHandler() {
void StartPageHandler::RegisterMessages() {
web_ui()->RegisterMessageCallback(
+ "appListShown", base::Bind(&StartPageHandler::HandleAppListShown,
+ base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
+ "doodleClicked", base::Bind(&StartPageHandler::HandleDoodleClicked,
+ base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
"initialize",
base::Bind(&StartPageHandler::HandleInitialize, base::Unretained(this)));
web_ui()->RegisterMessageCallback(
@@ -113,6 +132,19 @@ void StartPageHandler::OnHotwordEnabledChanged() {
}
#endif
+void StartPageHandler::HandleAppListShown(const base::ListValue* args) {
+ bool doodle_shown = false;
+ if (args->GetBoolean(0, &doodle_shown) && doodle_shown) {
+ UMA_HISTOGRAM_ENUMERATION(kAppListDoodleActionHistogram, DOODLE_SHOWN,
+ DOODLE_ACTION_LAST);
+ }
+}
+
+void StartPageHandler::HandleDoodleClicked(const base::ListValue* args) {
+ UMA_HISTOGRAM_ENUMERATION(kAppListDoodleActionHistogram, DOODLE_CLICKED,
+ DOODLE_ACTION_LAST);
+}
+
void StartPageHandler::HandleInitialize(const base::ListValue* args) {
Profile* profile = Profile::FromWebUI(web_ui());
StartPageService* service = StartPageService::Get(profile);
« no previous file with comments | « chrome/browser/ui/webui/app_list/start_page_handler.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698