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

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

Issue 11343013: Move content\browser\net to content namespace. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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 | Annotate | Revision Log
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 {
11
10 BrowserOnlineStateObserver::BrowserOnlineStateObserver() { 12 BrowserOnlineStateObserver::BrowserOnlineStateObserver() {
11 net::NetworkChangeNotifier::AddConnectionTypeObserver(this); 13 net::NetworkChangeNotifier::AddConnectionTypeObserver(this);
12 } 14 }
13 15
14 BrowserOnlineStateObserver::~BrowserOnlineStateObserver() { 16 BrowserOnlineStateObserver::~BrowserOnlineStateObserver() {
15 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this); 17 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this);
16 } 18 }
17 19
18 void BrowserOnlineStateObserver::OnConnectionTypeChanged( 20 void BrowserOnlineStateObserver::OnConnectionTypeChanged(
19 net::NetworkChangeNotifier::ConnectionType type) { 21 net::NetworkChangeNotifier::ConnectionType type) {
20 for (content::RenderProcessHost::iterator it( 22 for (RenderProcessHost::iterator it(RenderProcessHost::AllHostsIterator());
21 content::RenderProcessHost::AllHostsIterator());
22 !it.IsAtEnd(); it.Advance()) { 23 !it.IsAtEnd(); it.Advance()) {
23 it.GetCurrentValue()->Send(new ViewMsg_NetworkStateChanged( 24 it.GetCurrentValue()->Send(new ViewMsg_NetworkStateChanged(
24 type != net::NetworkChangeNotifier::CONNECTION_NONE)); 25 type != net::NetworkChangeNotifier::CONNECTION_NONE));
25 } 26 }
26 } 27 }
28
29 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698