Index: content/browser/android/content_view_core_impl.cc |
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc |
index 204145c773647024dade3629fe31daaf9bc4fbd1..c55e6323d407f1155be15b20416c2bcec20abd49 100644 |
--- a/content/browser/android/content_view_core_impl.cc |
+++ b/content/browser/android/content_view_core_impl.cc |
@@ -219,6 +219,9 @@ void ContentViewCoreImpl::InitWebContents() { |
notification_registrar_.Add( |
this, NOTIFICATION_WEB_CONTENTS_CONNECTED, |
Source<WebContents>(web_contents_)); |
+ notification_registrar_.Add( |
+ this, NOTIFICATION_WEB_CONTENTS_SWAPPED, |
+ Source<WebContents>(web_contents_)); |
static_cast<WebContentsViewAndroid*>(web_contents_->GetView())-> |
SetContentViewCore(this); |
@@ -278,6 +281,13 @@ void ContentViewCoreImpl::Observe(int type, |
} |
break; |
} |
+ case NOTIFICATION_WEB_CONTENTS_SWAPPED: { |
+ JNIEnv* env = AttachCurrentThread(); |
+ ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
+ if (!obj.is_null()) { |
+ Java_ContentViewCore_onWebContentsSwapped(env, obj.obj()); |
+ } |
+ } |
} |
} |