Skip to content

Commit

Permalink
AW: clean up unused detection flag (1/3)
Browse files Browse the repository at this point in the history
No change to logic. This flag is not currently in use, as we instead
opted to proceed with the SITE_BLOCK flag. This removes most references
to the switch, however we still need to leave the flag definition so
that downstream references can be safely cleaned up.

This is change #1/3.

Bug: 356234122
Test: autoninja -C out/Default system_webview_google_apk
Test: tools/autotest.py -C out/Default AwSupervisedUserTest
Change-Id: I8c1e84ccec844064fb6648d791776b1d2da00874
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6107741
Commit-Queue: Peter Pakkenberg <[email protected]>
Reviewed-by: Peter Pakkenberg <[email protected]>
Auto-Submit: Nate Fischer <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1401748}
  • Loading branch information
ntfschr-chromium authored and Chromium LUCI CQ committed Jan 3, 2025
1 parent 6a9d999 commit 7d6fcbf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -680,10 +680,6 @@ private ProductionSupportedFlagList() {}
AwFeatures.WEBVIEW_AUTO_SAA,
"Enable auto granting storage access API requests. This will be done "
+ "if a relationship is detected between the app and the website."),
Flag.baseFeature(
AwFeatures.WEBVIEW_SUPERVISED_USER_SITE_DETECTION,
"Enable detection of the loading of mature sites on "
+ "WebViews running on supervised user accounts"),
Flag.baseFeature(
AwFeatures.WEBVIEW_SUPERVISED_USER_SITE_BLOCK,
"Enable blocking the loading of mature sites on "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ public static AwSupervisedUserUrlClassifier getInstance() {

synchronized (sInstanceLock) {
if (!sInitialized) {
if (AwFeatureMap.isEnabled(AwFeatures.WEBVIEW_SUPERVISED_USER_SITE_DETECTION)
|| AwFeatureMap.isEnabled(AwFeatures.WEBVIEW_SUPERVISED_USER_SITE_BLOCK)) {
if (AwFeatureMap.isEnabled(AwFeatures.WEBVIEW_SUPERVISED_USER_SITE_BLOCK)) {
AwSupervisedUserUrlClassifierDelegate delegate =
PlatformServiceBridge.getInstance().getUrlClassifierDelegate();
if (delegate != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,7 @@ public void testDisallowedRedirectIsBlocked() throws Throwable {
@Test
@SmallTest
@Feature({"AndroidWebView"})
@CommandLineFlags.Add(
"disable-features="
+ AwFeatures.WEBVIEW_SUPERVISED_USER_SITE_BLOCK
+ ","
+ AwFeatures.WEBVIEW_SUPERVISED_USER_SITE_DETECTION)
@CommandLineFlags.Add("disable-features=" + AwFeatures.WEBVIEW_SUPERVISED_USER_SITE_BLOCK)
public void testDisallowedSiteIsLoadedFeatureOff() throws Throwable {
String embeddedUrl = setUpWebPage(MATURE_SITE_IFRAME_PATH, MATURE_SITE_IFRAME_TITLE, null);
String requestUrl = setUpWebPage(MATURE_SITE_PATH, MATURE_SITE_TITLE, embeddedUrl);
Expand Down Expand Up @@ -419,8 +415,7 @@ public AwSupervisedUserUrlClassifierDelegate getUrlClassifierDelegate() {
}

private void resetNeedsRestriction(boolean value) throws Exception {
if (!AwFeatureMap.isEnabled(AwFeatures.WEBVIEW_SUPERVISED_USER_SITE_DETECTION)
&& !AwFeatureMap.isEnabled(AwFeatures.WEBVIEW_SUPERVISED_USER_SITE_BLOCK)) {
if (!AwFeatureMap.isEnabled(AwFeatures.WEBVIEW_SUPERVISED_USER_SITE_BLOCK)) {
// Nothing we need to do if the feature is disabled.
return;
}
Expand Down

0 comments on commit 7d6fcbf

Please sign in to comment.