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

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

Issue 2371003003: Remove non-elderberry herb flavors. (Closed)
Patch Set: Rebase 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
Index: chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
index 2c02d1a5c8f771bf5756a64119446ed6b37b513e..c2181202e3520e892c56673f22871516a4d98950 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
@@ -35,8 +35,6 @@ import org.chromium.base.metrics.RecordUserAction;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.ChromeActivity;
import org.chromium.chrome.browser.ChromeFeatureList;
-import org.chromium.chrome.browser.ChromeSwitches;
-import org.chromium.chrome.browser.ChromeTabbedActivity;
import org.chromium.chrome.browser.IntentHandler;
import org.chromium.chrome.browser.IntentHandler.ExternalAppId;
import org.chromium.chrome.browser.KeyboardShortcuts;
@@ -62,7 +60,6 @@ import org.chromium.chrome.browser.tabmodel.TabModelSelectorImpl;
import org.chromium.chrome.browser.tabmodel.TabPersistencePolicy;
import org.chromium.chrome.browser.toolbar.ToolbarControlContainer;
import org.chromium.chrome.browser.util.ColorUtils;
-import org.chromium.chrome.browser.util.FeatureUtilities;
import org.chromium.chrome.browser.util.UrlUtilities;
import org.chromium.chrome.browser.widget.findinpage.FindToolbarManager;
import org.chromium.components.dom_distiller.core.DomDistillerUrlUtils;
@@ -76,9 +73,6 @@ import org.chromium.ui.base.WindowAndroid;
* The activity for custom tabs. It will be launched on top of a client's task.
*/
public class CustomTabActivity extends ChromeActivity {
- public static final int RESULT_BACK_PRESSED = 1;
- public static final int RESULT_STOPPED = 2;
- public static final int RESULT_CLOSED = 3;
private static final String TAG = "CustomTabActivity";
private static final String LAST_URL_PREF = "pref_last_custom_tab_url";
@@ -246,15 +240,6 @@ public class CustomTabActivity extends ChromeActivity {
@Override
public void onStop() {
- // This happens before super.onStop() to maximize chances of getting the Tab while it's
- // alive.
- // TODO(dfalcantara): Once this is addressed on M50, consider transferring the Tab directly
- // via Tab reparenting.
- if (mIntentDataProvider.isOpenedByChrome() && isHerbResultNeeded()) {
- createHerbResultIntent(RESULT_STOPPED);
- finish();
- }
-
super.onStop();
CustomTabsConnection.getInstance(getApplication())
.dontKeepAliveForSession(mIntentDataProvider.getSession());
@@ -372,9 +357,6 @@ public class CustomTabActivity extends ChromeActivity {
new OnClickListener() {
@Override
public void onClick(View v) {
- if (mIntentDataProvider.isOpenedByChrome() && isHerbResultNeeded()) {
- createHerbResultIntent(RESULT_CLOSED);
- }
RecordUserAction.record("CustomTabs.CloseButtonClicked");
finishAndClose();
}
@@ -677,9 +659,6 @@ public class CustomTabActivity extends ChromeActivity {
if (getCurrentTabModel().getCount() > 1) {
getCurrentTabModel().closeTab(getActivityTab(), false, false, false);
} else {
- if (mIntentDataProvider.isOpenedByChrome() && isHerbResultNeeded()) {
- createHerbResultIntent(RESULT_BACK_PRESSED);
- }
finishAndClose();
}
}
@@ -861,44 +840,6 @@ public class CustomTabActivity extends ChromeActivity {
}
/**
- * @return Whether {@link ChromeTabbedActivity} is waiting for a result from this Activity.
- */
- private boolean isHerbResultNeeded() {
- if (!TextUtils.equals(FeatureUtilities.getHerbFlavor(), ChromeSwitches.HERB_FLAVOR_DILL)) {
- return false;
- }
-
- String callingActivity =
- getCallingActivity() == null ? null : getCallingActivity().getClassName();
- return TextUtils.equals(callingActivity, ChromeTabbedActivity.class.getName());
- }
-
- /**
- * Lets the original Activity know how this {@link CustomTabActivity} was finished.
- */
- private void createHerbResultIntent(int result) {
- if (getActivityTab() == null) return;
- Intent resultIntent = new Intent();
-
- switch (result) {
- case RESULT_STOPPED:
- // Send the URL to the browser. Should pass the Tab in the future.
- resultIntent.setAction(Intent.ACTION_VIEW);
- resultIntent.setData(Uri.parse(getActivityTab().getUrl()));
- break;
-
- case RESULT_BACK_PRESSED:
- case RESULT_CLOSED:
- break;
-
- default:
- assert false;
- }
-
- setResult(result, resultIntent);
- }
-
- /**
* @return The URL that should be used from this intent. If it is a WebLite url, it may be
* overridden if the Data Reduction Proxy is using Lo-Fi previews.
*/

Powered by Google App Engine
This is Rietveld 408576698