#include "chrome/browser/web_applications/install_bounce_metric.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/string_number_conversions.h"
#include "chrome/common/pref_names.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/scoped_user_pref_update.h"
#include "content/public/browser/browser_thread.h"
namespace {
std::optional<base::Time>& GetTimeOverride() { … }
base::Time GetTime() { … }
std::optional<base::Time> ParseTime(const base::Value* value) { … }
base::Value SerializeTime(const base::Time& time) { … }
const char kInstallTimestamp[] = …;
const char kInstallSource[] = …;
struct InstallMetrics { … };
std::optional<InstallMetrics> ParseInstallMetricsFromPrefs(
const PrefService* pref_service,
const webapps::AppId& app_id) { … }
void WriteInstallMetricsToPrefs(const InstallMetrics& install_metrics,
PrefService* pref_service,
const webapps::AppId& app_id) { … }
}
namespace web_app {
void SetInstallBounceMetricTimeForTesting(std::optional<base::Time> time) { … }
void RegisterInstallBounceMetricProfilePrefs(PrefRegistrySimple* registry) { … }
void RecordWebAppInstallationTimestamp(
PrefService* pref_service,
const webapps::AppId& app_id,
webapps::WebappInstallSource install_source) { … }
void RecordWebAppUninstallation(PrefService* pref_service,
const webapps::AppId& app_id) { … }
}