| Index: chrome/browser/dom_ui/app_launcher_handler.cc
|
| diff --git a/chrome/browser/dom_ui/app_launcher_handler.cc b/chrome/browser/dom_ui/app_launcher_handler.cc
|
| index 9bc27d250843a7881f8d5f725dd1338701c4aa54..29f97af9b2c20eedd4602256361a59f0f68869b4 100644
|
| --- a/chrome/browser/dom_ui/app_launcher_handler.cc
|
| +++ b/chrome/browser/dom_ui/app_launcher_handler.cc
|
| @@ -5,6 +5,7 @@
|
| #include "chrome/browser/dom_ui/app_launcher_handler.h"
|
|
|
| #include "app/animation.h"
|
| +#include "base/metrics/histogram.h"
|
| #include "base/string_number_conversions.h"
|
| #include "base/string_util.h"
|
| #include "base/utf_string_conversions.h"
|
| @@ -56,7 +57,8 @@ std::string GetIconURL(const Extension* extension, Extension::Icons icon,
|
| } // namespace
|
|
|
| AppLauncherHandler::AppLauncherHandler(ExtensionsService* extension_service)
|
| - : extensions_service_(extension_service) {
|
| + : extensions_service_(extension_service),
|
| + promo_active_(false) {
|
| }
|
|
|
| AppLauncherHandler::~AppLauncherHandler() {}
|
| @@ -150,8 +152,10 @@ void AppLauncherHandler::FillAppDictionary(DictionaryValue* dictionary) {
|
| if (default_apps->ShouldShowPromo(extensions_service_->GetAppIds())) {
|
| dictionary->SetBoolean("showPromo", true);
|
| default_apps->DidShowPromo();
|
| + promo_active_ = true;
|
| } else {
|
| dictionary->SetBoolean("showPromo", false);
|
| + promo_active_ = false;
|
| }
|
|
|
| bool showLauncher =
|
| @@ -220,6 +224,14 @@ void AppLauncherHandler::HandleLaunchApp(const ListValue* args) {
|
|
|
| if (new_contents != old_contents && browser->tab_count() > 1)
|
| browser->CloseTabContents(old_contents);
|
| +
|
| + if (promo_active_ && extension_id != extension_misc::kWebStoreAppId) {
|
| + UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppsPromoHistogram,
|
| + extension_misc::PROMO_LAUNCH_APP,
|
| + extension_misc::PROMO_BUCKET_BOUNDARY);
|
| + }
|
| + // TODO(jstritar): record histogram data for app launches that occur when
|
| + // the promo is not active.
|
| }
|
|
|
| void AppLauncherHandler::HandleSetLaunchType(const ListValue* args) {
|
| @@ -271,6 +283,9 @@ void AppLauncherHandler::HandleHideAppsPromo(const ListValue* args) {
|
| // If the user has intentionally hidden the promotion, we'll uninstall all the
|
| // default apps (we know the user hasn't installed any apps on their own at
|
| // this point, or the promotion wouldn't have been shown).
|
| + UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppsPromoHistogram,
|
| + extension_misc::PROMO_CLOSE,
|
| + extension_misc::PROMO_BUCKET_BOUNDARY);
|
| DefaultApps* default_apps = extensions_service_->default_apps();
|
| const ExtensionIdSet* app_ids = default_apps->GetDefaultApps();
|
| DCHECK(*app_ids == extensions_service_->GetAppIds());
|
|
|