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

Unified Diff: jingle/notifier/communicator/login.cc

Issue 11620007: Switch from OnIPAddressChanged and OnConnectionTypeChange to OnNetworkChanged Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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: jingle/notifier/communicator/login.cc
diff --git a/jingle/notifier/communicator/login.cc b/jingle/notifier/communicator/login.cc
index 8350d2fc03616d91ec279f4df9c4d9cfa3d2dcc2..d233c7048d64b28311b5419df4bffc96efe39bf6 100644
--- a/jingle/notifier/communicator/login.cc
+++ b/jingle/notifier/communicator/login.cc
@@ -42,15 +42,13 @@ Login::Login(Delegate* delegate,
servers,
try_ssltcp_first,
auth_mechanism) {
- net::NetworkChangeNotifier::AddIPAddressObserver(this);
- net::NetworkChangeNotifier::AddConnectionTypeObserver(this);
+ net::NetworkChangeNotifier::AddNetworkChangeObserver(this);
// TODO(akalin): Add as DNSObserver once bug 130610 is fixed.
ResetReconnectState();
}
Login::~Login() {
- net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this);
- net::NetworkChangeNotifier::RemoveIPAddressObserver(this);
+ net::NetworkChangeNotifier::RemoveNetworkChangeObserver(this);
}
void Login::StartConnection() {
@@ -94,15 +92,12 @@ void Login::OnSettingsExhausted() {
delegate_->OnTransientDisconnection();
}
-void Login::OnIPAddressChanged() {
- DVLOG(1) << "IP address changed";
- OnNetworkEvent();
-}
-
-void Login::OnConnectionTypeChanged(
+void Login::OnNetworkChanged(
net::NetworkChangeNotifier::ConnectionType type) {
- DVLOG(1) << "Connection type changed";
- OnNetworkEvent();
+ if (type != net::NetworkChangeNotifier::CONNECTION_NONE) {
+ DVLOG(1) << "Network changed";
+ OnNetworkEvent();
+ }
}
void Login::OnDNSChanged() {

Powered by Google App Engine
This is Rietveld 408576698