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

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

Issue 2233213002: [Android] Suppress javascript dialogs from background tabs in custom tab Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/customtabs/CustomTabDelegateFactory.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabDelegateFactory.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabDelegateFactory.java
index 690cc6c80ebd13f47793b4166dfe400f85d1a1b3..bdfab22c39b9d4a235423220aab03c9773c5c6c5 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabDelegateFactory.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabDelegateFactory.java
@@ -24,6 +24,7 @@ import org.chromium.chrome.browser.tab.TabDelegateFactory;
import org.chromium.chrome.browser.tab.TabWebContentsDelegateAndroid;
import org.chromium.chrome.browser.tab.TopControlsVisibilityDelegate;
import org.chromium.chrome.browser.util.UrlUtilities;
+import org.chromium.content_public.browser.WebContents;
/**
* A {@link TabDelegateFactory} class to be used in all {@link Tab} owned
@@ -129,6 +130,12 @@ public class CustomTabDelegateFactory extends TabDelegateFactory {
}
@Override
+ public boolean shouldSuppressDialogs(WebContents webContents) {
+ // If a tab is in the background, it should not be able to pop up a dialog.
+ return mTab.isHidden();
+ }
+
+ @Override
public boolean shouldResumeRequestsForCreatedWindow() {
return true;
}

Powered by Google App Engine
This is Rietveld 408576698