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

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

Issue 2319963002: Add workaround to remove elderberry tabs from recents (pre-L) (Closed)
Patch Set: Non-terrible version 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/customtabs/SeparateTaskManagedCustomTabActivity.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/SeparateTaskManagedCustomTabActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/SeparateTaskManagedCustomTabActivity.java
index 47c3cd2c0a4caa3f0eb4eb3bc8fa958a612b1fc1..4e69d004d240bc084ac486d037ff66003ef1ec76 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/SeparateTaskManagedCustomTabActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/SeparateTaskManagedCustomTabActivity.java
@@ -22,6 +22,8 @@ import org.chromium.chrome.browser.webapps.ActivityAssigner;
* limited number of activities that we will cycle through.
*/
public class SeparateTaskManagedCustomTabActivity extends SeparateTaskCustomTabActivity {
+ private static final String FORCE_FINISH = "CCT.ForceFinish";
+
// Time at which an intent was received and handled.
private long mIntentHandlingTimeMs = 0;
@@ -38,6 +40,10 @@ public class SeparateTaskManagedCustomTabActivity extends SeparateTaskCustomTabA
@Override
public void onNewIntent(Intent intent) {
mIntentHandlingTimeMs = SystemClock.uptimeMillis();
+ if (intent != null && intent.getBooleanExtra(FORCE_FINISH, false)) {
+ finish();
+ return;
+ }
super.onNewIntent(intent);
}
@@ -80,4 +86,13 @@ public class SeparateTaskManagedCustomTabActivity extends SeparateTaskCustomTabA
String indexString = className.substring(baseClassName.length());
return Integer.parseInt(indexString);
}
+
+ @Override
+ public void finishAndClose() {
+ Intent intent = new Intent(getIntent());
+ intent.setFlags(intent.getFlags() & ~Intent.FLAG_ACTIVITY_NEW_TASK);
+ intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
+ intent.putExtra(FORCE_FINISH, true);
+ startActivity(intent);
+ }
}
« 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