Commit 65cbeb90 authored by nancy's avatar nancy Committed by Commit Bot

Move RecordShowHistogram to built_in_apps.

BUG=1005640

Change-Id: I441c389203be3c7eb1f06ddbdce09d3441677958
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1830483
Commit-Queue: Nancy Wang <nancylingwang@chromium.org>
Reviewed-by: default avatarNigel Tao <nigeltao@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#704459}
parent 1c7d92d0
...@@ -148,4 +148,26 @@ void RecordAppLaunch(const std::string& app_id, ...@@ -148,4 +148,26 @@ void RecordAppLaunch(const std::string& app_id,
RecordBuiltInAppLaunch(BuiltInAppName::kPluginVm, launch_source); RecordBuiltInAppLaunch(BuiltInAppName::kPluginVm, launch_source);
} }
void RecordBuiltInAppSearchResult(const std::string& app_id) {
if (app_id == ash::kInternalAppIdKeyboardShortcutViewer) {
UMA_HISTOGRAM_ENUMERATION("Apps.AppListSearchResultInternalApp.Show",
BuiltInAppName::kKeyboardShortcutViewer);
} else if (app_id == ash::kReleaseNotesAppId) {
UMA_HISTOGRAM_ENUMERATION("Apps.AppListSearchResultInternalApp.Show",
BuiltInAppName::kReleaseNotes);
} else if (app_id == ash::kInternalAppIdCamera) {
UMA_HISTOGRAM_ENUMERATION("Apps.AppListSearchResultInternalApp.Show",
BuiltInAppName::kCamera);
} else if (app_id == ash::kInternalAppIdDiscover) {
UMA_HISTOGRAM_ENUMERATION("Apps.AppListSearchResultInternalApp.Show",
BuiltInAppName::kDiscover);
} else if (app_id == ash::kInternalAppIdSettings) {
UMA_HISTOGRAM_ENUMERATION("Apps.AppListSearchResultInternalApp.Show",
BuiltInAppName::kSettings);
} else if (app_id == plugin_vm::kPluginVmAppId) {
UMA_HISTOGRAM_ENUMERATION("Apps.AppListSearchResultInternalApp.Show",
BuiltInAppName::kPluginVm);
}
}
} // namespace apps } // namespace apps
...@@ -15,6 +15,8 @@ namespace apps { ...@@ -15,6 +15,8 @@ namespace apps {
void RecordAppLaunch(const std::string& app_id, void RecordAppLaunch(const std::string& app_id,
apps::mojom::LaunchSource launch_source); apps::mojom::LaunchSource launch_source);
void RecordBuiltInAppSearchResult(const std::string& app_id);
} // namespace apps } // namespace apps
#endif // CHROME_BROWSER_APPS_APP_SERVICE_APP_SERVICE_METRICS_H_ #endif // CHROME_BROWSER_APPS_APP_SERVICE_APP_SERVICE_METRICS_H_
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "ash/public/cpp/app_list/app_list_config.h" #include "ash/public/cpp/app_list/app_list_config.h"
#include "ash/public/cpp/app_list/app_list_types.h" #include "ash/public/cpp/app_list/app_list_types.h"
#include "base/bind.h" #include "base/bind.h"
#include "chrome/browser/apps/app_service/app_service_metrics.h"
#include "chrome/browser/apps/app_service/app_service_proxy.h" #include "chrome/browser/apps/app_service/app_service_proxy.h"
#include "chrome/browser/apps/app_service/app_service_proxy_factory.h" #include "chrome/browser/apps/app_service/app_service_proxy_factory.h"
#include "chrome/browser/ui/app_list/app_list_client_impl.h" #include "chrome/browser/ui/app_list/app_list_client_impl.h"
...@@ -52,10 +53,7 @@ AppServiceAppResult::AppServiceAppResult(Profile* profile, ...@@ -52,10 +53,7 @@ AppServiceAppResult::AppServiceAppResult(Profile* profile,
// TODO(crbug.com/826982): Is this SetResultType call necessary?? Does // TODO(crbug.com/826982): Is this SetResultType call necessary?? Does
// anyone care about the kInternalApp vs kInstalledApp distinction? // anyone care about the kInternalApp vs kInstalledApp distinction?
SetResultType(ResultType::kInternalApp); SetResultType(ResultType::kInternalApp);
// TODO(crbug.com/826982): Move this from the App Service caller to apps::RecordBuiltInAppSearchResult(app_id);
// callee, closer to where other histograms are updated in
// BuiltInChromeOsApps::Launch??
InternalAppResult::RecordShowHistogram(app_id);
break; break;
case apps::mojom::AppType::kExtension: case apps::mojom::AppType::kExtension:
// TODO(crbug.com/826982): why do we pass the URL and not the app_id?? // TODO(crbug.com/826982): why do we pass the URL and not the app_id??
......
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