| 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.SystemClock; | 8 import android.os.SystemClock; |
| 9 | 9 |
| 10 import org.chromium.chrome.browser.IntentHandler.IntentHandlerDelegate; | 10 import org.chromium.chrome.browser.IntentHandler.IntentHandlerDelegate; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 private int getActivityIndex() { | 81 private int getActivityIndex() { |
| 82 // Cull out the activity index from the class name. | 82 // Cull out the activity index from the class name. |
| 83 String baseClassName = SeparateTaskCustomTabActivity.class.getSimpleName
(); | 83 String baseClassName = SeparateTaskCustomTabActivity.class.getSimpleName
(); |
| 84 String className = this.getClass().getSimpleName(); | 84 String className = this.getClass().getSimpleName(); |
| 85 assert className.matches("^" + baseClassName + "[0-9]+$"); | 85 assert className.matches("^" + baseClassName + "[0-9]+$"); |
| 86 String indexString = className.substring(baseClassName.length()); | 86 String indexString = className.substring(baseClassName.length()); |
| 87 return Integer.parseInt(indexString); | 87 return Integer.parseInt(indexString); |
| 88 } | 88 } |
| 89 | 89 |
| 90 @Override | 90 @Override |
| 91 public void finishAndClose() { | 91 protected void handleFinishAndClose() { |
| 92 Intent intent = new Intent(getIntent()); | 92 Intent intent = new Intent(getIntent()); |
| 93 intent.setFlags(intent.getFlags() & ~Intent.FLAG_ACTIVITY_NEW_TASK); | 93 intent.setFlags(intent.getFlags() & ~Intent.FLAG_ACTIVITY_NEW_TASK); |
| 94 intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); | 94 intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); |
| 95 intent.putExtra(FORCE_FINISH, true); | 95 intent.putExtra(FORCE_FINISH, true); |
| 96 startActivity(intent); | 96 startActivity(intent); |
| 97 } | 97 } |
| 98 } | 98 } |
| OLD | NEW |