diff options
author | mad@chromium.org <mad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-10 00:12:55 +0000 |
---|---|---|
committer | mad@chromium.org <mad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-10 00:12:55 +0000 |
commit | f4ed3aba394cb97affef78e899873ad1d833c249 (patch) | |
tree | bf7f39f8a2ade30b307ed03f7e43bcf8f9e758b8 | |
parent | 0a9825fba9dd682be2cee73e0d936a7e2b7e314d (diff) | |
download | chromium_src-f4ed3aba394cb97affef78e899873ad1d833c249.zip chromium_src-f4ed3aba394cb97affef78e899873ad1d833c249.tar.gz chromium_src-f4ed3aba394cb97affef78e899873ad1d833c249.tar.bz2 |
Moving app launcher promo metrics to the right place.
BUG=252702
Review URL: https://chromiumcodereview.appspot.com/18341019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@210680 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/ui/webui/app_launcher_page_ui.cc | 11 | ||||
-rw-r--r-- | chrome/browser/ui/webui/ntp/app_launcher_handler.cc | 20 | ||||
-rw-r--r-- | chrome/browser/ui/webui/ntp/app_launcher_handler.h | 4 |
3 files changed, 12 insertions, 23 deletions
diff --git a/chrome/browser/ui/webui/app_launcher_page_ui.cc b/chrome/browser/ui/webui/app_launcher_page_ui.cc index 1a2b32e..09281cf 100644 --- a/chrome/browser/ui/webui/app_launcher_page_ui.cc +++ b/chrome/browser/ui/webui/app_launcher_page_ui.cc @@ -4,7 +4,6 @@ #include "chrome/browser/ui/webui/app_launcher_page_ui.h" -#include "apps/app_launcher.h" #include "base/memory/ref_counted_memory.h" #include "base/metrics/histogram.h" #include "chrome/browser/profiles/profile.h" @@ -111,16 +110,6 @@ void AppLauncherPageUI::HTMLSource::StartDataRequest( scoped_refptr<base::RefCountedMemory> html_bytes( resource->GetNewTabHTML(is_incognito)); - if (!is_incognito) { - if (apps::IsAppLauncherEnabled()) { - AppLauncherHandler::RecordAppLauncherPromoHistogram( - apps::APP_LAUNCHER_PROMO_ALREADY_INSTALLED); - } else if (apps::ShouldShowAppLauncherPromo()){ - AppLauncherHandler::RecordAppLauncherPromoHistogram( - apps::APP_LAUNCHER_PROMO_SHOWN); - } - } - callback.Run(html_bytes.get()); } diff --git a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc index 0fdc1c8..02c3179 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/app_launcher.h" #include "apps/metrics_names.h" #include "apps/pref_names.h" #include "base/auto_reset.h" @@ -74,6 +75,13 @@ bool ShouldDisplayInNewTabPage(const Extension* app, PrefService* prefs) { return app->ShouldDisplayInNewTabPage() && !blocked_by_policy; } +void RecordAppLauncherPromoHistogram( + apps::AppLauncherPromoHistogramValues value) { + DCHECK_LT(value, apps::APP_LAUNCHER_PROMO_MAX); + UMA_HISTOGRAM_ENUMERATION( + "Apps.AppLauncherPromo", value, apps::APP_LAUNCHER_PROMO_MAX); +} + } // namespace const net::UnescapeRule::Type kUnescapeRules = @@ -88,6 +96,10 @@ AppLauncherHandler::AppLauncherHandler(ExtensionService* extension_service) ignore_changes_(false), attempted_bookmark_app_install_(false), has_loaded_apps_(false) { + if (apps::IsAppLauncherEnabled()) + RecordAppLauncherPromoHistogram(apps::APP_LAUNCHER_PROMO_ALREADY_INSTALLED); + else if (apps::ShouldShowAppLauncherPromo()) + RecordAppLauncherPromoHistogram(apps::APP_LAUNCHER_PROMO_SHOWN); } AppLauncherHandler::~AppLauncherHandler() {} @@ -800,14 +812,6 @@ 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); diff --git a/chrome/browser/ui/webui/ntp/app_launcher_handler.h b/chrome/browser/ui/webui/ntp/app_launcher_handler.h index 066521b..f75cd2d 100644 --- a/chrome/browser/ui/webui/ntp/app_launcher_handler.h +++ b/chrome/browser/ui/webui/ntp/app_launcher_handler.h @@ -128,10 +128,6 @@ class AppLauncherHandler : public content::WebUIMessageHandler, // Records an app launch from the main view of the app list. static void RecordAppListMainLaunch(const extensions::Extension* extension); - // Records the given |value| in the apps::kAppLauncherPromoHistogram. - static void RecordAppLauncherPromoHistogram( - apps::AppLauncherPromoHistogramValues value); - private: struct AppInstallInfo { AppInstallInfo(); |