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

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

Issue 1223023002: Check whether a second intent should be ignored in custom tabs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed compile error Created 5 years, 5 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
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabContentHandler.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabContentHandler.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698