OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chrome.browser.customtabs; | 5 package org.chromium.chrome.browser.customtabs; |
6 | 6 |
7 import android.content.Intent; | 7 import android.content.Intent; |
8 import android.os.Build; | 8 import android.os.Build; |
9 | 9 |
10 import org.chromium.base.ApiCompatibilityUtils; | 10 import org.chromium.base.ApiCompatibilityUtils; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 @Override | 62 @Override |
63 public void finishAndClose() { | 63 public void finishAndClose() { |
64 if (mDidFinishForReparenting) return; | 64 if (mDidFinishForReparenting) return; |
65 | 65 |
66 mDidFinishForReparenting = true; | 66 mDidFinishForReparenting = true; |
67 if (getCallingActivity() != null) { | 67 if (getCallingActivity() != null) { |
68 finish(); | 68 finish(); |
69 } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { | 69 } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { |
70 ApiCompatibilityUtils.finishAndRemoveTask(this); | 70 ApiCompatibilityUtils.finishAndRemoveTask(this); |
| 71 |
| 72 if (getIntentDataProvider() != null && getIntentDataProvider().isOpe
nedByChrome()) { |
| 73 overridePendingTransition(R.anim.no_anim, R.anim.slide_out_down)
; |
| 74 } |
71 } else { | 75 } else { |
72 // TODO(tedchoc): This does not work reliably :-/. Need to find a s
olution for the X | 76 // TODO(tedchoc): This does not work reliably :-/. Need to find a s
olution for the X |
73 // button and the Android back. Seems to only somewh
at work for the | 77 // button and the Android back. Seems to only somewh
at work for the |
74 // open in Chrome case. | 78 // open in Chrome case. |
75 Intent intent = new Intent(getIntent()); | 79 Intent intent = new Intent(getIntent()); |
76 intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); | 80 intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); |
77 startActivity(intent); | 81 startActivity(intent); |
78 overridePendingTransition(0, 0); | 82 overridePendingTransition(0, 0); |
79 } | 83 } |
80 } | 84 } |
81 } | 85 } |
OLD | NEW |