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

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

Issue 725853002: Move app launch metric recording code from NTP to chrome/common. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More mac Created 6 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
« no previous file with comments | « chrome/browser/ui/webui/ntp/core_app_launcher_handler.h ('k') | chrome/chrome_common.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/ntp/core_app_launcher_handler.cc
diff --git a/chrome/browser/ui/webui/ntp/core_app_launcher_handler.cc b/chrome/browser/ui/webui/ntp/core_app_launcher_handler.cc
index 9812a3aa210cc930a5df6bb1146ae48259992902..05349b9926934d73e339ecb6443607569164797f 100644
--- a/chrome/browser/ui/webui/ntp/core_app_launcher_handler.cc
+++ b/chrome/browser/ui/webui/ntp/core_app_launcher_handler.cc
@@ -5,16 +5,15 @@
#include "chrome/browser/ui/webui/ntp/core_app_launcher_handler.h"
#include "base/bind.h"
-#include "base/metrics/histogram.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/webui/ntp/app_launcher_handler.h"
+#include "chrome/common/extensions/extension_metrics.h"
#include "chrome/common/pref_names.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "content/public/browser/web_ui.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/common/constants.h"
-#include "extensions/common/extension.h"
#include "extensions/common/extension_set.h"
+#include "extensions/common/manifest.h"
#include "net/base/escape.h"
namespace {
@@ -27,52 +26,6 @@ CoreAppLauncherHandler::CoreAppLauncherHandler() {}
CoreAppLauncherHandler::~CoreAppLauncherHandler() {}
// static
-void CoreAppLauncherHandler::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);
- } else {
- UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram,
- bucket,
- extension_misc::APP_LAUNCH_BUCKET_BOUNDARY);
- }
-}
-
-// static
-void CoreAppLauncherHandler::RecordAppListSearchLaunch(
- const extensions::Extension* extension) {
- extension_misc::AppLaunchBucket bucket =
- extension_misc::APP_LAUNCH_APP_LIST_SEARCH;
- if (extension->id() == extensions::kWebStoreAppId)
- bucket = extension_misc::APP_LAUNCH_APP_LIST_SEARCH_WEBSTORE;
- else if (extension->id() == extension_misc::kChromeAppId)
- bucket = extension_misc::APP_LAUNCH_APP_LIST_SEARCH_CHROME;
- RecordAppLaunchType(bucket, extension->GetType());
-}
-
-// static
-void CoreAppLauncherHandler::RecordAppListMainLaunch(
- const extensions::Extension* extension) {
- extension_misc::AppLaunchBucket bucket =
- extension_misc::APP_LAUNCH_APP_LIST_MAIN;
- if (extension->id() == extensions::kWebStoreAppId)
- bucket = extension_misc::APP_LAUNCH_APP_LIST_MAIN_WEBSTORE;
- else if (extension->id() == extension_misc::kChromeAppId)
- bucket = extension_misc::APP_LAUNCH_APP_LIST_MAIN_CHROME;
- RecordAppLaunchType(bucket, extension->GetType());
-}
-
-// static
-void CoreAppLauncherHandler::RecordWebStoreLaunch() {
- RecordAppLaunchType(extension_misc::APP_LAUNCH_NTP_WEBSTORE,
- extensions::Manifest::TYPE_HOSTED_APP);
-}
-
-// static
void CoreAppLauncherHandler::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterListPref(prefs::kNtpAppPageNames,
@@ -105,7 +58,8 @@ void CoreAppLauncherHandler::RecordAppLaunchByUrl(
return;
}
- RecordAppLaunchType(bucket, extensions::Manifest::TYPE_HOSTED_APP);
+ extensions::RecordAppLaunchType(bucket,
+ extensions::Manifest::TYPE_HOSTED_APP);
}
void CoreAppLauncherHandler::RegisterMessages() {
« no previous file with comments | « chrome/browser/ui/webui/ntp/core_app_launcher_handler.h ('k') | chrome/chrome_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698