1 // Copyright 2019 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 package org.chromium.content.browser; 6 7 import org.chromium.base.annotations.JNINamespace; 8 import org.chromium.base.annotations.MainDex; 9 import org.chromium.base.annotations.NativeMethods; 10 11 /** 12 * Implementation of {@link ContentFeatureList}. 13 * Java accessor for base/feature_list.h state. 14 */ 15 @JNINamespace("content::android") 16 @MainDex 17 public class ContentFeatureListImpl { 18 /** 19 * Returns whether the specified feature is enabled or not. 20 * 21 * Note: Features queried through this API must be added to the array 22 * |kFeaturesExposedToJava| in content/browser/android/content_feature_list.cc 23 * 24 * @param featureName The name of the feature to query. 25 * @return Whether the feature is enabled or not. 26 */ isEnabled(String featureName)27 public static boolean isEnabled(String featureName) { 28 return ContentFeatureListImplJni.get().isEnabled(featureName); 29 } 30 31 @NativeMethods 32 public interface Natives { isEnabled(String featureName)33 boolean isEnabled(String featureName); 34 } 35 } 36