Index: chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java |
index 7b62c75822dcc747b7c9ebe8afdcdca01bf90521..c24c181056c46a5c80c7f9d59d9c2cab753f3cd4 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java |
@@ -13,6 +13,7 @@ import android.view.View.OnClickListener; |
import android.view.ViewGroup; |
import org.chromium.base.ApiCompatibilityUtils; |
+import org.chromium.base.Log; |
import org.chromium.base.VisibleForTesting; |
import org.chromium.base.metrics.RecordHistogram; |
import org.chromium.base.metrics.RecordUserAction; |
@@ -38,6 +39,7 @@ import org.chromium.content_public.browser.NavigationEntry; |
* The activity for custom tabs. It will be launched on top of a client's task. |
*/ |
public class CustomTabActivity extends ChromeActivity { |
+ private static final String TAG = "cr.CustomTabActivity"; |
private static CustomTabContentHandler sActiveContentHandler; |
private CustomTab mTab; |
@@ -70,6 +72,11 @@ public class CustomTabActivity extends ChromeActivity { |
public static boolean handleInActiveContentIfNeeded(Intent intent) { |
if (sActiveContentHandler == null) return false; |
+ if (sActiveContentHandler.shouldIgnoreIntent(intent)) { |
+ Log.w(TAG, "Incoming intent to Custom Tab was ignored."); |
+ return false; |
+ } |
+ |
long intentSessionId = intent.getLongExtra( |
CustomTabIntentDataProvider.EXTRA_CUSTOM_TABS_SESSION_ID, |
CustomTabIntentDataProvider.INVALID_SESSION_ID); |
@@ -180,6 +187,11 @@ public class CustomTabActivity extends ChromeActivity { |
public long getSessionId() { |
return mSessionId; |
} |
+ |
+ @Override |
+ public boolean shouldIgnoreIntent(Intent intent) { |
+ return mIntentHandler.shouldIgnoreIntent(CustomTabActivity.this, intent); |
+ } |
}; |
super.finishNativeInitialization(); |
} |