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 ccdc2e0271bb7dd8da93ee8210f0d3351ad4268b..322650c3d4de77fd9c9ded187e8b708809e6b83e 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()); |
+ } |
+ } |
} |
} |