summaryrefslogtreecommitdiffstats
path: root/jingle
diff options
context:
space:
mode:
authoradamk@chromium.org <adamk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-04 22:42:08 +0000
committeradamk@chromium.org <adamk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-04 22:42:08 +0000
commit232a58169700ed7abde79d9858c288eb21409e60 (patch)
treea1424f86d252cd3859c060954882a9a1809a5121 /jingle
parentcdc5489ddff18b5ff13296abc1c8869e3cd7db28 (diff)
downloadchromium_src-232a58169700ed7abde79d9858c288eb21409e60.zip
chromium_src-232a58169700ed7abde79d9858c288eb21409e60.tar.gz
chromium_src-232a58169700ed7abde79d9858c288eb21409e60.tar.bz2
Plumb through NetworkChangeNotifier::IsOffline() to WebKit, enabling
navigator.onLine and online/offline events. Only works on Windows at the moment, as IsCurrentlyOffline() is supported only by NetworkChangeNotifierWin. Most of the changes are due to the need to support two different kinds of NetworkChangeNotifier observers. Both observers currently happen to trigger on the same event, but that could change, e.g., if we store the previous online state and only notify on a change. Thus the need for two different observer interfaces, and associated Add/Remove methods. BUG=7469 TEST=Load https://bug336359.bugzilla.mozilla.org/attachment.cgi?id=220609, unplug network cable, reload, see that page changes to note offline status Review URL: http://codereview.chromium.org/6526059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76985 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'jingle')
-rw-r--r--jingle/notifier/communicator/login.cc4
-rw-r--r--jingle/notifier/communicator/login.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/jingle/notifier/communicator/login.cc b/jingle/notifier/communicator/login.cc
index de0d525..b19169c 100644
--- a/jingle/notifier/communicator/login.cc
+++ b/jingle/notifier/communicator/login.cc
@@ -47,12 +47,12 @@ Login::Login(Delegate* delegate,
server_count,
try_ssltcp_first)),
redirect_port_(0) {
- net::NetworkChangeNotifier::AddObserver(this);
+ net::NetworkChangeNotifier::AddIPAddressObserver(this);
ResetReconnectState();
}
Login::~Login() {
- net::NetworkChangeNotifier::RemoveObserver(this);
+ net::NetworkChangeNotifier::RemoveIPAddressObserver(this);
}
void Login::StartConnection() {
diff --git a/jingle/notifier/communicator/login.h b/jingle/notifier/communicator/login.h
index e4ec069b..d7ecbdf 100644
--- a/jingle/notifier/communicator/login.h
+++ b/jingle/notifier/communicator/login.h
@@ -44,7 +44,7 @@ typedef SingleLoginAttempt::Delegate SingleLoginAttemptDelegate;
// Does the login, keeps it alive (with refreshing cookies and reattempting
// login when disconnected), figures out what actions to take on the various
// errors that may occur.
-class Login : public net::NetworkChangeNotifier::Observer,
+class Login : public net::NetworkChangeNotifier::IPAddressObserver,
public SingleLoginAttemptDelegate {
public:
class Delegate {
@@ -69,7 +69,7 @@ class Login : public net::NetworkChangeNotifier::Observer,
void StartConnection();
- // net::NetworkChangeNotifier::Observer implementation.
+ // net::NetworkChangeNotifier::IPAddressObserver implementation.
virtual void OnIPAddressChanged();
// SingleLoginAttempt::Delegate implementation.