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

Side by Side Diff: content/browser/net/browser_online_state_observer.cc

Issue 298803006: NetInfo V3 support for browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restore accidentally removed param traits Created 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/renderer_host/render_view_host_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/net/browser_online_state_observer.h" 5 #include "content/browser/net/browser_online_state_observer.h"
6 6
7 #include "content/common/view_messages.h" 7 #include "content/common/view_messages.h"
8 #include "content/browser/renderer_host/render_process_host_impl.h" 8 #include "content/browser/renderer_host/render_process_host_impl.h"
9 9
10 namespace content { 10 namespace content {
11 11
12 BrowserOnlineStateObserver::BrowserOnlineStateObserver() { 12 BrowserOnlineStateObserver::BrowserOnlineStateObserver() {
13 net::NetworkChangeNotifier::AddConnectionTypeObserver(this); 13 net::NetworkChangeNotifier::AddConnectionTypeObserver(this);
14 } 14 }
15 15
16 BrowserOnlineStateObserver::~BrowserOnlineStateObserver() { 16 BrowserOnlineStateObserver::~BrowserOnlineStateObserver() {
17 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this); 17 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this);
18 } 18 }
19 19
20 void BrowserOnlineStateObserver::OnConnectionTypeChanged( 20 void BrowserOnlineStateObserver::OnConnectionTypeChanged(
21 net::NetworkChangeNotifier::ConnectionType type) { 21 net::NetworkChangeNotifier::ConnectionType type) {
22 bool is_online = !net::NetworkChangeNotifier::IsOffline();
22 for (RenderProcessHost::iterator it(RenderProcessHost::AllHostsIterator()); 23 for (RenderProcessHost::iterator it(RenderProcessHost::AllHostsIterator());
23 !it.IsAtEnd(); it.Advance()) { 24 !it.IsAtEnd(); it.Advance()) {
24 it.GetCurrentValue()->Send(new ViewMsg_NetworkStateChanged( 25 it.GetCurrentValue()->Send(
25 type != net::NetworkChangeNotifier::CONNECTION_NONE)); 26 new ViewMsg_NetworkStateChanged(is_online, type));
26 } 27 }
27 } 28 }
28 29
29 } // namespace content 30 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_view_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698