Commit 297283a4 authored by nancy's avatar nancy Committed by Commit Bot

Replace the internal_app UMA interface with the AppService interface.

This is the follow up for crrev.com/c/1830483 and crrev.com/c/1816495.
Those UMA records have been moved to AppService, so the UMA interface
in app_list/internal_app should be replaced with the AppService
interface. Otherwise, we have duplicate interface, which could cause
confusing for the future change.

Although app_list/internal_app will be replaced by AppService for the
long term goal, in short term(one or two months), they are still there,
so as the temporary solution, update it to use the AppService's
interface.

BUG=1005640

Change-Id: Ibc0b6d6cb592590e016d7a0795926d0b23478e40
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1851890Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Nancy Wang <nancylingwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#704814}
parent e6aca73c
......@@ -6,6 +6,7 @@
#include "ash/public/cpp/app_list/app_list_config.h"
#include "base/metrics/histogram_macros.h"
#include "chrome/browser/apps/app_service/app_service_metrics.h"
#include "chrome/browser/ui/app_list/app_list_model_updater.h"
#include "chrome/browser/ui/app_list/internal_app/internal_app_context_menu.h"
#include "chrome/browser/ui/app_list/internal_app/internal_app_metadata.h"
......@@ -14,15 +15,6 @@
// static
const char InternalAppItem::kItemType[] = "InternalAppItem";
// TODO(crbug.com/826982): move UMA_HISTOGRAM_ENUMERATION code to
// built_in_chromeos_apps.cc when the AppService feature is enabled by default.
// static
void InternalAppItem::RecordActiveHistogram(const std::string& app_id) {
app_list::InternalAppName name = app_list::GetInternalAppNameByAppId(app_id);
UMA_HISTOGRAM_ENUMERATION("Apps.AppListInternalApp.Activate", name);
}
InternalAppItem::InternalAppItem(
Profile* profile,
AppListModelUpdater* model_updater,
......@@ -49,7 +41,7 @@ const char* InternalAppItem::GetItemType() const {
}
void InternalAppItem::Activate(int event_flags) {
RecordActiveHistogram(id());
apps::RecordAppLaunch(id(), apps::mojom::LaunchSource::kFromAppListGrid);
app_list::OpenInternalApp(id(), profile(), event_flags);
}
......
......@@ -11,6 +11,7 @@
#include "base/bind.h"
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
#include "chrome/browser/apps/app_service/app_service_metrics.h"
#include "chrome/browser/chromeos/release_notes/release_notes_storage.h"
#include "chrome/browser/favicon/large_icon_service_factory.h"
#include "chrome/browser/profiles/profile.h"
......@@ -24,21 +25,6 @@
namespace app_list {
// TODO(crbug.com/826982): move UMA_HISTOGRAM_ENUMERATION code to
// built_in_chromeos_apps.cc when the AppService feature is enabled by default.
// static
void InternalAppResult::RecordShowHistogram(const std::string& app_id) {
InternalAppName name = GetInternalAppNameByAppId(app_id);
UMA_HISTOGRAM_ENUMERATION("Apps.AppListSearchResultInternalApp.Show", name);
}
// static
void InternalAppResult::RecordOpenHistogram(const std::string& app_id) {
InternalAppName name = GetInternalAppNameByAppId(app_id);
UMA_HISTOGRAM_ENUMERATION("Apps.AppListSearchResultInternalApp.Open", name);
}
InternalAppResult::InternalAppResult(Profile* profile,
const std::string& app_id,
AppListControllerDelegate* controller,
......@@ -76,7 +62,7 @@ InternalAppResult::InternalAppResult(Profile* profile,
SetPositionPriority(1.0f);
}
RecordShowHistogram(app_id);
apps::RecordBuiltInAppSearchResult(app_id);
}
InternalAppResult::~InternalAppResult() = default;
......@@ -86,7 +72,7 @@ void InternalAppResult::ExecuteLaunchCommand(int event_flags) {
}
void InternalAppResult::Open(int event_flags) {
RecordOpenHistogram(id());
apps::RecordAppLaunch(id(), apps::mojom::LaunchSource::kFromAppListQuery);
if (id() == ash::kInternalAppIdContinueReading &&
url_for_continuous_reading_.is_valid()) {
......
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