Yao Xiao | 65002fb8 | 2023-11-03 22:37:54 | [diff] [blame] | 1 | // 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 | |
| 10 | namespace content { |
| 11 | |
| 12 | class RenderFrameHostImpl; |
| 13 | |
Yao Xiao | e0cdf10 | 2024-02-21 23:12:00 | [diff] [blame] | 14 | // 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. |
| 20 | void MaybeRecordAdClickMainFrameNavigationMetrics( |
Yao Xiao | 65002fb8 | 2023-11-03 22:37:54 | [diff] [blame] | 21 | 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_ |