1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29

content / public / android / java / src / org / chromium / content_public / browser / ContentWebFeatureUsageUtils.java [blame]

// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.content_public.browser;

import org.jni_zero.JNINamespace;
import org.jni_zero.NativeMethods;

import org.chromium.blink.mojom.WebFeature;

/** A Java API for calling ContentBrowserClient::LogWebFeatureForCurrentPage(). */
@JNINamespace("content")
public class ContentWebFeatureUsageUtils {
    public static void logWebFeatureForCurrentPage(
            WebContents webContents, @WebFeature.EnumType int webFeature) {
        ContentWebFeatureUsageUtilsJni.get().logWebFeatureForCurrentPage(webContents, webFeature);
    }

    // If there's a need for a logWebDXFeatureForCurrentPage() in Java, there's
    // code for that included in
    // https://chromium-review.googlesource.com/c/chromium/src/+/5640502/11.

    @NativeMethods
    public interface Natives {
        void logWebFeatureForCurrentPage(
                WebContents webContents, @WebFeature.EnumType int webFeature);
    }
}