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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/document/ChromeLauncherActivity.java

Issue 1658723007: Prototype handling of Intents in Custom Tabs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved preference code Created 4 years, 11 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/document/ChromeLauncherActivity.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/document/ChromeLauncherActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/document/ChromeLauncherActivity.java
index 8f65f963a0fff3a6728583c434fb23cfdb755488..c9ca2bba06acedf337e4034e5c55eab92a1f46bb 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/document/ChromeLauncherActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/document/ChromeLauncherActivity.java
@@ -279,7 +279,19 @@ public class ChromeLauncherActivity extends Activity
* @return Whether the intent sent is for launching a Custom Tab.
*/
private boolean isCustomTabIntent() {
- if (getIntent() == null || !getIntent().hasExtra(CustomTabsIntent.EXTRA_SESSION)) {
+ boolean isHerbyIntent = ChromePreferenceManager.getInstance(this).isHerbEnabled();
+ if (isHerbyIntent) {
+ boolean isViewIntent = TextUtils.equals(getIntent().getAction(), Intent.ACTION_VIEW);
+ boolean isSameTask = (getIntent().getFlags() & Intent.FLAG_ACTIVITY_NEW_TASK) == 0;
+ boolean isSameDocument =
+ (getIntent().getFlags() & Intent.FLAG_ACTIVITY_NEW_DOCUMENT) == 0;
+ isHerbyIntent = isViewIntent && isSameTask && isSameDocument;
+ Log.d(TAG, "Herb Intent proprties -- VIEW: " + isViewIntent + ", SAME TASK: "
+ + isSameTask + ", SAME DOCUMENT: " + isSameDocument);
+ }
+
+ if (getIntent() == null || (!getIntent().hasExtra(CustomTabsIntent.EXTRA_SESSION)
+ && !isHerbyIntent)) {
return false;
}

Powered by Google App Engine
This is Rietveld 408576698