diff options
author | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-28 16:23:53 +0000 |
---|---|---|
committer | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-28 16:23:53 +0000 |
commit | 4166ddc69b51a5ba7002c5402386ecf950e6f014 (patch) | |
tree | 5897693c65489b908b1671ca187965ed67ab8e62 | |
parent | 05e70d35f68944e90f6ae0f829b2d32c49621e95 (diff) | |
download | chromium_src-4166ddc69b51a5ba7002c5402386ecf950e6f014.zip chromium_src-4166ddc69b51a5ba7002c5402386ecf950e6f014.tar.gz chromium_src-4166ddc69b51a5ba7002c5402386ecf950e6f014.tar.bz2 |
[Android] Rename TabBase to Tab
BUG=339423
Review URL: https://codereview.chromium.org/148523013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@254147 0039d316-1c4b-4281-b951-d872f2087c98
22 files changed, 197 insertions, 196 deletions
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/EmptyTabObserver.java b/chrome/android/java/src/org/chromium/chrome/browser/EmptyTabObserver.java index 24c7d6a..c7b6384 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/EmptyTabObserver.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/EmptyTabObserver.java @@ -12,36 +12,36 @@ import android.view.ContextMenu; public class EmptyTabObserver implements TabObserver { @Override - public void onDestroyed(TabBase tab) { } + public void onDestroyed(Tab tab) { } @Override - public void onContentChanged(TabBase tab) { } + public void onContentChanged(Tab tab) { } @Override - public void onFaviconUpdated(TabBase tab) { } + public void onFaviconUpdated(Tab tab) { } @Override - public void onTitleUpdated(TabBase tab) { } + public void onTitleUpdated(Tab tab) { } @Override - public void onUrlUpdated(TabBase tab) { } + public void onUrlUpdated(Tab tab) { } @Override - public void onWebContentsSwapped(TabBase tab, boolean didStartLoad, boolean didFinishLoad) { } + public void onWebContentsSwapped(Tab tab, boolean didStartLoad, boolean didFinishLoad) { } @Override - public void onContextMenuShown(TabBase tab, ContextMenu menu) { } + public void onContextMenuShown(Tab tab, ContextMenu menu) { } @Override - public void onLoadProgressChanged(TabBase tab, int progress) { } + public void onLoadProgressChanged(Tab tab, int progress) { } @Override - public void onUpdateUrl(TabBase tab, String url) { } + public void onUpdateUrl(Tab tab, String url) { } @Override - public void onToggleFullscreenMode(TabBase tab, boolean enable) { } + public void onToggleFullscreenMode(Tab tab, boolean enable) { } @Override - public void onDidFailLoad(TabBase tab, boolean isProvisionalLoad, boolean isMainFrame, + public void onDidFailLoad(Tab tab, boolean isProvisionalLoad, boolean isMainFrame, int errorCode, String description, String failingUrl) { } } diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ForeignSessionHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/ForeignSessionHelper.java index e616624..83df88f 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ForeignSessionHelper.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ForeignSessionHelper.java @@ -186,7 +186,7 @@ public class ForeignSessionHelper { * @param windowOpenDisposition The WindowOpenDisposition flag. * @return {@code True} iff the tab is successfully opened. */ - public boolean openForeignSessionTab(TabBase tab, ForeignSession session, + public boolean openForeignSessionTab(Tab tab, ForeignSession session, ForeignSessionTab foreignTab, int windowOpenDisposition) { return nativeOpenForeignSessionTab(mNativeForeignSessionHelper, tab, session.tag, foreignTab.id, windowOpenDisposition); @@ -211,7 +211,7 @@ public class ForeignSessionHelper { private static native boolean nativeGetForeignSessions(long nativeForeignSessionHelper, List<ForeignSession> resultSessions); private static native boolean nativeOpenForeignSessionTab( - long nativeForeignSessionHelper, TabBase tab, String sessionTag, int tabId, + long nativeForeignSessionHelper, Tab tab, String sessionTag, int tabId, int disposition); private static native void nativeDeleteForeignSession( long nativeForeignSessionHelper, String sessionTag); diff --git a/chrome/android/java/src/org/chromium/chrome/browser/RecentlyClosedBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/RecentlyClosedBridge.java index 6eb92f6..ce6bdb0 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/RecentlyClosedBridge.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/RecentlyClosedBridge.java @@ -97,11 +97,11 @@ public class RecentlyClosedBridge { /** * Opens a recently closed tab in the current tab. * - * @param tab The current TabBase. + * @param tab The current Tab. * @param recentTab The RecentlyClosedTab to open. * @return Whether the tab was successfully opened. */ - public boolean openRecentlyClosedTab(TabBase tab, RecentlyClosedTab recentTab) { + public boolean openRecentlyClosedTab(Tab tab, RecentlyClosedTab recentTab) { return nativeOpenRecentlyClosedTab(mNativeRecentlyClosedTabsBridge, tab, recentTab.id); } @@ -119,6 +119,6 @@ public class RecentlyClosedBridge { private native boolean nativeGetRecentlyClosedTabs( long nativeRecentlyClosedTabsBridge, List<RecentlyClosedTab> tabs, int maxTabCount); private native boolean nativeOpenRecentlyClosedTab( - long nativeRecentlyClosedTabsBridge, TabBase tab, int recentTabId); + long nativeRecentlyClosedTabsBridge, Tab tab, int recentTabId); private native void nativeClearRecentlyClosedTabs(long nativeRecentlyClosedTabsBridge); } diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java index 2997dbb..c98b45a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java @@ -40,7 +40,7 @@ public class ShortcutHelper { * @param tab Tab to create a shortcut for. * @param userRequestedTitle Updated title for the shortcut. */ - public static void addShortcut(Context appContext, TabBase tab, String userRequestedTitle) { + public static void addShortcut(Context appContext, Tab tab, String userRequestedTitle) { if (TextUtils.isEmpty(sFullScreenAction)) { Log.e("ShortcutHelper", "ShortcutHelper is uninitialized. Aborting."); return; diff --git a/chrome/android/java/src/org/chromium/chrome/browser/TabBase.java b/chrome/android/java/src/org/chromium/chrome/browser/Tab.java index f227bc4..1bc34eb 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/TabBase.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/Tab.java @@ -1,4 +1,4 @@ -// Copyright 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -40,7 +40,7 @@ import java.util.concurrent.atomic.AtomicInteger; /** * The basic Java representation of a tab. Contains and manages a {@link ContentView}. * - * TabBase provides common functionality for ChromiumTestshell's Tab as well as Chrome on Android's + * Tab provides common functionality for ChromiumTestshell's Tab as well as Chrome on Android's * tab. It is intended to be extended either on Java or both Java and C++, with ownership managed * by this base class. * @@ -48,12 +48,12 @@ import java.util.concurrent.atomic.AtomicInteger; * - Just extend the class normally. Do not override initializeNative(). * Extending Java and C++: * - Because of the inner-workings of JNI, the subclass is responsible for constructing the native - * subclass, which in turn constructs TabAndroid (the native counterpart to TabBase), which in - * turn sets the native pointer for TabBase. For destruction, subclasses in Java must clear - * their own native pointer reference, but TabBase#destroy() will handle deleting the native + * subclass, which in turn constructs TabAndroid (the native counterpart to Tab), which in + * turn sets the native pointer for Tab. For destruction, subclasses in Java must clear + * their own native pointer reference, but Tab#destroy() will handle deleting the native * object. */ -public abstract class TabBase implements NavigationClient { +public abstract class Tab implements NavigationClient { public static final int INVALID_TAB_ID = -1; /** Used for automatically generating tab ids. */ @@ -76,7 +76,7 @@ public abstract class TabBase implements NavigationClient { * {@link Activity}. */ private final Context mContext; - /** Gives {@link TabBase} a way to interact with the Android window. */ + /** Gives {@link Tab} a way to interact with the Android window. */ private final WindowAndroid mWindowAndroid; /** The current native page (e.g. chrome-native://newtab), or {@code null} if there is none. */ @@ -91,7 +91,7 @@ public abstract class TabBase implements NavigationClient { /** Manages app banners shown for this tab. */ private AppBannerManager mAppBannerManager; - /** The sync id of the TabBase if session sync is enabled. */ + /** The sync id of the Tab if session sync is enabled. */ private int mSyncId; /** @@ -102,7 +102,7 @@ public abstract class TabBase implements NavigationClient { private ContentViewCore mContentViewCore; /** - * A list of TabBase observers. These are used to broadcast TabBase events to listeners. + * A list of Tab observers. These are used to broadcast Tab events to listeners. */ private final ObserverList<TabObserver> mObservers = new ObserverList<TabObserver>(); @@ -110,20 +110,20 @@ public abstract class TabBase implements NavigationClient { private ContentViewClient mContentViewClient; private WebContentsObserverAndroid mWebContentsObserver; private VoiceSearchTabHelper mVoiceSearchTabHelper; - private TabBaseChromeWebContentsDelegateAndroid mWebContentsDelegate; + private TabChromeWebContentsDelegateAndroid mWebContentsDelegate; /** * A default {@link ChromeContextMenuItemDelegate} that supports some of the context menu * functionality. */ - protected class TabBaseChromeContextMenuItemDelegate + protected class TabChromeContextMenuItemDelegate extends EmptyChromeContextMenuItemDelegate { private final Clipboard mClipboard; /** - * Builds a {@link TabBaseChromeContextMenuItemDelegate} instance. + * Builds a {@link TabChromeContextMenuItemDelegate} instance. */ - public TabBaseChromeContextMenuItemDelegate() { + public TabChromeContextMenuItemDelegate() { mClipboard = new Clipboard(getApplicationContext()); } @@ -147,18 +147,18 @@ public abstract class TabBase implements NavigationClient { * A basic {@link ChromeWebContentsDelegateAndroid} that forwards some calls to the registered * {@link TabObserver}s. Meant to be overridden by subclasses. */ - public class TabBaseChromeWebContentsDelegateAndroid + public class TabChromeWebContentsDelegateAndroid extends ChromeWebContentsDelegateAndroid { @Override public void onLoadProgressChanged(int progress) { for (TabObserver observer : mObservers) { - observer.onLoadProgressChanged(TabBase.this, progress); + observer.onLoadProgressChanged(Tab.this, progress); } } @Override public void onUpdateUrl(String url) { - for (TabObserver observer : mObservers) observer.onUpdateUrl(TabBase.this, url); + for (TabObserver observer : mObservers) observer.onUpdateUrl(Tab.this, url); } @Override @@ -182,35 +182,35 @@ public abstract class TabBase implements NavigationClient { @Override public void toggleFullscreenModeForTab(boolean enableFullscreen) { for (TabObserver observer : mObservers) { - observer.onToggleFullscreenMode(TabBase.this, enableFullscreen); + observer.onToggleFullscreenMode(Tab.this, enableFullscreen); } } @Override public void navigationStateChanged(int flags) { if ((flags & INVALIDATE_TYPE_TITLE) != 0) { - for (TabObserver observer : mObservers) observer.onTitleUpdated(TabBase.this); + for (TabObserver observer : mObservers) observer.onTitleUpdated(Tab.this); } if ((flags & INVALIDATE_TYPE_URL) != 0) { - for (TabObserver observer : mObservers) observer.onUrlUpdated(TabBase.this); + for (TabObserver observer : mObservers) observer.onUrlUpdated(Tab.this); } } } - private class TabBaseContextMenuPopulator extends ContextMenuPopulatorWrapper { - public TabBaseContextMenuPopulator(ContextMenuPopulator populator) { + private class TabContextMenuPopulator extends ContextMenuPopulatorWrapper { + public TabContextMenuPopulator(ContextMenuPopulator populator) { super(populator); } @Override public void buildContextMenu(ContextMenu menu, Context context, ContextMenuParams params) { super.buildContextMenu(menu, context, params); - for (TabObserver observer : mObservers) observer.onContextMenuShown(TabBase.this, menu); + for (TabObserver observer : mObservers) observer.onContextMenuShown(Tab.this, menu); } } - private class TabBaseWebContentsObserverAndroid extends WebContentsObserverAndroid { - public TabBaseWebContentsObserverAndroid(ContentViewCore contentViewCore) { + private class TabWebContentsObserverAndroid extends WebContentsObserverAndroid { + public TabWebContentsObserverAndroid(ContentViewCore contentViewCore) { super(contentViewCore); } @@ -225,30 +225,30 @@ public abstract class TabBase implements NavigationClient { public void didFailLoad(boolean isProvisionalLoad, boolean isMainFrame, int errorCode, String description, String failingUrl) { for (TabObserver observer : mObservers) { - observer.onDidFailLoad(TabBase.this, isProvisionalLoad, isMainFrame, errorCode, + observer.onDidFailLoad(Tab.this, isProvisionalLoad, isMainFrame, errorCode, description, failingUrl); } } } /** - * Creates an instance of a {@link TabBase} with no id. + * Creates an instance of a {@link Tab} with no id. * @param incognito Whether or not this tab is incognito. * @param context An instance of a {@link Context}. * @param window An instance of a {@link WindowAndroid}. */ - public TabBase(boolean incognito, Context context, WindowAndroid window) { + public Tab(boolean incognito, Context context, WindowAndroid window) { this(INVALID_TAB_ID, incognito, context, window); } /** - * Creates an instance of a {@link TabBase}. + * Creates an instance of a {@link Tab}. * @param id The id this tab should be identified with. * @param incognito Whether or not this tab is incognito. * @param context An instance of a {@link Context}. * @param window An instance of a {@link WindowAndroid}. */ - public TabBase(int id, boolean incognito, Context context, WindowAndroid window) { + public Tab(int id, boolean incognito, Context context, WindowAndroid window) { // We need a valid Activity Context to build the ContentView with. assert context == null || context instanceof Activity; @@ -261,7 +261,7 @@ public abstract class TabBase implements NavigationClient { } /** - * Adds a {@link TabObserver} to be notified on {@link TabBase} changes. + * Adds a {@link TabObserver} to be notified on {@link Tab} changes. * @param observer The {@link TabObserver} to add. */ public final void addObserver(TabObserver observer) { @@ -333,7 +333,7 @@ public abstract class TabBase implements NavigationClient { } /** - * @return Whether or not the {@link TabBase} is currently showing an interstitial page, such as + * @return Whether or not the {@link Tab} is currently showing an interstitial page, such as * a bad HTTPS page. */ public boolean isShowingInterstitialPage() { @@ -499,7 +499,7 @@ public abstract class TabBase implements NavigationClient { } /** - * @return Whether or not the {@link TabBase} represents a {@link NativePage}. + * @return Whether or not the {@link Tab} represents a {@link NativePage}. */ public boolean isNativePage() { return mNativePage != null; @@ -569,7 +569,7 @@ public abstract class TabBase implements NavigationClient { /** * @param client The {@link ContentViewClient} to be bound to any current or new - * {@link ContentViewCore}s associated with this {@link TabBase}. + * {@link ContentViewCore}s associated with this {@link Tab}. */ protected void setContentViewClient(ContentViewClient client) { if (mContentViewClient == client) return; @@ -626,7 +626,7 @@ public abstract class TabBase implements NavigationClient { } /** - * Initializes this {@link TabBase}. + * Initializes this {@link Tab}. */ public void initialize() { initializeNative(); @@ -668,7 +668,7 @@ public abstract class TabBase implements NavigationClient { mContentViewCore = mContentView.getContentViewCore(); mWebContentsDelegate = createWebContentsDelegate(); - mWebContentsObserver = new TabBaseWebContentsObserverAndroid(mContentViewCore); + mWebContentsObserver = new TabWebContentsObserverAndroid(mContentViewCore); mVoiceSearchTabHelper = new VoiceSearchTabHelper(mContentViewCore); if (mContentViewClient != null) mContentViewCore.setContentViewClient(mContentViewClient); @@ -676,7 +676,7 @@ public abstract class TabBase implements NavigationClient { assert mNativeTabAndroid != 0; nativeInitWebContents( mNativeTabAndroid, mIncognito, mContentViewCore, mWebContentsDelegate, - new TabBaseContextMenuPopulator(createContextMenuPopulator())); + new TabContextMenuPopulator(createContextMenuPopulator())); // In the case where restoring a Tab or showing a prerendered one we already have a // valid infobar container, no need to recreate one. @@ -699,9 +699,9 @@ public abstract class TabBase implements NavigationClient { /** * Cleans up all internal state, destroying any {@link NativePage} or {@link ContentView} - * currently associated with this {@link TabBase}. This also destroys the native counterpart + * currently associated with this {@link Tab}. This also destroys the native counterpart * to this class, which means that all subclasses should erase their native pointers after - * this method is called. Once this call is made this {@link TabBase} should no longer be used. + * this method is called. Once this call is made this {@link Tab} should no longer be used. */ public void destroy() { for (TabObserver observer : mObservers) observer.onDestroyed(this); @@ -808,10 +808,10 @@ public abstract class TabBase implements NavigationClient { /** * A helper method to allow subclasses to build their own delegate. - * @return An instance of a {@link TabBaseChromeWebContentsDelegateAndroid}. + * @return An instance of a {@link TabChromeWebContentsDelegateAndroid}. */ - protected TabBaseChromeWebContentsDelegateAndroid createWebContentsDelegate() { - return new TabBaseChromeWebContentsDelegateAndroid(); + protected TabChromeWebContentsDelegateAndroid createWebContentsDelegate() { + return new TabChromeWebContentsDelegateAndroid(); } /** @@ -819,20 +819,20 @@ public abstract class TabBase implements NavigationClient { * @return An instance of a {@link ContextMenuPopulator}. */ protected ContextMenuPopulator createContextMenuPopulator() { - return new ChromeContextMenuPopulator(new TabBaseChromeContextMenuItemDelegate()); + return new ChromeContextMenuPopulator(new TabChromeContextMenuItemDelegate()); } /** - * @return The {@link WindowAndroid} associated with this {@link TabBase}. + * @return The {@link WindowAndroid} associated with this {@link Tab}. */ public WindowAndroid getWindowAndroid() { return mWindowAndroid; } /** - * @return The current {@link TabBaseChromeWebContentsDelegateAndroid} instance. + * @return The current {@link TabChromeWebContentsDelegateAndroid} instance. */ - protected TabBaseChromeWebContentsDelegateAndroid getChromeWebContentsDelegateAndroid() { + protected TabChromeWebContentsDelegateAndroid getChromeWebContentsDelegateAndroid() { return mWebContentsDelegate; } @@ -853,7 +853,7 @@ public abstract class TabBase implements NavigationClient { } /** - * @return The native pointer representing the native side of this {@link TabBase} object. + * @return The native pointer representing the native side of this {@link Tab} object. */ @CalledByNative protected long getNativePtr() { diff --git a/chrome/android/java/src/org/chromium/chrome/browser/TabObserver.java b/chrome/android/java/src/org/chromium/chrome/browser/TabObserver.java index 189c9d7..f87ca0e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/TabObserver.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/TabObserver.java @@ -9,91 +9,92 @@ import android.view.ContextMenu; import org.chromium.content.browser.ContentView; /** - * An observer that is notified of changes to a {@link TabBase} object. + * An observer that is notified of changes to a {@link Tab} object. */ public interface TabObserver { /** - * Called when a {@link TabBase} is being destroyed. - * @param tab The notifying {@link TabBase}. + * Called when a {@link Tab} is being destroyed. + * @param tab The notifying {@link Tab}. */ - void onDestroyed(TabBase tab); + void onDestroyed(Tab tab); /** * Called when the tab content changes (to/from native pages or swapping native WebContents). - * @param tab The notifying {@link TabBase}. + * @param tab The notifying {@link Tab}. */ - void onContentChanged(TabBase tab); + void onContentChanged(Tab tab); /** - * Called when the favicon of a {@link TabBase} has been updated. - * @param tab The notifying {@link TabBase}. + * Called when the favicon of a {@link Tab} has been updated. + * @param tab The notifying {@link Tab}. */ - void onFaviconUpdated(TabBase tab); + void onFaviconUpdated(Tab tab); /** - * Called when the title of a {@link TabBase} changes. - * @param tab The notifying {@link TabBase}. + * Called when the title of a {@link Tab} changes. + * @param tab The notifying {@link Tab}. */ - void onTitleUpdated(TabBase tab); + void onTitleUpdated(Tab tab); /** - * Called when the URL of a {@link TabBase} changes. - * @param tab The notifying {@link TabBase}. + * Called when the URL of a {@link Tab} changes. + * @param tab The notifying {@link Tab}. */ - void onUrlUpdated(TabBase tab); + void onUrlUpdated(Tab tab); /** - * Called when the WebContents of a {@link TabBase} have been swapped. - * @param tab The notifying {@link TabBase}. + * Called when the WebContents of a {@link Tab} have been swapped. + * @param tab The notifying {@link Tab}. * @param didStartLoad Whether WebContentsObserver::DidStartProvisionalLoadForFrame() has * already been called. * @param didFinishLoad Whether WebContentsObserver::DidFinishLoad() has already been called. */ - void onWebContentsSwapped(TabBase tab, boolean didStartLoad, boolean didFinishLoad); + void onWebContentsSwapped(Tab tab, boolean didStartLoad, boolean didFinishLoad); /** - * Called when a context menu is shown for a {@link ContentView} owned by a {@link TabBase}. - * @param tab The notifying {@link TabBase}. + * Called when a context menu is shown for a {@link ContentView} owned by a {@link Tab}. + * @param tab The notifying {@link Tab}. * @param menu The {@link ContextMenu} that is being shown. */ - void onContextMenuShown(TabBase tab, ContextMenu menu); + void onContextMenuShown(Tab tab, ContextMenu menu); // WebContentsDelegateAndroid methods --------------------------------------------------------- /** - * Called when the load progress of a {@link TabBase} changes. - * @param tab The notifying {@link TabBase}. + * Called when the load progress of a {@link Tab} changes. + * @param tab The notifying {@link Tab}. * @param progress The new progress from [0,100]. */ - void onLoadProgressChanged(TabBase tab, int progress); + void onLoadProgressChanged(Tab tab, int progress); /** - * Called when the URL of a {@link TabBase} changes. - * @param tab The notifying {@link TabBase}. + * Called when the URL of a {@link Tab} changes. + * @param tab The notifying {@link Tab}. * @param url The new URL. */ - void onUpdateUrl(TabBase tab, String url); + void onUpdateUrl(Tab tab, String url); /** - * Called when the {@link TabBase} should enter or leave fullscreen mode. - * @param tab The notifying {@link TabBase}. + * Called when the {@link Tab} should enter or leave fullscreen mode. + * @param tab The notifying {@link Tab}. * @param enable Whether or not to enter fullscreen mode. */ - void onToggleFullscreenMode(TabBase tab, boolean enable); + void onToggleFullscreenMode(Tab tab, boolean enable); // WebContentsObserverAndroid methods --------------------------------------------------------- /** * Called when an error occurs while loading a page and/or the page fails to load. - * @param tab The notifying {@link TabBase}. + * @param tab The notifying {@link Tab}. * @param isProvisionalLoad Whether the failed load occurred during the provisional load. * @param isMainFrame Whether failed load happened for the main frame. * @param errorCode Code for the occurring error. * @param description The description for the error. * @param failingUrl The url that was loading when the error occurred. */ - void onDidFailLoad(TabBase tab, boolean isProvisionalLoad, boolean isMainFrame, int errorCode, + void onDidFailLoad( + Tab tab, boolean isProvisionalLoad, boolean isMainFrame, int errorCode, String description, String failingUrl); } diff --git a/chrome/android/java/src/org/chromium/chrome/browser/banners/AppBannerManager.java b/chrome/android/java/src/org/chromium/chrome/browser/banners/AppBannerManager.java index 3071c85..6572105 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/banners/AppBannerManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/banners/AppBannerManager.java @@ -17,7 +17,7 @@ import android.util.Log; import org.chromium.base.CalledByNative; import org.chromium.chrome.browser.EmptyTabObserver; -import org.chromium.chrome.browser.TabBase; +import org.chromium.chrome.browser.Tab; import org.chromium.chrome.browser.TabObserver; import org.chromium.content.browser.ContentView; import org.chromium.content_public.browser.WebContents; @@ -26,7 +26,7 @@ import org.chromium.ui.base.WindowAndroid; import org.chromium.ui.base.WindowAndroid.IntentCallback; /** - * Manages an AppBannerView for a TabBase and its ContentView. + * Manages an AppBannerView for a Tab and its ContentView. * * The AppBannerManager manages a single AppBannerView, dismissing it when the user navigates to a * new page or creating a new one when it detects that the current webpage is requesting a banner @@ -46,8 +46,8 @@ public class AppBannerManager implements AppBannerView.Observer, InstallerDelega /** Pointer to the native side AppBannerManager. */ private final long mNativePointer; - /** TabBase that the AppBannerView/AppBannerManager is owned by. */ - private final TabBase mTabBase; + /** Tab that the AppBannerView/AppBannerManager is owned by. */ + private final Tab mTab; /** ContentView that the AppBannerView/AppBannerManager is currently attached to. */ private ContentView mContentView; @@ -82,33 +82,33 @@ public class AppBannerManager implements AppBannerView.Observer, InstallerDelega * Constructs an AppBannerManager for the given tab. * @param tab Tab that the AppBannerManager will be attached to. */ - public AppBannerManager(TabBase tab) { + public AppBannerManager(Tab tab) { mNativePointer = nativeInit(); - mTabBase = tab; - mTabBase.addObserver(createTabObserver()); + mTab = tab; + mTab.addObserver(createTabObserver()); updatePointers(); } /** - * Creates a TabObserver for monitoring a TabBase, used to react to changes in the ContentView + * Creates a TabObserver for monitoring a Tab, used to react to changes in the ContentView * or to trigger its own destruction. - * @return TabObserver that can be used to monitor a TabBase. + * @return TabObserver that can be used to monitor a Tab. */ private TabObserver createTabObserver() { return new EmptyTabObserver() { @Override - public void onWebContentsSwapped(TabBase tab, boolean didStartLoad, + public void onWebContentsSwapped(Tab tab, boolean didStartLoad, boolean didFinishLoad) { updatePointers(); } @Override - public void onContentChanged(TabBase tab) { + public void onContentChanged(Tab tab) { updatePointers(); } @Override - public void onDestroyed(TabBase tab) { + public void onDestroyed(Tab tab) { nativeDestroy(mNativePointer); resetState(); } @@ -119,8 +119,8 @@ public class AppBannerManager implements AppBannerView.Observer, InstallerDelega * Updates which ContentView and WebContents the AppBannerView is monitoring. */ private void updatePointers() { - if (mContentView != mTabBase.getContentView()) mContentView = mTabBase.getContentView(); - nativeReplaceWebContents(mNativePointer, mTabBase.getWebContents()); + if (mContentView != mTab.getContentView()) mContentView = mTab.getContentView(); + nativeReplaceWebContents(mNativePointer, mTab.getWebContents()); } /** @@ -190,7 +190,7 @@ public class AppBannerManager implements AppBannerView.Observer, InstallerDelega if (mAppData.installState() == AppData.INSTALL_STATE_NOT_INSTALLED) { // The user initiated an install. - WindowAndroid window = mTabBase.getWindowAndroid(); + WindowAndroid window = mTab.getWindowAndroid(); if (window.showIntent(mAppData.installIntent(), this, R.string.low_memory_error)) { // Temporarily hide the banner. mBannerView.createVerticalSnapAnimation(false); diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuItemDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuItemDelegate.java index 5380577..e5b3210 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuItemDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuItemDelegate.java @@ -4,7 +4,7 @@ package org.chromium.chrome.browser.contextmenu; -import org.chromium.chrome.browser.TabBase; +import org.chromium.chrome.browser.Tab; import org.chromium.content.browser.ContentView; /** @@ -36,7 +36,7 @@ public interface ChromeContextMenuItemDelegate { /** * Called when the {@code url} should be opened in a new tab with the same incognito state as - * the current {@link TabBase}. + * the current {@link Tab}. * @param url The URL to open. */ void onOpenInNewTab(String url); diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarContainer.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarContainer.java index eea69de..55d8f8f 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarContainer.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarContainer.java @@ -89,7 +89,7 @@ public class InfoBarContainer extends LinearLayout { // True when this container has been emptied and its native counterpart has been destroyed. private boolean mDestroyed = false; - // The id of the tab associated with us. Set to TabBase.INVALID_TAB_ID if no tab is associated. + // The id of the tab associated with us. Set to Tab.INVALID_TAB_ID if no tab is associated. private int mTabId; // Parent view that contains us. diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/OmniboxPrerender.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/OmniboxPrerender.java index 2b180fd..bc669fb 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/OmniboxPrerender.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/OmniboxPrerender.java @@ -4,7 +4,7 @@ package org.chromium.chrome.browser.omnibox; -import org.chromium.chrome.browser.TabBase; +import org.chromium.chrome.browser.Tab; import org.chromium.chrome.browser.profiles.Profile; /** @@ -59,7 +59,7 @@ public class OmniboxPrerender { * @param tab The tab whose webcontent's to use. */ public void prerenderMaybe(String url, String currentUrl, long nativeAutocompleteResult, - Profile profile, TabBase tab) { + Profile profile, Tab tab) { nativePrerenderMaybe(mNativeOmniboxPrerender, url, currentUrl, nativeAutocompleteResult, profile, tab); } @@ -71,5 +71,5 @@ public class OmniboxPrerender { Profile profile); private native void nativePrerenderMaybe(long nativeOmniboxPrerender, String url, String currentUrl, long nativeAutocompleteResult, Profile profile, - TabBase tab); + Tab tab); } diff --git a/chrome/android/java/src/org/chromium/chrome/browser/password_manager/PasswordAuthenticationManager.java b/chrome/android/java/src/org/chromium/chrome/browser/password_manager/PasswordAuthenticationManager.java index 355c30c..78e7eb3 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/password_manager/PasswordAuthenticationManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/password_manager/PasswordAuthenticationManager.java @@ -5,7 +5,7 @@ package org.chromium.chrome.browser.password_manager; import org.chromium.base.CalledByNative; -import org.chromium.chrome.browser.TabBase; +import org.chromium.chrome.browser.Tab; /** * Allows embedders to authenticate the usage of passwords. @@ -26,7 +26,7 @@ public class PasswordAuthenticationManager { * @param tab The tab containing the protected password. * @param callback The callback to be triggered on authentication result. */ - void requestAuthentication(TabBase tab, PasswordAuthenticationCallback callback); + void requestAuthentication(Tab tab, PasswordAuthenticationCallback callback); /** * @return The message to be displayed in the save password infobar that will allow @@ -72,7 +72,7 @@ public class PasswordAuthenticationManager { } @Override - public void requestAuthentication(TabBase tab, PasswordAuthenticationCallback callback) { + public void requestAuthentication(Tab tab, PasswordAuthenticationCallback callback) { callback.onResult(true); } @@ -114,7 +114,7 @@ public class PasswordAuthenticationManager { */ @CalledByNative public static void requestAuthentication( - TabBase tab, PasswordAuthenticationCallback callback) { + Tab tab, PasswordAuthenticationCallback callback) { getDelegate().requestAuthentication(tab, callback); } diff --git a/chrome/android/java/src/org/chromium/chrome/browser/printing/TabPrinter.java b/chrome/android/java/src/org/chromium/chrome/browser/printing/TabPrinter.java index a522308..e37ae1a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/printing/TabPrinter.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/printing/TabPrinter.java @@ -6,13 +6,13 @@ package org.chromium.chrome.browser.printing; import android.text.TextUtils; -import org.chromium.chrome.browser.TabBase; +import org.chromium.chrome.browser.Tab; import org.chromium.printing.Printable; import java.lang.ref.WeakReference; /** - * Wraps printing related functionality of a {@link TabBase} object. + * Wraps printing related functionality of a {@link Tab} object. * * This class doesn't have any lifetime expectations with regards to Tab, since we keep a weak * reference. @@ -20,10 +20,10 @@ import java.lang.ref.WeakReference; public class TabPrinter implements Printable { private static String sDefaultTitle; - private final WeakReference<TabBase> mTab; + private final WeakReference<Tab> mTab; - public TabPrinter(TabBase tab) { - mTab = new WeakReference<TabBase>(tab); + public TabPrinter(Tab tab) { + mTab = new WeakReference<Tab>(tab); } public static void setDefaultTitle(String defaultTitle) { @@ -32,13 +32,13 @@ public class TabPrinter implements Printable { @Override public boolean print() { - TabBase tab = mTab.get(); + Tab tab = mTab.get(); return tab != null && tab.print(); } @Override public String getTitle() { - TabBase tab = mTab.get(); + Tab tab = mTab.get(); if (tab == null) return sDefaultTitle; String title = tab.getTitle(); diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/RepostFormWarningTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/RepostFormWarningTest.java index ea1edec..def5d08 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/RepostFormWarningTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/RepostFormWarningTest.java @@ -9,7 +9,7 @@ import android.test.suitebuilder.annotation.MediumTest; import org.chromium.base.test.util.EnormousTest; import org.chromium.base.test.util.Feature; -import org.chromium.chrome.test.util.TabBaseTabUtils; +import org.chromium.chrome.test.util.TabUtils; import org.chromium.chrome.test.util.TestHttpServerClient; import org.chromium.chrome.testshell.ChromiumTestShellTestBase; import org.chromium.chrome.testshell.TestShellTab; @@ -31,7 +31,7 @@ public class RepostFormWarningTest extends ChromiumTestShellTestBase { super.setUp(); mTab = launchChromiumTestShellWithBlankPage().getActiveTab(); - mCallbackHelper = TabBaseTabUtils.getTestCallbackHelperContainer(mTab); + mCallbackHelper = TabUtils.getTestCallbackHelperContainer(mTab); // Wait for the initial load of about://blank to finish. mCallbackHelper.getOnPageFinishedHelper().waitForCallback(0); diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java index 628c19a..161af44 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java @@ -16,9 +16,9 @@ import junit.framework.Assert; import org.chromium.base.test.util.Feature; import org.chromium.chrome.R; -import org.chromium.chrome.browser.TabBase; -import org.chromium.chrome.test.util.TabBaseTabUtils; -import org.chromium.chrome.test.util.TabBaseTabUtils.TestCallbackHelperContainerForTab; +import org.chromium.chrome.browser.Tab; +import org.chromium.chrome.test.util.TabUtils; +import org.chromium.chrome.test.util.TabUtils.TestCallbackHelperContainerForTab; import org.chromium.chrome.test.util.TestHttpServerClient; import org.chromium.chrome.test.util.browser.contextmenu.ContextMenuUtils; import org.chromium.chrome.testshell.ChromiumTestShellTestBase; @@ -46,9 +46,9 @@ public class ContextMenuTest extends ChromiumTestShellTestBase { // @LargeTest @Feature({"Browser", "Main"}) public void testCopyLinkURL() throws InterruptedException, TimeoutException { - TabBase tab = getActivity().getActiveTab(); + Tab tab = getActivity().getActiveTab(); ContextMenuUtils.selectContextMenuItem(this, tab, - TabBaseTabUtils.getTestCallbackHelperContainer(tab), "testLink", + TabUtils.getTestCallbackHelperContainer(tab), "testLink", R.id.contextmenu_copy_link_address_text); assertStringContains("test_link.html", getClipboardText()); @@ -59,9 +59,9 @@ public class ContextMenuTest extends ChromiumTestShellTestBase { // @LargeTest @Feature({"Browser"}) public void testCopyImageLinkCopiesLinkURL() throws InterruptedException, TimeoutException { - TabBase tab = getActivity().getActiveTab(); + Tab tab = getActivity().getActiveTab(); ContextMenuUtils.selectContextMenuItem(this, tab, - TabBaseTabUtils.getTestCallbackHelperContainer(tab), "testImageLink", + TabUtils.getTestCallbackHelperContainer(tab), "testImageLink", R.id.contextmenu_copy_link_address_text); assertStringContains("test_link.html", getClipboardText()); @@ -72,9 +72,9 @@ public class ContextMenuTest extends ChromiumTestShellTestBase { // @LargeTest @Feature({"Browser"}) public void testCopyLinkTextSimple() throws InterruptedException, TimeoutException { - TabBase tab = getActivity().getActiveTab(); + Tab tab = getActivity().getActiveTab(); ContextMenuUtils.selectContextMenuItem(this, tab, - TabBaseTabUtils.getTestCallbackHelperContainer(tab), "testLink", + TabUtils.getTestCallbackHelperContainer(tab), "testLink", R.id.contextmenu_copy_link_text); assertEquals("Clipboard text was not what was expected", "Test Link", @@ -86,9 +86,9 @@ public class ContextMenuTest extends ChromiumTestShellTestBase { // @LargeTest @Feature({"Browser"}) public void testCopyLinkTextComplex() throws InterruptedException, TimeoutException { - TabBase tab = getActivity().getActiveTab(); + Tab tab = getActivity().getActiveTab(); ContextMenuUtils.selectContextMenuItem(this, tab, - TabBaseTabUtils.getTestCallbackHelperContainer(tab), "copyLinkTextComplex", + TabUtils.getTestCallbackHelperContainer(tab), "copyLinkTextComplex", R.id.contextmenu_copy_link_text); assertEquals("Clipboard text was not what was expected", @@ -102,9 +102,9 @@ public class ContextMenuTest extends ChromiumTestShellTestBase { public void testCopyImageToClipboard() throws InterruptedException, TimeoutException { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) return; - TabBase tab = getActivity().getActiveTab(); + Tab tab = getActivity().getActiveTab(); ContextMenuUtils.selectContextMenuItem(this, tab, - TabBaseTabUtils.getTestCallbackHelperContainer(tab), "testImage", + TabUtils.getTestCallbackHelperContainer(tab), "testImage", R.id.contextmenu_copy_image); String expectedUrl = TestHttpServerClient.getUrl( @@ -118,10 +118,10 @@ public class ContextMenuTest extends ChromiumTestShellTestBase { // @LargeTest @Feature({"Browser"}) public void testLongPressOnImage() throws InterruptedException, TimeoutException { - final TabBase tab = getActivity().getActiveTab(); + final Tab tab = getActivity().getActiveTab(); TestCallbackHelperContainerForTab helper = - TabBaseTabUtils.getTestCallbackHelperContainer(tab); + TabUtils.getTestCallbackHelperContainer(tab); OnPageFinishedHelper callback = helper.getOnPageFinishedHelper(); int callbackCount = callback.getCallCount(); @@ -150,10 +150,10 @@ public class ContextMenuTest extends ChromiumTestShellTestBase { // @LargeTest @Feature({"Browser"}) public void testLongPressOnImageLink() throws InterruptedException, TimeoutException { - final TabBase tab = getActivity().getActiveTab(); + final Tab tab = getActivity().getActiveTab(); TestCallbackHelperContainerForTab helper = - TabBaseTabUtils.getTestCallbackHelperContainer(tab); + TabUtils.getTestCallbackHelperContainer(tab); OnPageFinishedHelper callback = helper.getOnPageFinishedHelper(); int callbackCount = callback.getCallCount(); @@ -179,9 +179,9 @@ public class ContextMenuTest extends ChromiumTestShellTestBase { // @LargeTest @Feature({"Browser"}) public void testDismissContextMenuOnBack() throws InterruptedException, TimeoutException { - TabBase tab = getActivity().getActiveTab(); + Tab tab = getActivity().getActiveTab(); ContextMenu menu = ContextMenuUtils.openContextMenu(this, tab, - TabBaseTabUtils.getTestCallbackHelperContainer(tab), "testImage"); + TabUtils.getTestCallbackHelperContainer(tab), "testImage"); assertNotNull("Context menu was not properly created", menu); assertFalse("Context menu did not have window focus", getActivity().hasWindowFocus()); @@ -201,9 +201,9 @@ public class ContextMenuTest extends ChromiumTestShellTestBase { // @LargeTest @Feature({"Browser"}) public void testDismissContextMenuOnClick() throws InterruptedException, TimeoutException { - TabBase tab = getActivity().getActiveTab(); + Tab tab = getActivity().getActiveTab(); ContextMenu menu = ContextMenuUtils.openContextMenu(this, tab, - TabBaseTabUtils.getTestCallbackHelperContainer(tab), "testImage"); + TabUtils.getTestCallbackHelperContainer(tab), "testImage"); assertNotNull("Context menu was not properly created", menu); assertFalse("Context menu did not have window focus", getActivity().hasWindowFocus()); diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/test/ModalDialogTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/test/ModalDialogTest.java index 4cb1814..0c7cf75 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/test/ModalDialogTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/test/ModalDialogTest.java @@ -18,8 +18,8 @@ import org.chromium.base.test.util.DisabledTest; import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.UrlUtils; import org.chromium.chrome.browser.JavascriptAppModalDialog; -import org.chromium.chrome.test.util.TabBaseTabUtils; -import org.chromium.chrome.test.util.TabBaseTabUtils.TestCallbackHelperContainerForTab; +import org.chromium.chrome.test.util.TabUtils; +import org.chromium.chrome.test.util.TabUtils.TestCallbackHelperContainerForTab; import org.chromium.chrome.testshell.ChromiumTestShellTestBase; import org.chromium.content.browser.test.util.Criteria; import org.chromium.content.browser.test.util.CriteriaHelper; @@ -419,6 +419,6 @@ public class ModalDialogTest extends ChromiumTestShellTestBase { } private TestCallbackHelperContainerForTab getActiveTabTestCallbackHelperContainer() { - return TabBaseTabUtils.getTestCallbackHelperContainer(getActivity().getActiveTab()); + return TabUtils.getTestCallbackHelperContainer(getActivity().getActiveTab()); } } diff --git a/chrome/android/testshell/java/src/org/chromium/chrome/testshell/TestShellTab.java b/chrome/android/testshell/java/src/org/chromium/chrome/testshell/TestShellTab.java index ff0329d..5daeafc 100644 --- a/chrome/android/testshell/java/src/org/chromium/chrome/testshell/TestShellTab.java +++ b/chrome/android/testshell/java/src/org/chromium/chrome/testshell/TestShellTab.java @@ -7,7 +7,7 @@ package org.chromium.chrome.testshell; import android.content.Context; import android.text.TextUtils; -import org.chromium.chrome.browser.TabBase; +import org.chromium.chrome.browser.Tab; import org.chromium.chrome.browser.UrlUtilities; import org.chromium.chrome.browser.contextmenu.ChromeContextMenuPopulator; import org.chromium.chrome.browser.contextmenu.ContextMenuPopulator; @@ -19,9 +19,9 @@ import org.chromium.ui.base.WindowAndroid; /** * TestShell's implementation of a tab. This mirrors how Chrome for Android subclasses - * and extends {@link TabBase}. + * and extends {@link Tab}. */ -public class TestShellTab extends TabBase { +public class TestShellTab extends Tab { // Tab state private boolean mIsLoading; @@ -82,8 +82,8 @@ public class TestShellTab extends TabBase { } @Override - protected TabBaseChromeWebContentsDelegateAndroid createWebContentsDelegate() { - return new TestShellTabBaseChromeWebContentsDelegateAndroid(); + protected TabChromeWebContentsDelegateAndroid createWebContentsDelegate() { + return new TestShellTabChromeWebContentsDelegateAndroid(); } @Override @@ -100,7 +100,7 @@ public class TestShellTab extends TabBase { @Override protected ContextMenuPopulator createContextMenuPopulator() { - return new ChromeContextMenuPopulator(new TabBaseChromeContextMenuItemDelegate() { + return new ChromeContextMenuPopulator(new TabChromeContextMenuItemDelegate() { @Override public void onOpenImageUrl(String url) { loadUrlWithSanitization(url); @@ -108,8 +108,8 @@ public class TestShellTab extends TabBase { }); } - private class TestShellTabBaseChromeWebContentsDelegateAndroid - extends TabBaseChromeWebContentsDelegateAndroid { + private class TestShellTabChromeWebContentsDelegateAndroid + extends TabChromeWebContentsDelegateAndroid { @Override public void onLoadStarted() { mIsLoading = true; diff --git a/chrome/android/testshell/java/src/org/chromium/chrome/testshell/TestShellToolbar.java b/chrome/android/testshell/java/src/org/chromium/chrome/testshell/TestShellToolbar.java index 2ea1866..7d79115 100644 --- a/chrome/android/testshell/java/src/org/chromium/chrome/testshell/TestShellToolbar.java +++ b/chrome/android/testshell/java/src/org/chromium/chrome/testshell/TestShellToolbar.java @@ -19,7 +19,7 @@ import android.widget.TextView; import android.widget.TextView.OnEditorActionListener; import org.chromium.chrome.browser.EmptyTabObserver; -import org.chromium.chrome.browser.TabBase; +import org.chromium.chrome.browser.Tab; import org.chromium.chrome.browser.TabObserver; import org.chromium.chrome.browser.appmenu.AppMenuButtonHelper; import org.chromium.chrome.browser.appmenu.AppMenuHandler; @@ -56,7 +56,7 @@ public class TestShellToolbar extends LinearLayout { /** * The toolbar will visually represent the state of {@code tab}. - * @param tab The TabBase that should be represented. + * @param tab The Tab that should be represented. */ public void showTab(TestShellTab tab) { if (mTab != null) mTab.removeObserver(mTabObserver); @@ -147,12 +147,12 @@ public class TestShellToolbar extends LinearLayout { private class TabObserverImpl extends EmptyTabObserver { @Override - public void onLoadProgressChanged(TabBase tab, int progress) { + public void onLoadProgressChanged(Tab tab, int progress) { if (tab == mTab) TestShellToolbar.this.onLoadProgressChanged(progress); } @Override - public void onUpdateUrl(TabBase tab, String url) { + public void onUpdateUrl(Tab tab, String url) { if (tab == mTab) TestShellToolbar.this.onUpdateUrl(url); } } diff --git a/chrome/browser/android/tab_android.cc b/chrome/browser/android/tab_android.cc index b2e8498..dc52c17 100644 --- a/chrome/browser/android/tab_android.cc +++ b/chrome/browser/android/tab_android.cc @@ -29,7 +29,7 @@ #include "content/public/browser/navigation_entry.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/web_contents.h" -#include "jni/TabBase_jni.h" +#include "jni/Tab_jni.h" TabAndroid* TabAndroid::FromWebContents(content::WebContents* web_contents) { CoreTabHelper* core_tab_helper = CoreTabHelper::FromWebContents(web_contents); @@ -44,14 +44,14 @@ TabAndroid* TabAndroid::FromWebContents(content::WebContents* web_contents) { } TabAndroid* TabAndroid::GetNativeTab(JNIEnv* env, jobject obj) { - return reinterpret_cast<TabAndroid*>(Java_TabBase_getNativePtr(env, obj)); + return reinterpret_cast<TabAndroid*>(Java_Tab_getNativePtr(env, obj)); } TabAndroid::TabAndroid(JNIEnv* env, jobject obj) : weak_java_tab_(env, obj), session_tab_id_(), synced_tab_delegate_(new browser_sync::SyncedTabDelegateAndroid(this)) { - Java_TabBase_setNativePtr(env, obj, reinterpret_cast<intptr_t>(this)); + Java_Tab_setNativePtr(env, obj, reinterpret_cast<intptr_t>(this)); } TabAndroid::~TabAndroid() { @@ -60,7 +60,7 @@ TabAndroid::~TabAndroid() { if (obj.is_null()) return; - Java_TabBase_clearNativePtr(env, obj.obj()); + Java_Tab_clearNativePtr(env, obj.obj()); } base::android::ScopedJavaLocalRef<jobject> TabAndroid::GetJavaObject() { @@ -73,7 +73,7 @@ int TabAndroid::GetAndroidId() const { ScopedJavaLocalRef<jobject> obj = weak_java_tab_.get(env); if (obj.is_null()) return -1; - return Java_TabBase_getId(env, obj.obj()); + return Java_Tab_getId(env, obj.obj()); } int TabAndroid::GetSyncId() const { @@ -81,7 +81,7 @@ int TabAndroid::GetSyncId() const { ScopedJavaLocalRef<jobject> obj = weak_java_tab_.get(env); if (obj.is_null()) return 0; - return Java_TabBase_getSyncId(env, obj.obj()); + return Java_Tab_getSyncId(env, obj.obj()); } base::string16 TabAndroid::GetTitle() const { @@ -90,7 +90,7 @@ base::string16 TabAndroid::GetTitle() const { if (obj.is_null()) return base::string16(); return base::android::ConvertJavaStringToUTF16( - Java_TabBase_getTitle(env, obj.obj())); + Java_Tab_getTitle(env, obj.obj())); } GURL TabAndroid::GetURL() const { @@ -99,7 +99,7 @@ GURL TabAndroid::GetURL() const { if (obj.is_null()) return GURL::EmptyGURL(); return GURL(base::android::ConvertJavaStringToUTF8( - Java_TabBase_getUrl(env, obj.obj()))); + Java_Tab_getUrl(env, obj.obj()))); } bool TabAndroid::RestoreIfNeeded() { @@ -107,7 +107,7 @@ bool TabAndroid::RestoreIfNeeded() { ScopedJavaLocalRef<jobject> obj = weak_java_tab_.get(env); if (obj.is_null()) return false; - return Java_TabBase_restoreIfNeeded(env, obj.obj()); + return Java_Tab_restoreIfNeeded(env, obj.obj()); } content::ContentViewCore* TabAndroid::GetContentViewCore() const { @@ -133,7 +133,7 @@ void TabAndroid::SetSyncId(int sync_id) { ScopedJavaLocalRef<jobject> obj = weak_java_tab_.get(env); if (obj.is_null()) return; - Java_TabBase_setSyncId(env, obj.obj(), sync_id); + Java_Tab_setSyncId(env, obj.obj(), sync_id); } void TabAndroid::HandlePopupNavigation(chrome::NavigateParams* params) { @@ -180,14 +180,14 @@ void TabAndroid::SwapTabContents(content::WebContents* old_contents, // We need to notify the native InfobarContainer so infobars can be swapped. InfoBarContainerAndroid* infobar_container = reinterpret_cast<InfoBarContainerAndroid*>( - Java_TabBase_getNativeInfoBarContainer( + Java_Tab_getNativeInfoBarContainer( env, weak_java_tab_.get(env).obj())); InfoBarService* new_infobar_service = new_contents ? InfoBarService::FromWebContents(new_contents) : NULL; infobar_container->ChangeInfoBarService(new_infobar_service); - Java_TabBase_swapWebContents( + Java_Tab_swapWebContents( env, weak_java_tab_.get(env).obj(), reinterpret_cast<intptr_t>(new_contents), @@ -221,10 +221,10 @@ void TabAndroid::Observe(int type, break; } case chrome::NOTIFICATION_FAVICON_UPDATED: - Java_TabBase_onFaviconUpdated(env, weak_java_tab_.get(env).obj()); + Java_Tab_onFaviconUpdated(env, weak_java_tab_.get(env).obj()); break; case content::NOTIFICATION_NAV_ENTRY_CHANGED: - Java_TabBase_onNavEntryChanged(env, weak_java_tab_.get(env).obj()); + Java_Tab_onNavEntryChanged(env, weak_java_tab_.get(env).obj()); break; default: NOTREACHED() << "Unexpected notification " << type; diff --git a/chrome/browser/android/tab_android.h b/chrome/browser/android/tab_android.h index 69e258f..170c8c0 100644 --- a/chrome/browser/android/tab_android.h +++ b/chrome/browser/android/tab_android.h @@ -44,7 +44,7 @@ class TabAndroid : public CoreTabHelperDelegate, // WebContents. Can return NULL. static TabAndroid* FromWebContents(content::WebContents* web_contents); - // Returns the native TabAndroid stored in the Java TabBase represented by + // Returns the native TabAndroid stored in the Java Tab represented by // |obj|. static TabAndroid* GetNativeTab(JNIEnv* env, jobject obj); diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index b686be4..f1090e2 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -3694,7 +3694,7 @@ 'android/java/src/org/chromium/chrome/browser/signin/OAuth2TokenService.java', 'android/java/src/org/chromium/chrome/browser/signin/SigninManager.java', 'android/java/src/org/chromium/chrome/browser/sync/ProfileSyncService.java', - 'android/java/src/org/chromium/chrome/browser/TabBase.java', + 'android/java/src/org/chromium/chrome/browser/Tab.java', 'android/java/src/org/chromium/chrome/browser/TtsPlatformImpl.java', 'android/java/src/org/chromium/chrome/browser/UmaBridge.java', 'android/java/src/org/chromium/chrome/browser/UmaUtils.java', diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/util/TabBaseTabUtils.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/util/TabUtils.java index abc74c6..a42845493 100644 --- a/chrome/test/android/javatests/src/org/chromium/chrome/test/util/TabBaseTabUtils.java +++ b/chrome/test/android/javatests/src/org/chromium/chrome/test/util/TabUtils.java @@ -1,4 +1,4 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -7,7 +7,7 @@ package org.chromium.chrome.test.util; import android.view.ContextMenu; import org.chromium.chrome.browser.EmptyTabObserver; -import org.chromium.chrome.browser.TabBase; +import org.chromium.chrome.browser.Tab; import org.chromium.content.browser.ContentViewClient; import org.chromium.content.browser.test.util.CallbackHelper; import org.chromium.content.browser.test.util.TestCallbackHelperContainer; @@ -20,8 +20,8 @@ import java.lang.ref.WeakReference; /** * A utility class that contains methods generic to all Tabs tests. */ -public class TabBaseTabUtils { - private static TestContentViewClient createTestContentViewClientForTab(TabBase tab) { +public class TabUtils { + private static TestContentViewClient createTestContentViewClientForTab(Tab tab) { ContentViewClient client = tab.getContentView().getContentViewClient(); if (client instanceof TestContentViewClient) return (TestContentViewClient) client; @@ -34,19 +34,19 @@ public class TabBaseTabUtils { private final OnCloseTabHelper mOnCloseTabHelper; private final OnContextMenuShownHelper mOnContextMenuShownHelper; - public TestCallbackHelperContainerForTab(TabBase tab) { + public TestCallbackHelperContainerForTab(Tab tab) { super(createTestContentViewClientForTab(tab), new TestWebContentsObserver(tab.getContentView().getContentViewCore())); mOnCloseTabHelper = new OnCloseTabHelper(); mOnContextMenuShownHelper = new OnContextMenuShownHelper(); tab.addObserver(new EmptyTabObserver() { @Override - public void onDestroyed(TabBase tab) { + public void onDestroyed(Tab tab) { mOnCloseTabHelper.notifyCalled(); } @Override - public void onContextMenuShown(TabBase tab, ContextMenu menu) { + public void onContextMenuShown(Tab tab, ContextMenu menu) { mOnContextMenuShownHelper.notifyCalled(menu); } }); @@ -81,7 +81,7 @@ public class TabBaseTabUtils { /** * Creates, binds and returns a TestCallbackHelperContainer for a given Tab. */ - public static TestCallbackHelperContainerForTab getTestCallbackHelperContainer(TabBase tab) { + public static TestCallbackHelperContainerForTab getTestCallbackHelperContainer(Tab tab) { return tab == null ? null : new TestCallbackHelperContainerForTab(tab); } } diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/contextmenu/ContextMenuUtils.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/contextmenu/ContextMenuUtils.java index 2365a28..0788cb4 100644 --- a/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/contextmenu/ContextMenuUtils.java +++ b/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/contextmenu/ContextMenuUtils.java @@ -11,9 +11,9 @@ import android.view.MenuItem; import junit.framework.Assert; -import org.chromium.chrome.browser.TabBase; -import org.chromium.chrome.test.util.TabBaseTabUtils; -import org.chromium.chrome.test.util.TabBaseTabUtils.TestCallbackHelperContainerForTab; +import org.chromium.chrome.browser.Tab; +import org.chromium.chrome.test.util.TabUtils; +import org.chromium.chrome.test.util.TabUtils.TestCallbackHelperContainerForTab; import org.chromium.content.browser.test.util.Criteria; import org.chromium.content.browser.test.util.CriteriaHelper; import org.chromium.content.browser.test.util.DOMUtils; @@ -36,9 +36,9 @@ public class ContextMenuUtils { * @throws TimeoutException */ public static ContextMenu openContextMenu(ActivityInstrumentationTestCase2 testCase, - TabBase tab, TestCallbackHelperContainerForTab client, String openerDOMNodeId) + Tab tab, TestCallbackHelperContainerForTab client, String openerDOMNodeId) throws InterruptedException, TimeoutException { - if (client == null) client = TabBaseTabUtils.getTestCallbackHelperContainer(tab); + if (client == null) client = TabUtils.getTestCallbackHelperContainer(tab); TestCallbackHelperContainerForTab.OnContextMenuShownHelper helper = client.getOnContextMenuShownHelper(); @@ -62,7 +62,7 @@ public class ContextMenuUtils { * @throws TimeoutException */ public static void selectContextMenuItem(ActivityInstrumentationTestCase2 testCase, - TabBase tab, TestCallbackHelperContainerForTab client, String openerDOMNodeId, + Tab tab, TestCallbackHelperContainerForTab client, String openerDOMNodeId, final int itemId) throws InterruptedException, TimeoutException { ContextMenu menu = openContextMenu(testCase, tab, client, openerDOMNodeId); Assert.assertNotNull("Failed to open context menu", menu); @@ -82,7 +82,7 @@ public class ContextMenuUtils { * @throws TimeoutException */ public static void selectContextMenuItemByTitle(ActivityInstrumentationTestCase2 testCase, - TabBase tab, TestCallbackHelperContainerForTab client, String openerDOMNodeId, + Tab tab, TestCallbackHelperContainerForTab client, String openerDOMNodeId, String itemTitle) throws InterruptedException, TimeoutException { ContextMenu menu = openContextMenu(testCase, tab, client, openerDOMNodeId); |