Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1523)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java

Issue 1538573004: Expose a Java API for base/feature_list.h. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add namespace. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/android/chrome_feature_list.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java
new file mode 100644
index 0000000000000000000000000000000000000000..b3498e2e4f7f2c687b97918565813f138d68612c
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java
@@ -0,0 +1,33 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser;
+
+import org.chromium.base.annotations.JNINamespace;
+import org.chromium.base.annotations.MainDex;
+
+/**
+ * Java accessor for base/feature_list.h state.
+ */
+@JNINamespace("chrome::android")
+@MainDex
+public abstract class ChromeFeatureList {
+ // Prevent instantiation.
+ private ChromeFeatureList() {}
+
+ /**
+ * Returns whether the specified feature is enabled or not.
+ *
+ * Note: Features queried through this API must be added to the array
+ * |kFeaturesExposedToJava| in chrome/browser/android/chrome_feature_list.cc
+ *
+ * @param featureName The name of the feature to query.
+ * @return Whether the feature is enabled or not.
+ */
+ public static boolean isEnabled(String featureName) {
+ return nativeIsEnabled(featureName);
+ }
+
+ private static native boolean nativeIsEnabled(String featureName);
+}
« no previous file with comments | « no previous file | chrome/browser/android/chrome_feature_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698