| Index: chrome/android/java/src/org/chromium/chrome/browser/tabmodel/document/TabDelegate.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/document/TabDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/document/TabDelegate.java
|
| index bb6851f04678f08b7bc767acce58b828a32f8602..a66e03e0e1f08b4f3a5b79210c9bc75bcdd55a65 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/document/TabDelegate.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/document/TabDelegate.java
|
| @@ -7,15 +7,12 @@ package org.chromium.chrome.browser.tabmodel.document;
|
| import android.app.Activity;
|
| import android.content.Intent;
|
| import android.net.Uri;
|
| -import android.text.TextUtils;
|
|
|
| import org.chromium.base.ApiCompatibilityUtils;
|
| import org.chromium.base.ContextUtils;
|
| import org.chromium.chrome.browser.IntentHandler;
|
| import org.chromium.chrome.browser.TabState;
|
| -import org.chromium.chrome.browser.UrlConstants;
|
| import org.chromium.chrome.browser.document.ChromeLauncherActivity;
|
| -import org.chromium.chrome.browser.document.DocumentMetricIds;
|
| import org.chromium.chrome.browser.multiwindow.MultiWindowUtils;
|
| import org.chromium.chrome.browser.tab.Tab;
|
| import org.chromium.chrome.browser.tab.TabIdManager;
|
| @@ -60,29 +57,11 @@ public class TabDelegate extends TabCreator {
|
| @Override
|
| public boolean createTabWithWebContents(Tab parent, WebContents webContents, int parentId,
|
| TabLaunchType type, String url) {
|
| - return createTabWithWebContents(
|
| - webContents, parentId, type, url, DocumentMetricIds.STARTED_BY_WINDOW_OPEN);
|
| - }
|
| -
|
| - /**
|
| - * Creates a Tab to host the given WebContents asynchronously.
|
| - * @param webContents WebContents that has been pre-created.
|
| - * @param parentId ID of the parent Tab.
|
| - * @param type Launch type for the Tab.
|
| - * @param url URL that the WebContents was opened for.
|
| - * @param startedBy See {@link DocumentMetricIds}.
|
| - */
|
| - public boolean createTabWithWebContents(
|
| - WebContents webContents, int parentId, TabLaunchType type, String url, int startedBy) {
|
| if (url == null) url = "";
|
|
|
| - // TODO(dfalcantara): Does this transition make sense? (crbug.com/509886)
|
| - int pageTransition = startedBy == DocumentMetricIds.STARTED_BY_CHROME_HOME_RECENT_TABS
|
| - ? PageTransition.RELOAD : PageTransition.AUTO_TOPLEVEL;
|
| -
|
| AsyncTabCreationParams asyncParams =
|
| - new AsyncTabCreationParams(new LoadUrlParams(url, pageTransition), webContents);
|
| - asyncParams.setDocumentStartedBy(startedBy);
|
| + new AsyncTabCreationParams(
|
| + new LoadUrlParams(url, PageTransition.AUTO_TOPLEVEL), webContents);
|
| createNewTab(asyncParams, type, parentId);
|
| return true;
|
| }
|
| @@ -117,32 +96,6 @@ public class TabDelegate extends TabCreator {
|
| @Override
|
| public Tab createNewTab(LoadUrlParams loadUrlParams, TabLaunchType type, Tab parent) {
|
| AsyncTabCreationParams asyncParams = new AsyncTabCreationParams(loadUrlParams);
|
| -
|
| - // Figure out how the page will be launched.
|
| - if (TextUtils.equals(UrlConstants.NTP_URL, loadUrlParams.getUrl())) {
|
| - asyncParams.setDocumentLaunchMode(ChromeLauncherActivity.LAUNCH_MODE_RETARGET);
|
| - } else if (type == TabLaunchType.FROM_LONGPRESS_BACKGROUND) {
|
| - if (!parent.isIncognito() && mIsIncognito) {
|
| - // Incognito tabs opened from regular tabs open in the foreground for privacy
|
| - // concerns.
|
| - asyncParams.setDocumentLaunchMode(ChromeLauncherActivity.LAUNCH_MODE_FOREGROUND);
|
| - } else {
|
| - asyncParams.setDocumentLaunchMode(ChromeLauncherActivity.LAUNCH_MODE_AFFILIATED);
|
| - }
|
| - }
|
| -
|
| - // Classify the startup type.
|
| - if (parent != null && TextUtils.equals(UrlConstants.NTP_URL, parent.getUrl())) {
|
| - asyncParams.setDocumentStartedBy(
|
| - DocumentMetricIds.STARTED_BY_CHROME_HOME_MOST_VISITED);
|
| - } else if (type == TabLaunchType.FROM_LONGPRESS_BACKGROUND
|
| - || type == TabLaunchType.FROM_LONGPRESS_FOREGROUND) {
|
| - asyncParams.setDocumentStartedBy(DocumentMetricIds.STARTED_BY_CONTEXT_MENU);
|
| - } else if (type == TabLaunchType.FROM_CHROME_UI) {
|
| - asyncParams.setDocumentStartedBy(DocumentMetricIds.STARTED_BY_OPTIONS_MENU);
|
| - }
|
| -
|
| - // Tab is created aysnchronously. Can't return anything, yet.
|
| createNewTab(asyncParams, type, parent == null ? Tab.INVALID_TAB_ID : parent.getId());
|
| return null;
|
| }
|
| @@ -162,8 +115,7 @@ public class TabDelegate extends TabCreator {
|
| && asyncParams.getWebContents() != null);
|
|
|
| Intent intent = createNewTabIntent(asyncParams, parentId);
|
| - IntentHandler.startActivityForTrustedIntent(
|
| - intent, ContextUtils.getApplicationContext());
|
| + IntentHandler.startActivityForTrustedIntent(intent, ContextUtils.getApplicationContext());
|
| }
|
|
|
| private Intent createNewTabIntent(AsyncTabCreationParams asyncParams, int parentId) {
|
|
|