Commit 6d2853eb authored by alex linker's avatar alex linker Committed by Commit Bot

changing app service metrics to use histogram functions rather than

histogram macros

it was recommended by bcwhite@ on another cl to change all the macro
calls to function calls to avoid instantiating the caching code.

BUG=1044710

Change-Id: I1e6dfd9caa2f8250892a7505f30398a50f243483
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2040632Reviewed-by: default avatarNancy Wang <nancylingwang@chromium.org>
Commit-Queue: Alex Linker <ajlinker@chromium.org>
Cr-Commit-Position: refs/heads/master@{#739071}
parent ce119086
......@@ -6,7 +6,6 @@
#include "ash/public/cpp/app_list/internal_app_id_constants.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/time/time.h"
#include "chrome/browser/chromeos/extensions/default_web_app_ids.h"
#include "chrome/browser/chromeos/file_manager/app_id.h"
......@@ -45,44 +44,44 @@ void RecordDefaultAppLaunch(DefaultAppName default_app_name,
case apps::mojom::LaunchSource::kFromParentalControls:
return;
case apps::mojom::LaunchSource::kFromAppListGrid:
UMA_HISTOGRAM_ENUMERATION("Apps.DefaultAppLaunch.FromAppListGrid",
base::UmaHistogramEnumeration("Apps.DefaultAppLaunch.FromAppListGrid",
default_app_name);
break;
case apps::mojom::LaunchSource::kFromAppListGridContextMenu:
UMA_HISTOGRAM_ENUMERATION(
base::UmaHistogramEnumeration(
"Apps.DefaultAppLaunch.FromAppListGridContextMenu", default_app_name);
break;
case apps::mojom::LaunchSource::kFromAppListQuery:
UMA_HISTOGRAM_ENUMERATION("Apps.DefaultAppLaunch.FromAppListQuery",
base::UmaHistogramEnumeration("Apps.DefaultAppLaunch.FromAppListQuery",
default_app_name);
break;
case apps::mojom::LaunchSource::kFromAppListQueryContextMenu:
UMA_HISTOGRAM_ENUMERATION(
base::UmaHistogramEnumeration(
"Apps.DefaultAppLaunch.FromAppListQueryContextMenu",
default_app_name);
break;
case apps::mojom::LaunchSource::kFromAppListRecommendation:
UMA_HISTOGRAM_ENUMERATION(
base::UmaHistogramEnumeration(
"Apps.DefaultAppLaunch.FromAppListRecommendation", default_app_name);
break;
case apps::mojom::LaunchSource::kFromShelf:
UMA_HISTOGRAM_ENUMERATION("Apps.DefaultAppLaunch.FromShelf",
base::UmaHistogramEnumeration("Apps.DefaultAppLaunch.FromShelf",
default_app_name);
break;
case apps::mojom::LaunchSource::kFromFileManager:
UMA_HISTOGRAM_ENUMERATION("Apps.DefaultAppLaunch.FromFileManager",
base::UmaHistogramEnumeration("Apps.DefaultAppLaunch.FromFileManager",
default_app_name);
break;
case apps::mojom::LaunchSource::kFromLink:
UMA_HISTOGRAM_ENUMERATION("Apps.DefaultAppLaunch.FromLink",
base::UmaHistogramEnumeration("Apps.DefaultAppLaunch.FromLink",
default_app_name);
break;
case apps::mojom::LaunchSource::kFromOmnibox:
UMA_HISTOGRAM_ENUMERATION("Apps.DefaultAppLaunch.FromOmnibox",
base::UmaHistogramEnumeration("Apps.DefaultAppLaunch.FromOmnibox",
default_app_name);
break;
case apps::mojom::LaunchSource::kFromChromeInternal:
UMA_HISTOGRAM_ENUMERATION("Apps.DefaultAppLaunch.FromChromeInternal",
base::UmaHistogramEnumeration("Apps.DefaultAppLaunch.FromChromeInternal",
default_app_name);
break;
}
......@@ -96,13 +95,13 @@ void RecordBuiltInAppLaunch(apps::BuiltInAppName built_in_app_name,
break;
case apps::mojom::LaunchSource::kFromAppListGrid:
case apps::mojom::LaunchSource::kFromAppListGridContextMenu:
UMA_HISTOGRAM_ENUMERATION("Apps.AppListInternalApp.Activate",
base::UmaHistogramEnumeration("Apps.AppListInternalApp.Activate",
built_in_app_name);
break;
case apps::mojom::LaunchSource::kFromAppListQuery:
case apps::mojom::LaunchSource::kFromAppListQueryContextMenu:
case apps::mojom::LaunchSource::kFromAppListRecommendation:
UMA_HISTOGRAM_ENUMERATION("Apps.AppListSearchResultInternalApp.Open",
base::UmaHistogramEnumeration("Apps.AppListSearchResultInternalApp.Open",
built_in_app_name);
break;
case apps::mojom::LaunchSource::kFromShelf:
......@@ -159,24 +158,24 @@ void RecordAppLaunch(const std::string& app_id,
void RecordBuiltInAppSearchResult(const std::string& app_id) {
if (app_id == ash::kInternalAppIdKeyboardShortcutViewer) {
UMA_HISTOGRAM_ENUMERATION("Apps.AppListSearchResultInternalApp.Show",
base::UmaHistogramEnumeration("Apps.AppListSearchResultInternalApp.Show",
BuiltInAppName::kKeyboardShortcutViewer);
} else if (app_id == ash::kInternalAppIdSettings) {
UMA_HISTOGRAM_ENUMERATION("Apps.AppListSearchResultInternalApp.Show",
base::UmaHistogramEnumeration("Apps.AppListSearchResultInternalApp.Show",
BuiltInAppName::kSettings);
} else if (app_id == ash::kInternalAppIdContinueReading) {
UMA_HISTOGRAM_ENUMERATION("Apps.AppListSearchResultInternalApp.Show",
base::UmaHistogramEnumeration("Apps.AppListSearchResultInternalApp.Show",
BuiltInAppName::kContinueReading);
} else if (app_id == ash::kInternalAppIdDiscover) {
UMA_HISTOGRAM_ENUMERATION("Apps.AppListSearchResultInternalApp.Show",
base::UmaHistogramEnumeration("Apps.AppListSearchResultInternalApp.Show",
BuiltInAppName::kDiscover);
#if defined(OS_CHROMEOS)
} else if (app_id == plugin_vm::kPluginVmAppId) {
UMA_HISTOGRAM_ENUMERATION("Apps.AppListSearchResultInternalApp.Show",
base::UmaHistogramEnumeration("Apps.AppListSearchResultInternalApp.Show",
BuiltInAppName::kPluginVm);
#endif // OS_CHROMEOS
} else if (app_id == ash::kReleaseNotesAppId) {
UMA_HISTOGRAM_ENUMERATION("Apps.AppListSearchResultInternalApp.Show",
base::UmaHistogramEnumeration("Apps.AppListSearchResultInternalApp.Show",
BuiltInAppName::kReleaseNotes);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment