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 e5600d3582b5dc1747d5d9a07f626b175bd504db..e77e8f9d8a84a06995cdba2fb9def9195174cef3 100644 |
--- a/content/browser/android/content_view_core_impl.cc |
+++ b/content/browser/android/content_view_core_impl.cc |
@@ -218,17 +218,14 @@ void ContentViewCoreImpl::OnJavaContentViewCoreDestroyed(JNIEnv* env, |
void ContentViewCoreImpl::InitWebContents() { |
DCHECK(web_contents_); |
notification_registrar_.Add( |
- this, NOTIFICATION_RENDER_VIEW_HOST_CHANGED, |
- Source<NavigationController>(&web_contents_->GetController())); |
+ this, NOTIFICATION_WEB_CONTENTS_SWAPPED, |
+ Source<WebContents>(web_contents_)); |
notification_registrar_.Add( |
this, NOTIFICATION_RENDERER_PROCESS_CREATED, |
content::NotificationService::AllBrowserContextsAndSources()); |
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); |
@@ -241,7 +238,7 @@ void ContentViewCoreImpl::Observe(int type, |
const NotificationSource& source, |
const NotificationDetails& details) { |
switch (type) { |
- case NOTIFICATION_RENDER_VIEW_HOST_CHANGED: { |
+ case NOTIFICATION_WEB_CONTENTS_SWAPPED: { |
std::pair<RenderViewHost*, RenderViewHost*>* switched_details = |
Details<std::pair<RenderViewHost*, RenderViewHost*> >(details).ptr(); |
int old_pid = 0; |
@@ -258,6 +255,7 @@ void ContentViewCoreImpl::Observe(int type, |
if (!obj.is_null()) { |
Java_ContentViewCore_onRenderProcessSwap( |
env, obj.obj(), old_pid, new_pid); |
+ Java_ContentViewCore_onWebContentsSwapped(env, obj.obj()); //? |
} |
} |
break; |
@@ -288,13 +286,6 @@ 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()); |
- } |
- } |
} |
} |