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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsCategory.java

Issue 2785913002: [subresource_filter] Add the Content Settings UI for Android (Closed)
Patch Set: guard via feature list Created 3 years, 9 months 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
Index: chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsCategory.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsCategory.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsCategory.java
index 3e66470c8ea03626a554b26b81877780632020a3..4261b235df12d649925abd8b1deb27c06d15f395 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsCategory.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsCategory.java
@@ -23,6 +23,7 @@ import android.text.style.ForegroundColorSpan;
import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.chrome.R;
+import org.chromium.chrome.browser.ChromeFeatureList;
import org.chromium.chrome.browser.ContentSettingsType;
import org.chromium.chrome.browser.preferences.PrefServiceBridge;
import org.chromium.ui.text.SpanApplier;
@@ -46,6 +47,7 @@ public class SiteSettingsCategory {
public static final String CATEGORY_PROTECTED_MEDIA = "protected_content";
public static final String CATEGORY_USE_STORAGE = "use_storage";
public static final String CATEGORY_USB = "usb";
+ public static final String CATEGORY_SUBRESOURCE_FILTER = "subresource_filter";
// The id of this category.
private String mCategory;
@@ -132,6 +134,10 @@ public class SiteSettingsCategory {
return new SiteSettingsCategory(
CATEGORY_USB, "", ContentSettingsType.CONTENT_SETTINGS_TYPE_USB_CHOOSER_DATA);
}
+ if (CATEGORY_SUBRESOURCE_FILTER.equals(category) && subresourceFilterCategoryEnabled()) {
+ return new SiteSettingsCategory(CATEGORY_SUBRESOURCE_FILTER, "",
+ ContentSettingsType.CONTENT_SETTINGS_TYPE_SUBRESOURCE_FILTER);
+ }
Finnur 2017/03/31 10:22:34 Move block to line 130 (alphabetical order).
Charlie Harrison 2017/03/31 13:21:42 Done.
return null;
}
@@ -176,6 +182,9 @@ public class SiteSettingsCategory {
if (contentSettingsType == ContentSettingsType.CONTENT_SETTINGS_TYPE_USB_CHOOSER_DATA) {
return fromString(CATEGORY_USB);
}
+ if (contentSettingsType == ContentSettingsType.CONTENT_SETTINGS_TYPE_SUBRESOURCE_FILTER) {
+ return fromString(CATEGORY_SUBRESOURCE_FILTER);
+ }
Finnur 2017/03/31 10:22:34 Move to line 182.
Charlie Harrison 2017/03/31 13:21:42 Done.
return null;
}
@@ -282,6 +291,20 @@ public class SiteSettingsCategory {
}
/**
+ * Returns whether this category is the Subresource Filter category.
+ */
+ public boolean showSubresourceFilterSites() {
+ return mContentSettingsType == ContentSettingsType.CONTENT_SETTINGS_TYPE_SUBRESOURCE_FILTER;
+ }
Finnur 2017/03/31 10:22:34 Move this block to line 286.
Charlie Harrison 2017/03/31 13:21:42 Done. Just the showSubresourceFilterSites method r
Finnur 2017/03/31 13:47:23 Yeah. Asthetically, I'd say the subresourceFilterC
+
+ /**
+ * Returns whether the Subresource Filter category is enabled via an experiment flag.
+ */
+ public static boolean subresourceFilterCategoryEnabled() {
+ return ChromeFeatureList.isEnabled("SubresourceFilterExperimentalUI");
+ }
+
+ /**
* Returns whether the current category is managed either by enterprise policy or by the
* custodian of a supervised account.
*/

Powered by Google App Engine
This is Rietveld 408576698