Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(857)

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 23784005: Provide observer functions for NOTIFICATION_WEB_CONTENTS_CONNECTED, NOTIFICATION_WEB_CONTENTS_SWAPP… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: better name Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/public/browser/notification_types.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/public/browser/notification_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698