Index: content/browser/web_contents/web_contents_impl.cc |
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc |
index 2d3c542c58a29808e9a7f2b8257bf6608a935459..fb4b48b56153cf44b8908a8283827c1cf5932a20 100644 |
--- a/content/browser/web_contents/web_contents_impl.cc |
+++ b/content/browser/web_contents/web_contents_impl.cc |
@@ -2795,6 +2795,10 @@ void WebContentsImpl::NotifySwapped(RenderViewHost* old_render_view_host) { |
// notification so that clients that pick up a pointer to |this| can NULL the |
// pointer. See Bug 1230284. |
notify_disconnection_ = true; |
+ FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
+ RenderViewHostSwapped(old_render_view_host)); |
+ |
+ // TODO(avi): Remove. http://crbug.com/170921 |
NotificationService::current()->Notify( |
NOTIFICATION_WEB_CONTENTS_SWAPPED, |
Source<WebContents>(this), |
@@ -2806,14 +2810,8 @@ void WebContentsImpl::NotifySwapped(RenderViewHost* old_render_view_host) { |
RemoveBrowserPluginEmbedder(); |
} |
-void WebContentsImpl::NotifyConnected() { |
- notify_disconnection_ = true; |
- NotificationService::current()->Notify( |
- NOTIFICATION_WEB_CONTENTS_CONNECTED, |
- Source<WebContents>(this), |
- NotificationService::NoDetails()); |
-} |
- |
+// TODO(avi): Remove this entire function because this notification is already |
+// covered by two observer functions. http://crbug.com/170921 |
void WebContentsImpl::NotifyDisconnected() { |
if (!notify_disconnection_) |
return; |
@@ -2900,7 +2898,13 @@ void WebContentsImpl::RenderViewReady(RenderViewHost* rvh) { |
return; |
} |
- NotifyConnected(); |
+ notify_disconnection_ = true; |
+ // TODO(avi): Remove. http://crbug.com/170921 |
+ NotificationService::current()->Notify( |
+ NOTIFICATION_WEB_CONTENTS_CONNECTED, |
+ Source<WebContents>(this), |
+ NotificationService::NoDetails()); |
+ |
bool was_crashed = IsCrashed(); |
SetIsCrashed(base::TERMINATION_STATUS_STILL_RUNNING, 0); |