diff options
author | adamk@chromium.org <adamk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-04 22:42:08 +0000 |
---|---|---|
committer | adamk@chromium.org <adamk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-04 22:42:08 +0000 |
commit | 232a58169700ed7abde79d9858c288eb21409e60 (patch) | |
tree | a1424f86d252cd3859c060954882a9a1809a5121 /chrome/browser/google | |
parent | cdc5489ddff18b5ff13296abc1c8869e3cd7db28 (diff) | |
download | chromium_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 'chrome/browser/google')
-rw-r--r-- | chrome/browser/google/google_url_tracker.cc | 4 | ||||
-rw-r--r-- | chrome/browser/google/google_url_tracker.h | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/chrome/browser/google/google_url_tracker.cc b/chrome/browser/google/google_url_tracker.cc index 142e7c7..1b2c686 100644 --- a/chrome/browser/google/google_url_tracker.cc +++ b/chrome/browser/google/google_url_tracker.cc @@ -105,7 +105,7 @@ GoogleURLTracker::GoogleURLTracker() registrar_.Add(this, NotificationType::DEFAULT_REQUEST_CONTEXT_AVAILABLE, NotificationService::AllSources()); - net::NetworkChangeNotifier::AddObserver(this); + net::NetworkChangeNotifier::AddIPAddressObserver(this); MessageLoop::current()->PostTask(FROM_HERE, runnable_method_factory_.NewRunnableMethod( @@ -114,7 +114,7 @@ GoogleURLTracker::GoogleURLTracker() GoogleURLTracker::~GoogleURLTracker() { runnable_method_factory_.RevokeAll(); - net::NetworkChangeNotifier::RemoveObserver(this); + net::NetworkChangeNotifier::RemoveIPAddressObserver(this); } // static diff --git a/chrome/browser/google/google_url_tracker.h b/chrome/browser/google/google_url_tracker.h index 0c405dd..bfac848 100644 --- a/chrome/browser/google/google_url_tracker.h +++ b/chrome/browser/google/google_url_tracker.h @@ -37,7 +37,7 @@ class TemplateURL; // RequestServerCheck(). class GoogleURLTracker : public URLFetcher::Delegate, public NotificationObserver, - public net::NetworkChangeNotifier::Observer { + public net::NetworkChangeNotifier::IPAddressObserver { public: // Only the main browser process loop should call this, when setting up // g_browser_process->google_url_tracker_. No code other than the @@ -118,7 +118,7 @@ class GoogleURLTracker : public URLFetcher::Delegate, const NotificationSource& source, const NotificationDetails& details); - // NetworkChangeNotifier::Observer + // NetworkChangeNotifier::IPAddressObserver virtual void OnIPAddressChanged(); void SearchCommitted(); |