Commit 4fd85fc2 authored by Alexey Baskakov's avatar Alexey Baskakov Committed by Commit Bot

dpwa: Record AppList launch histograms for web apps on ChromeOS.

This mimics the missing logic from ExtensionAppsBase::Launch() method
specified for bookmark apps.

Note: We should not do RecordAppWindowLaunch because
web_app_launch_manager_->OpenApplication() does it.

Bug: 1062885
Change-Id: Ie5a444692b9de98087db899a73a139950cd537f9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2277367Reviewed-by: default avatarNancy Wang <nancylingwang@chromium.org>
Commit-Queue: Alexey Baskakov <loyso@chromium.org>
Cr-Commit-Position: refs/heads/master@{#784298}
parent 0ae74b0c
......@@ -8,6 +8,7 @@
#include <vector>
#include "base/callback.h"
#include "base/metrics/histogram_macros.h"
#include "chrome/browser/apps/app_service/app_launch_params.h"
#include "chrome/browser/apps/app_service/launch_utils.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
......@@ -25,6 +26,7 @@
#include "chrome/browser/web_applications/web_app_provider.h"
#include "chrome/browser/web_applications/web_app_registrar.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/extensions/extension_constants.h"
#include "components/content_settings/core/common/content_settings.h"
#include "components/content_settings/core/common/content_settings_pattern.h"
#include "components/content_settings/core/common/content_settings_types.h"
......@@ -225,7 +227,37 @@ void WebAppsBase::Launch(const std::string& app_id,
return;
}
// TODO(loyso): Record UMA_HISTOGRAM_ENUMERATION here based on launch_source.
switch (launch_source) {
case apps::mojom::LaunchSource::kUnknown:
case apps::mojom::LaunchSource::kFromParentalControls:
break;
case apps::mojom::LaunchSource::kFromAppListGrid:
case apps::mojom::LaunchSource::kFromAppListGridContextMenu:
UMA_HISTOGRAM_ENUMERATION("Extensions.AppLaunch",
extension_misc::APP_LAUNCH_APP_LIST_MAIN,
extension_misc::APP_LAUNCH_BUCKET_BOUNDARY);
break;
case apps::mojom::LaunchSource::kFromAppListQuery:
case apps::mojom::LaunchSource::kFromAppListQueryContextMenu:
UMA_HISTOGRAM_ENUMERATION("Extensions.AppLaunch",
extension_misc::APP_LAUNCH_APP_LIST_SEARCH,
extension_misc::APP_LAUNCH_BUCKET_BOUNDARY);
break;
case apps::mojom::LaunchSource::kFromAppListRecommendation:
case apps::mojom::LaunchSource::kFromShelf:
case apps::mojom::LaunchSource::kFromFileManager:
case apps::mojom::LaunchSource::kFromLink:
case apps::mojom::LaunchSource::kFromOmnibox:
case apps::mojom::LaunchSource::kFromChromeInternal:
case apps::mojom::LaunchSource::kFromKeyboard:
case apps::mojom::LaunchSource::kFromOtherApp:
case apps::mojom::LaunchSource::kFromMenu:
case apps::mojom::LaunchSource::kFromInstalledNotification:
case apps::mojom::LaunchSource::kFromTest:
case apps::mojom::LaunchSource::kFromArc:
break;
}
web_app::DisplayMode display_mode =
GetRegistrar()->GetAppEffectiveDisplayMode(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