Skip to content

Commit

Permalink
Merge the last bits of ChromeTab into Tab.
Browse files Browse the repository at this point in the history
Chrome tab is GONE!

BUG=532216

Review URL: https://codereview.chromium.org/1388943003

Cr-Commit-Position: refs/heads/master@{#353335}
  • Loading branch information
aurimas authored and Commit bot committed Oct 9, 2015
1 parent 50f139e commit 385c3cc
Show file tree
Hide file tree
Showing 18 changed files with 360 additions and 560 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import org.chromium.chrome.browser.externalnav.ExternalNavigationDelegateImpl;
import org.chromium.chrome.browser.externalnav.ExternalNavigationHandler;
import org.chromium.chrome.browser.ssl.ConnectionSecurityLevel;
import org.chromium.chrome.browser.tab.ChromeTab;
import org.chromium.chrome.browser.tab.EmptyTabObserver;
import org.chromium.chrome.browser.tab.InterceptNavigationDelegateImpl;
import org.chromium.chrome.browser.tab.Tab;
Expand All @@ -46,7 +45,7 @@
/**
* A chrome tab that is only used as a custom tab.
*/
public class CustomTab extends ChromeTab {
public class CustomTab extends Tab {
private static class CustomTabObserver extends EmptyTabObserver {
private CustomTabsConnection mCustomTabsConnection;
private IBinder mSession;
Expand Down Expand Up @@ -164,8 +163,8 @@ public boolean startDownload(String url, boolean isLink) {
*/
public CustomTab(ChromeActivity activity, WindowAndroid windowAndroid, IBinder session,
String url, String referrer, int parentTabId, boolean enableUrlBarHiding) {
super(TabIdManager.getInstance().generateValidId(Tab.INVALID_TAB_ID), activity, false,
windowAndroid, TabLaunchType.FROM_EXTERNAL_APP, parentTabId, null, null);
super(TabIdManager.getInstance().generateValidId(Tab.INVALID_TAB_ID), parentTabId, false,
activity, windowAndroid, TabLaunchType.FROM_EXTERNAL_APP, null, null);
mEnableUrlBarHiding = enableUrlBarHiding;
CustomTabsConnection customTabsConnection =
CustomTabsConnection.getInstance(activity.getApplication());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import org.chromium.chrome.browser.WarmupManager;
import org.chromium.chrome.browser.WebContentsFactory;
import org.chromium.chrome.browser.compositor.layouts.content.TabContentManager;
import org.chromium.chrome.browser.tab.ChromeTab;
import org.chromium.chrome.browser.tab.EmptyTabObserver;
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.tab.TabObserver;
Expand All @@ -31,7 +30,7 @@
/**
* A Tab child class with Chrome documents specific functionality.
*/
public class DocumentTab extends ChromeTab {
public class DocumentTab extends Tab {
/**
* Observer class with extra calls specific to Chrome Documents
*/
Expand Down Expand Up @@ -61,8 +60,8 @@ protected void onFaviconReceived(Bitmap image) { }
*/
private DocumentTab(DocumentActivity activity, boolean incognito, WindowAndroid windowAndroid,
String url, int parentTabId, boolean initiallyHidden) {
super(ActivityDelegate.getTabIdFromIntent(activity.getIntent()), activity,
incognito, windowAndroid, TabLaunchType.FROM_EXTERNAL_APP, parentTabId, null, null);
super(ActivityDelegate.getTabIdFromIntent(activity.getIntent()), parentTabId, incognito,
activity, windowAndroid, TabLaunchType.FROM_EXTERNAL_APP, null, null);
mActivity = activity;
initialize(url, null, activity.getTabContentManager(), false, initiallyHidden);
}
Expand All @@ -78,8 +77,8 @@ private DocumentTab(DocumentActivity activity, boolean incognito, WindowAndroid
*/
private DocumentTab(DocumentActivity activity, boolean incognito,
WindowAndroid windowAndroid, String url, TabState tabState, int parentTabId) {
super(ActivityDelegate.getTabIdFromIntent(activity.getIntent()), activity,
incognito, windowAndroid, TabLaunchType.FROM_RESTORE, parentTabId, null, tabState);
super(ActivityDelegate.getTabIdFromIntent(activity.getIntent()), parentTabId, incognito,
activity, windowAndroid, TabLaunchType.FROM_RESTORE, null, tabState);
mActivity = activity;
initialize(url, null, activity.getTabContentManager(), true, false);
}
Expand All @@ -95,9 +94,8 @@ private DocumentTab(DocumentActivity activity, boolean incognito,
*/
private DocumentTab(DocumentActivity activity, boolean incognito,
WindowAndroid windowAndroid, String url, int parentTabId, WebContents webContents) {
super(ActivityDelegate.getTabIdFromIntent(activity.getIntent()), activity,
incognito, windowAndroid, TabLaunchType.FROM_LONGPRESS_FOREGROUND,
parentTabId, null, null);
super(ActivityDelegate.getTabIdFromIntent(activity.getIntent()), parentTabId, incognito,
activity, windowAndroid, TabLaunchType.FROM_LONGPRESS_FOREGROUND, null, null);
mActivity = activity;
initialize(url, webContents, activity.getTabContentManager(), false, false);
mCreatedFromWebContents = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import org.chromium.chrome.browser.infobar.InfoBar;
import org.chromium.chrome.browser.infobar.InfoBarContainer;
import org.chromium.chrome.browser.infobar.InfoBarContainer.InfoBarContainerObserver;
import org.chromium.chrome.browser.tab.ChromeTab;
import org.chromium.chrome.browser.tab.EmptyTabObserver;
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.components.dom_distiller.content.DistillablePageUtils;
Expand Down Expand Up @@ -67,11 +66,6 @@ public static interface ReaderModeManagerObserver {
*/
public static final int STARTED = 2;

/**
* JavaScript that can be executed to tell whether or not a page can be viewed in reader mode.
*/
private static final String sIsReadableJs = DomDistillerUrlUtils.getIsDistillableJs();

/**
* The url of the last page visited if the last page was reader mode page. Otherwise null.
*/
Expand Down Expand Up @@ -247,8 +241,7 @@ public ReaderModePanel getReaderModePanel() {
}

private ReaderModeActivityDelegate getReaderModeActivityDelegate() {
if (!(mTab instanceof ChromeTab)) return null;
return ((ChromeTab) mTab).getReaderModeActivityDelegate();
return mTab.getReaderModeActivityDelegate();
}

private WebContentsObserver createWebContentsObserver(WebContents webContents) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import org.chromium.chrome.browser.compositor.layouts.ChromeAnimation.Animatable;
import org.chromium.chrome.browser.compositor.layouts.eventfilter.EdgeSwipeEventFilter.ScrollDirection;
import org.chromium.chrome.browser.dom_distiller.ReaderModeButtonView.ReaderModeButtonViewDelegate;
import org.chromium.chrome.browser.tab.ChromeTab;
import org.chromium.chrome.browser.tab.EmptyTabObserver;
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.util.MathUtils;
Expand Down Expand Up @@ -845,8 +844,7 @@ public void onHideInfobarContainer() {
* @return The panel associated with a given Tab.
*/
public static ReaderModePanel getReaderModePanel(Tab tab) {
if (!(tab instanceof ChromeTab)) return null;
ReaderModeManager manager = ((ChromeTab) tab).getReaderModeManager();
ReaderModeManager manager = tab.getReaderModeManager();
if (manager == null) return null;
return manager.getReaderModePanel();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static RevenueStats getInstance() {
/**
* Notifies tab creation event.
*/
public void tabCreated(Tab chromeTab) {}
public void tabCreated(Tab tab) {}

/**
* Returns whether the RLZ provider has been notified that the first search has occurred.
Expand Down
Loading

0 comments on commit 385c3cc

Please sign in to comment.