blob: 52db2d79d69c55331fb9222d8a27a4b27446f5af [file] [log] [blame]
// Copyright 2025 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_WAAP_WAAP_UTILS_H_
#define CHROME_BROWSER_UI_WAAP_WAAP_UTILS_H_
#include "url/gurl.h"
// Returns true if the given URL is the initial WebUI scheme.
// This is only relevant on non-Android platforms.
// TODO(crbug.com/448794588): Some callers of this function assume that
// `WaapUIMetricsService` is available when this returns true. This
// assumption is no longer valid as the service is now gated by
// features::kInitialWebUIMetrics. Introduce a new helper function,
// e.g., ShouldLogMetricsForInitialWebUI(), that checks
// features::kInitialWebUIMetrics and update those callers.
bool IsForInitialWebUI(const GURL& url);
// Returns true if the WaapUIMetricsService and related metrics logging are
// enabled.
// This is intentionally separate from IsForInitialWebUI() because when enabled,
// the UI metrics should be logged for the UI views that are relevant to WaaP
// experiment, which includes both the existing C++ version (not a InitialWebUI)
// and the WebUI version.
bool IsInitialWebUIMetricsLoggingEnabled();
#endif // CHROME_BROWSER_UI_WAAP_WAAP_UTILS_H_