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

Unified Diff: chrome/browser/dom_ui/app_launcher_handler.cc

Issue 4708002: Add a histogram for tracking web store promo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: incorporate feedback, use ping attribute Created 10 years, 1 month 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/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());

Powered by Google App Engine
This is Rietveld 408576698