Chromium Code Reviews| 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..456534a43e44da5e75343676a433476cf09b320d 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(bucket < extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); |
|
Ilya Sherman
2013/06/27 23:15:56
nit: DCHECK_LT
MAD
2013/06/27 23:21:05
Done.
|
| if (app_type == extensions::Manifest::TYPE_PLATFORM_APP) { |
| UMA_HISTOGRAM_ENUMERATION(extension_misc::kPlatformAppLaunchHistogram, |
| bucket, extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); |
| @@ -790,6 +800,15 @@ void AppLauncherHandler::RecordAppListMainLaunch(const Extension* extension) { |
| } |
| // static |
| +void AppLauncherHandler::RecordAppLauncherPromoHistogram( |
| + apps::AppLauncherPromoHistogramValues value) { |
| + DCHECK(value < apps::APP_LAUNCHER_PROMO_MAX); |
|
Ilya Sherman
2013/06/27 23:15:56
nit: DCHECK_LT
MAD
2013/06/27 23:21:05
Done.
|
| + UMA_HISTOGRAM_ENUMERATION(apps::kAppLauncherPromoHistogram, |
|
Ilya Sherman
2013/06/27 23:15:56
Optional nit: I'd just inline the histogram name a
MAD
2013/06/27 23:21:05
We also use it in another file, so I prefer to kee
Ilya Sherman
2013/06/28 00:37:32
Which other file?
|
| + value, |
| + apps::APP_LAUNCHER_PROMO_MAX); |
| +} |
| + |
| +// static |
| void AppLauncherHandler::RecordWebStoreLaunch() { |
| RecordAppLaunchType(extension_misc::APP_LAUNCH_NTP_WEBSTORE, |
| extensions::Manifest::TYPE_HOSTED_APP); |