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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/tabmodel/document/TabDelegate.java

Issue 1176943002: Start unifying document-mode and tabbed-mode tab creation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment Created 5 years, 6 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/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 1bc89862bf44b0bfc297fce043ff9fe9fd0a3dd7..aae8306d29df061797cbdcc659f5575107a8d8ad 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,51 +7,29 @@ package org.chromium.chrome.browser.tabmodel.document;
import android.app.Activity;
import org.chromium.chrome.browser.Tab;
-import org.chromium.chrome.browser.document.PendingDocumentData;
-import org.chromium.chrome.browser.tabmodel.document.DocumentTabModel.Entry;
-import org.chromium.content_public.browser.LoadUrlParams;
+import org.chromium.chrome.browser.tabmodel.TabCreatorManager.TabCreator;
+import org.chromium.chrome.browser.tabmodel.TabModel.TabLaunchType;
import org.chromium.content_public.browser.WebContents;
/**
* Provides Tabs to a DocumentTabModel.
- * TODO(dfalcantara): Make this a TabCreatorManager.TabCreator subclass.
*/
-public interface TabDelegate {
+public interface TabDelegate extends TabCreator {
/**
* Returns the Tab for the given Activity.
- * @param incognito Whether the Activity is supposed to hold an incognito Tab.
- * @param delgate Sotres information about DocumentActivities.
+ * @param delgate Stores information about DocumentActivities.
* @param activity Activity to grab the Tab of.
* @return Tab for the DocumentActivity, if it is a valid DocumentActivity. Null otherwise.
*/
- Tab getActivityTab(boolean incognito, ActivityDelegate delgate, Activity activity);
+ Tab getActivityTab(ActivityDelegate activityDelegate, Activity activity);
/**
- * Opens a new Tab in the foreground.
- * Assumed to be triggered by a window.open().
+ * Creates a Tab to host the given WebContents.
+ * @param webContents WebContents that has been pre-created.
+ * @param parentId ID of the parent Tab.
+ * @param type Launch type for the Tab.
+ * @param startedBy See {@link DocumentMetricIds}.
*/
- void createTabInForeground(Activity parentActivity, boolean incognito,
- LoadUrlParams loadUrlParams, PendingDocumentData documentParams);
-
- /**
- * Creates a frozen Tab for the Entry. This Tab is not meant to be used or unfrozen -- it is
- * only used as a placeholder until the real Tab can be created.
- * @param entry Entry containing TabState.
- * @return A frozen Tab.
- */
- Tab createFrozenTab(Entry entry);
-
- /**
- * Creates a new Activity for the pre-created WebContents.
- * @param isIncognito Whether the Activity is supposed to hold an incognito Tab.
- * @param webContents WebContents to use with the new Tab.
- * @param parentTabId ID of the spawning Tab.
- */
- void createTabWithWebContents(boolean isIncognito, WebContents webContents, int parentTabId);
-
- /**
- * Creates a new Tab for a URL typed into DevTools.
- * @param url URL to spawn a Tab for.
- */
- void createTabForDevTools(String url);
+ Tab createTabWithWebContents(
+ WebContents webContents, int parentId, TabLaunchType type, int startedBy);
}

Powered by Google App Engine
This is Rietveld 408576698