Index: chrome/android/java/src/org/chromium/chrome/browser/customtabs/SeparateTaskCustomTabActivity.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/SeparateTaskCustomTabActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/SeparateTaskCustomTabActivity.java |
index a52a2a1092ca99ce221f3c24797740181303e7c8..9b88bea208d4900b24327b7904048b2e7394fa21 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/SeparateTaskCustomTabActivity.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/SeparateTaskCustomTabActivity.java |
@@ -4,7 +4,6 @@ |
package org.chromium.chrome.browser.customtabs; |
-import android.content.Intent; |
import android.os.Build; |
import org.chromium.base.ApiCompatibilityUtils; |
@@ -16,26 +15,9 @@ import org.chromium.chrome.browser.ActivityTabTaskDescriptionHelper; |
* separate task. |
*/ |
public class SeparateTaskCustomTabActivity extends CustomTabActivity { |
- |
- private boolean mDidFinishForReparenting; |
private ActivityTabTaskDescriptionHelper mTaskDescriptionHelper; |
@Override |
- public void preInflationStartup() { |
- Intent intent = getIntent(); |
- if (intent != null |
- && (intent.getFlags() & Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) != 0) { |
- // TODO(tedchoc): Less hacky town. |
- // This is removed in onDestroy and complains if it is not added, so we just add it |
- // as a temporary work around. |
- getChromeApplication().addPolicyChangeListener(this); |
- finish(); |
- return; |
- } |
- super.preInflationStartup(); |
- } |
- |
- @Override |
public void finishNativeInitialization() { |
super.finishNativeInitialization(); |
@@ -46,13 +28,6 @@ public class SeparateTaskCustomTabActivity extends CustomTabActivity { |
} |
@Override |
- public void onStop() { |
- super.onStop(); |
- |
- mDidFinishForReparenting = false; |
- } |
- |
- @Override |
protected void onDestroyInternal() { |
super.onDestroyInternal(); |
@@ -61,25 +36,6 @@ public class SeparateTaskCustomTabActivity extends CustomTabActivity { |
@Override |
public void finishAndClose() { |
- if (mDidFinishForReparenting) return; |
- |
- mDidFinishForReparenting = true; |
- if (getCallingActivity() != null) { |
- finish(); |
- } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { |
- ApiCompatibilityUtils.finishAndRemoveTask(this); |
- |
- if (getIntentDataProvider() != null && getIntentDataProvider().isOpenedByChrome()) { |
- overridePendingTransition(R.anim.no_anim, R.anim.slide_out_down); |
- } |
- } else { |
- // TODO(tedchoc): This does not work reliably :-/. Need to find a solution for the X |
- // button and the Android back. Seems to only somewhat work for the |
- // open in Chrome case. |
- Intent intent = new Intent(getIntent()); |
- intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); |
- startActivity(intent); |
- overridePendingTransition(0, 0); |
- } |
+ ApiCompatibilityUtils.finishAndRemoveTask(this); |
} |
} |