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

Unified Diff: content/browser/tab_contents/tab_contents.cc

Issue 7300018: Revert 91390 (build breakage) - Convert ViewMsg_NetworkStateChanged from routed -> control (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 6 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/tab_contents/tab_contents.h ('k') | content/common/view_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/tab_contents/tab_contents.cc
===================================================================
--- content/browser/tab_contents/tab_contents.cc (revision 91391)
+++ content/browser/tab_contents/tab_contents.cc (working copy)
@@ -201,6 +201,11 @@
registrar_.Add(this, NotificationType::RENDER_WIDGET_HOST_DESTROYED,
NotificationService::AllSources());
+
+ // Can only add observers after render_manager_.Init() is called, since that's
+ // what sets up the render_view_host which TabContentObserver's constructor
+ // uses to get the routing_id.
+ AddObservers();
}
TabContents::~TabContents() {
@@ -246,6 +251,8 @@
FOR_EACH_OBSERVER(TabContentsObserver, observers_, TabContentsDestroyed());
+ net::NetworkChangeNotifier::RemoveOnlineStateObserver(this);
+
set_delegate(NULL);
}
@@ -260,6 +267,10 @@
delegate_->Attach(this);
}
+void TabContents::AddObservers() {
+ net::NetworkChangeNotifier::AddOnlineStateObserver(this);
+}
+
bool TabContents::OnMessageReceived(const IPC::Message& message) {
if (web_ui() && web_ui()->OnMessageReceived(message))
return true;
@@ -1830,3 +1841,8 @@
RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh);
rwh_view->SetSize(view()->GetContainerSize());
}
+
+void TabContents::OnOnlineStateChanged(bool online) {
+ render_view_host()->Send(new ViewMsg_NetworkStateChanged(
+ render_view_host()->routing_id(), online));
+}
« no previous file with comments | « content/browser/tab_contents/tab_contents.h ('k') | content/common/view_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698