This source file includes following definitions.
- OnConnectionTypeChanged
#include "content/browser/net/browser_online_state_observer.h"
#include "content/common/view_messages.h"
#include "content/browser/renderer_host/render_process_host_impl.h"
namespace content {
BrowserOnlineStateObserver::BrowserOnlineStateObserver() {
net::NetworkChangeNotifier::AddConnectionTypeObserver(this);
}
BrowserOnlineStateObserver::~BrowserOnlineStateObserver() {
net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this);
}
void BrowserOnlineStateObserver::OnConnectionTypeChanged(
net::NetworkChangeNotifier::ConnectionType type) {
for (RenderProcessHost::iterator it(RenderProcessHost::AllHostsIterator());
!it.IsAtEnd(); it.Advance()) {
it.GetCurrentValue()->Send(new ViewMsg_NetworkStateChanged(
type != net::NetworkChangeNotifier::CONNECTION_NONE));
}
}
}