summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);
}