blob: d655df266ffeec8071aee2aa39241e35780bb89f [file] [log] [blame]
Yao Xiao65002fb82023-11-03 22:37:541// Copyright 2023 The Chromium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CONTENT_BROWSER_RENDERER_HOST_NAVIGATION_METRICS_UTILS_H_
6#define CONTENT_BROWSER_RENDERER_HOST_NAVIGATION_METRICS_UTILS_H_
7
8#include "third_party/blink/public/mojom/navigation/navigation_initiator_activation_and_ad_status.mojom.h"
9
10namespace content {
11
12class RenderFrameHostImpl;
13
Yao Xiaoe0cdf102024-02-21 23:12:0014// Records the AdClickMainFrameNavigation use counter for `initiator_frame`, and
15// records the Navigation.MainFrame.FromAdClick UMA, if
16// `initiator_activation_and_ad_status` indicates that the navigation is from an
17// ad click. Precondition: The navigation is targeting the outermost main frame.
18// It's only necessary to call this function for renderer-initiated navigations,
19// as browser-initiated navigations can never be initiated from ad.
20void MaybeRecordAdClickMainFrameNavigationMetrics(
Yao Xiao65002fb82023-11-03 22:37:5421 RenderFrameHostImpl* initiator_frame,
22 blink::mojom::NavigationInitiatorActivationAndAdStatus
23 initiator_activation_and_ad_status);
24
25} // namespace content
26
27#endif // CONTENT_BROWSER_RENDERER_HOST_NAVIGATION_METRICS_UTILS_H_