1 // Copyright 2018 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_UKM_APP_SOURCE_URL_RECORDER_H_
6 #define COMPONENTS_UKM_APP_SOURCE_URL_RECORDER_H_
8 #include "services/metrics/public/cpp/ukm_source_id.h"
10 #include "base/feature_list.h"
17 class AppLaunchEventLogger;
22 const base::Feature kUkmAppLogging{"UkmAppLogging",
23 base::FEATURE_ENABLED_BY_DEFAULT};
25 class AppSourceUrlRecorder {
27 friend class AppSourceUrlRecorderTest;
29 friend class app_list::AppLaunchEventLogger;
31 // Get a UKM SourceId for a Chrome app.
32 static SourceId GetSourceIdForChromeApp(const std::string& id);
34 // Get a UKM SourceId for an Arc app.
35 static SourceId GetSourceIdForArc(const std::string& package_name);
37 // Get a UKM SourceId for a PWA.
38 static SourceId GetSourceIdForPWA(const GURL& url);
40 // For internal use only.
41 static SourceId GetSourceIdForUrl(const GURL& url);
46 #endif // COMPONENTS_UKM_APP_SOURCE_URL_RECORDER_H_