Commit b93ba372 authored by Jeffrey Cohen's avatar Jeffrey Cohen Committed by Chromium LUCI CQ

[Project Code Inclusion] Remove all uses of whitelist/blacklist in...

[Project Code Inclusion] Remove all uses of whitelist/blacklist in chrome/android/.../contextualsearch

Bug: 1151331
Change-Id: I73e1bc80116e40a43071d316dd2f72d9e882ffc0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2576955
Auto-Submit: Jeffrey Cohen <jeffreycohen@chromium.org>
Commit-Queue: Donn Denman <donnd@chromium.org>
Reviewed-by: default avatarDonn Denman <donnd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#834570}
parent c66f26e6
...@@ -105,8 +105,8 @@ public class ContextualSearchManager ...@@ -105,8 +105,8 @@ public class ContextualSearchManager
private static final String INTENT_URL_PREFIX = "intent:"; private static final String INTENT_URL_PREFIX = "intent:";
// We blacklist this URL because malformed URLs may bring up this page. // We denylist this URL because malformed URLs may bring up this page.
private static final String BLACKLISTED_URL = ContentUrlConstants.ABOUT_BLANK_DISPLAY_URL; private static final String DENYLISTED_URL = ContentUrlConstants.ABOUT_BLANK_DISPLAY_URL;
// How long to wait for a tap near a previous tap before hiding the UI or showing a re-Tap. // How long to wait for a tap near a previous tap before hiding the UI or showing a re-Tap.
// This setting is not critical: in practice it determines how long to wait after an invalid // This setting is not critical: in practice it determines how long to wait after an invalid
...@@ -830,7 +830,7 @@ public class ContextualSearchManager ...@@ -830,7 +830,7 @@ public class ContextualSearchManager
mLoadedSearchUrlTimeMs = System.currentTimeMillis(); mLoadedSearchUrlTimeMs = System.currentTimeMillis();
mLastSearchRequestLoaded = mSearchRequest; mLastSearchRequestLoaded = mSearchRequest;
String searchUrl = mSearchRequest.getSearchUrl(); String searchUrl = mSearchRequest.getSearchUrl();
ContextualSearchManagerJni.get().whitelistContextualSearchJsApiUrl( ContextualSearchManagerJni.get().allowlistContextualSearchJsApiUrl(
mNativeContextualSearchManagerPtr, this, searchUrl); mNativeContextualSearchManagerPtr, this, searchUrl);
mSearchPanel.loadUrlInPanel(searchUrl); mSearchPanel.loadUrlInPanel(searchUrl);
mDidStartLoadingResolvedSearchRequest = true; mDidStartLoadingResolvedSearchRequest = true;
...@@ -1191,7 +1191,7 @@ public class ContextualSearchManager ...@@ -1191,7 +1191,7 @@ public class ContextualSearchManager
* @param url The URL we are navigating to. * @param url The URL we are navigating to.
*/ */
public void onExternalNavigation(String url) { public void onExternalNavigation(String url) {
if (!mDidPromoteSearchNavigation && mSearchPanel != null && !BLACKLISTED_URL.equals(url) if (!mDidPromoteSearchNavigation && mSearchPanel != null && !DENYLISTED_URL.equals(url)
&& !url.startsWith(INTENT_URL_PREFIX) && shouldPromoteSearchNavigation()) { && !url.startsWith(INTENT_URL_PREFIX) && shouldPromoteSearchNavigation()) {
// Do not promote to a regular tab if we're loading our Resolved Search // Do not promote to a regular tab if we're loading our Resolved Search
// URL, otherwise we'll promote it when prefetching the Serp. // URL, otherwise we'll promote it when prefetching the Serp.
...@@ -1936,7 +1936,7 @@ public class ContextualSearchManager ...@@ -1936,7 +1936,7 @@ public class ContextualSearchManager
void gatherSurroundingText(long nativeContextualSearchManager, void gatherSurroundingText(long nativeContextualSearchManager,
ContextualSearchManager caller, ContextualSearchContext contextualSearchContext, ContextualSearchManager caller, ContextualSearchContext contextualSearchContext,
WebContents baseWebContents); WebContents baseWebContents);
void whitelistContextualSearchJsApiUrl( void allowlistContextualSearchJsApiUrl(
long nativeContextualSearchManager, ContextualSearchManager caller, String url); long nativeContextualSearchManager, ContextualSearchManager caller, String url);
void enableContextualSearchJsApiForWebContents(long nativeContextualSearchManager, void enableContextualSearchJsApiForWebContents(long nativeContextualSearchManager,
ContextualSearchManager caller, WebContents overlayWebContents); ContextualSearchManager caller, WebContents overlayWebContents);
......
...@@ -168,7 +168,7 @@ void ContextualSearchManager::EnableContextualSearchJsApiForWebContents( ...@@ -168,7 +168,7 @@ void ContextualSearchManager::EnableContextualSearchJsApiForWebContents(
overlay_web_contents, this); overlay_web_contents, this);
} }
void ContextualSearchManager::WhitelistContextualSearchJsApiUrl( void ContextualSearchManager::AllowlistContextualSearchJsApiUrl(
JNIEnv* env, JNIEnv* env,
jobject obj, jobject obj,
const base::android::JavaParamRef<jstring>& j_url) { const base::android::JavaParamRef<jstring>& j_url) {
......
...@@ -48,14 +48,14 @@ class ContextualSearchManager ...@@ -48,14 +48,14 @@ class ContextualSearchManager
const base::android::JavaParamRef<jobject>& j_contextual_search_context, const base::android::JavaParamRef<jobject>& j_contextual_search_context,
const base::android::JavaParamRef<jobject>& j_base_web_contents); const base::android::JavaParamRef<jobject>& j_base_web_contents);
// Whitelists the given |j_url| for injection of the Contextual Search // Allowlists the given |j_url| for injection of the Contextual Search
// JavaScript API. EnableContextualSearchJsApiForWebContents must also be // JavaScript API. EnableContextualSearchJsApiForWebContents must also be
// called with the WebContents that will host the page in the Overlay. // called with the WebContents that will host the page in the Overlay.
// This method should be called when the URL navigation starts so the // This method should be called when the URL navigation starts so the
// JavaScript API can be established before the page executes. // JavaScript API can be established before the page executes.
// The given URL is stored for future reference when ShouldEnableJsApi is // The given URL is stored for future reference when ShouldEnableJsApi is
// called by a Renderer through mojo. // called by a Renderer through mojo.
void WhitelistContextualSearchJsApiUrl( void AllowlistContextualSearchJsApiUrl(
JNIEnv* env, JNIEnv* env,
jobject obj, jobject obj,
const base::android::JavaParamRef<jstring>& j_url); const base::android::JavaParamRef<jstring>& j_url);
...@@ -64,7 +64,7 @@ class ContextualSearchManager ...@@ -64,7 +64,7 @@ class ContextualSearchManager
// This method should be called at least once for this Overlay Panel, and // This method should be called at least once for this Overlay Panel, and
// before any page loads in the Overlay so that the Contextual Search // before any page loads in the Overlay so that the Contextual Search
// JavaScript API can be injected into the Overlay Panel. // JavaScript API can be injected into the Overlay Panel.
// WhitelistContextualSearchJsApiUrl must also be called for every URL // AllowlistContextualSearchJsApiUrl must also be called for every URL
// that will be loaded, in order for the JavaScript API to be enabled for that // that will be loaded, in order for the JavaScript API to be enabled for that
// URL. // URL.
void EnableContextualSearchJsApiForWebContents( void EnableContextualSearchJsApiForWebContents(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment