summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordtrainor@chromium.org <dtrainor@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-05 03:26:31 +0000
committerdtrainor@chromium.org <dtrainor@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-05 03:26:31 +0000
commit79982b6ebef6be4b57d76797316ad1e5c32a4574 (patch)
tree07c1c9d5fbff9f153ff49844c7014d10c23df8cd
parent0f42f11ccbb7de2dbea2404481985a9473e694bd (diff)
downloadchromium_src-79982b6ebef6be4b57d76797316ad1e5c32a4574.zip
chromium_src-79982b6ebef6be4b57d76797316ad1e5c32a4574.tar.gz
chromium_src-79982b6ebef6be4b57d76797316ad1e5c32a4574.tar.bz2
Expose swapping the web contents out to observers
BUG=321901 Review URL: https://codereview.chromium.org/89563002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238874 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/android/java/src/org/chromium/chrome/browser/EmptyTabObserver.java3
-rw-r--r--chrome/android/java/src/org/chromium/chrome/browser/TabBase.java1
-rw-r--r--chrome/android/java/src/org/chromium/chrome/browser/TabObserver.java6
-rw-r--r--content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java1
4 files changed, 11 insertions, 0 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 aecf9cf..d812f16 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/EmptyTabObserver.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/EmptyTabObserver.java
@@ -19,6 +19,9 @@ public class EmptyTabObserver implements TabObserver {
public void onFaviconUpdated(TabBase tab) { }
@Override
+ public void onWebContentsSwapped(TabBase tab) { }
+
+ @Override
public void onLoadProgressChanged(TabBase tab, int progress) { }
@Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/TabBase.java b/chrome/android/java/src/org/chromium/chrome/browser/TabBase.java
index f809409..05f1386 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/TabBase.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/TabBase.java
@@ -713,6 +713,7 @@ public abstract class TabBase implements NavigationClient {
mContentViewCore.attachImeAdapter();
for (TabObserver observer : mObservers) observer.onContentChanged(this);
destroyNativePageInternal(previousNativePage);
+ for (TabObserver observer : mObservers) observer.onWebContentsSwapped(this);
}
@CalledByNative
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 c967cc5..78f963d 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/TabObserver.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/TabObserver.java
@@ -27,6 +27,12 @@ public interface TabObserver {
*/
void onFaviconUpdated(TabBase tab);
+ /**
+ * Called when the WebContents of a {@link TabBase} have been swapped.
+ * @param tab The notifying {@link TabBase}.
+ */
+ void onWebContentsSwapped(TabBase tab);
+
// WebContentsDelegateAndroid methods ---------------------------------------------------------
/**
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
index 16b9ebe..c0f2341 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
@@ -2871,6 +2871,7 @@ public class ContentViewCore
* once the texture is actually ready.
*/
public boolean isReady() {
+ if (mNativeContentViewCore == 0) return false;
return nativeIsRenderWidgetHostViewReady(mNativeContentViewCore);
}