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

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

Issue 2357023002: Do not lose CCTs as part of FRE. (Closed)
Patch Set: Created 4 years, 3 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 | no next file » | 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/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 8b524108956e943a12ad1fe97aa6a4842fae6794..799ba6adf2cec0c199dddc718c3fecc40c0002f7 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
@@ -363,8 +363,8 @@ public class ChromeLauncherActivity extends Activity
// current URL and not the URL that it was triggered with.
if (TextUtils.equals(
FeatureUtilities.getHerbFlavor(), ChromeSwitches.HERB_FLAVOR_ELDERBERRY)
- && (newIntent.getFlags() & Intent.FLAG_ACTIVITY_NEW_TASK) != 0
- || (newIntent.getFlags() & Intent.FLAG_ACTIVITY_NEW_DOCUMENT) != 0) {
+ && ((newIntent.getFlags() & Intent.FLAG_ACTIVITY_NEW_TASK) != 0
+ || (newIntent.getFlags() & Intent.FLAG_ACTIVITY_NEW_DOCUMENT) != 0)) {
String uuid = UUID.randomUUID().toString();
newIntent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
newIntent.setFlags(
@@ -419,6 +419,15 @@ public class ChromeLauncherActivity extends Activity
newIntent.setAction(Intent.ACTION_VIEW);
newIntent.setClassName(context, CustomTabActivity.class.getName());
newIntent.setData(uri);
+
+ // If a CCT intent triggers First Run, then NEW_TASK will be automatically applied. As
+ // part of that, it will inherit the EXCLUDE_FROM_RECENTS bit from ChromeLauncherActivity,
+ // so explicitly remove it to ensure the CCT does not get lost in recents.
+ if ((newIntent.getFlags() & Intent.FLAG_ACTIVITY_NEW_TASK) != 0
+ || (newIntent.getFlags() & Intent.FLAG_ACTIVITY_NEW_DOCUMENT) != 0) {
+ newIntent.setFlags(
+ newIntent.getFlags() & ~Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
+ }
if (addHerbExtras) updateHerbIntent(context, newIntent, uri);
return newIntent;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698