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

Unified Diff: chrome/browser/ui/webui/ntp/app_launcher_handler.cc

Issue 17226003: Add metrics for interactions with the Apps Launcher promo dialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed gyp file. :-/ Created 7 years, 6 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
Index: chrome/browser/ui/webui/ntp/app_launcher_handler.cc
diff --git a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
index 88bff10639a3216ebdf90b828ba72f740a440b0c..82c0078f359559aa19621792e5318c06b1ea3b6e 100644
--- a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
+++ b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
@@ -6,6 +6,7 @@
#include <vector>
+#include "apps/metrics_names.h"
#include "apps/pref_names.h"
#include "base/auto_reset.h"
#include "base/bind.h"
@@ -212,6 +213,9 @@ void AppLauncherHandler::RegisterMessages() {
web_ui()->RegisterMessageCallback("stopShowingAppLauncherPromo",
base::Bind(&AppLauncherHandler::StopShowingAppLauncherPromo,
base::Unretained(this)));
+ web_ui()->RegisterMessageCallback("onLearnMore",
+ base::Bind(&AppLauncherHandler::OnLearnMore,
+ base::Unretained(this)));
}
void AppLauncherHandler::Observe(int type,
@@ -694,6 +698,11 @@ void AppLauncherHandler::StopShowingAppLauncherPromo(
const base::ListValue* args) {
g_browser_process->local_state()->SetBoolean(
apps::prefs::kShowAppLauncherPromo, false);
+ RecordAppLauncherPromoHistogram(apps::APP_LAUNCHER_PROMO_DISMISSED);
+}
+
+void AppLauncherHandler::OnLearnMore(const base::ListValue* args) {
+ RecordAppLauncherPromoHistogram(apps::APP_LAUNCHER_PROMO_LEARN_MORE);
}
void AppLauncherHandler::OnFaviconForApp(
@@ -758,6 +767,7 @@ void AppLauncherHandler::CleanupAfterUninstall() {
void AppLauncherHandler::RecordAppLaunchType(
extension_misc::AppLaunchBucket bucket,
extensions::Manifest::Type app_type) {
+ DCHECK_LT(bucket, extension_misc::APP_LAUNCH_BUCKET_BOUNDARY);
if (app_type == extensions::Manifest::TYPE_PLATFORM_APP) {
UMA_HISTOGRAM_ENUMERATION(extension_misc::kPlatformAppLaunchHistogram,
bucket, extension_misc::APP_LAUNCH_BUCKET_BOUNDARY);
@@ -790,6 +800,14 @@ void AppLauncherHandler::RecordAppListMainLaunch(const Extension* extension) {
}
// static
+void AppLauncherHandler::RecordAppLauncherPromoHistogram(
+ apps::AppLauncherPromoHistogramValues value) {
+ DCHECK_LT(value, apps::APP_LAUNCHER_PROMO_MAX);
+ UMA_HISTOGRAM_ENUMERATION(
+ "Apps.AppLauncherPromo", value, apps::APP_LAUNCHER_PROMO_MAX);
+}
+
+// static
void AppLauncherHandler::RecordWebStoreLaunch() {
RecordAppLaunchType(extension_misc::APP_LAUNCH_NTP_WEBSTORE,
extensions::Manifest::TYPE_HOSTED_APP);
« no previous file with comments | « chrome/browser/ui/webui/ntp/app_launcher_handler.h ('k') | chrome/browser/ui/webui/ntp/ntp_resource_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698