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

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

Issue 6526059: Plumb through NetworkChangeNotifier::IsOffline() to WebKit, enabling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: No tests yet Created 9 years, 10 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
Index: content/browser/tab_contents/tab_contents.cc
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc
index 344e1cbcc3bf6e99e0249100f5a5272ebbf1a315..67a527321c80f4a6fe7091a91794e9bd83942e62 100644
--- a/content/browser/tab_contents/tab_contents.cc
+++ b/content/browser/tab_contents/tab_contents.cc
@@ -397,6 +397,8 @@ TabContents::~TabContents() {
}
FOR_EACH_OBSERVER(TabContentsObserver, observers_, set_tab_contents(NULL));
+
+ net::NetworkChangeNotifier::RemoveOnlineStateObserver(this);
}
void TabContents::AddObservers() {
@@ -411,6 +413,7 @@ void TabContents::AddObservers() {
plugin_observer_.reset(new PluginObserver(this));
safebrowsing_detection_host_.reset(new safe_browsing::ClientSideDetectionHost(
this));
+ net::NetworkChangeNotifier::AddOnlineStateObserver(this);
}
bool TabContents::OnMessageReceived(const IPC::Message& message) {
@@ -2861,6 +2864,11 @@ void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) {
rwh_view->SetSize(view()->GetContainerSize());
}
+void TabContents::OnOnlineStateChanged(bool online) {
+ render_view_host()->Send(new ViewMsg_NetworkStateChanged(
+ render_view_host()->routing_id(), online));
+}
+
bool TabContents::MaybeUsePreloadedPage(const GURL& url) {
prerender::PrerenderManager* pm = profile()->GetPrerenderManager();
if (pm != NULL) {

Powered by Google App Engine
This is Rietveld 408576698