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

Unified Diff: chrome/browser/renderer_host/offline_resource_throttle.cc

Issue 9147026: API for connection type (Ethernet/WIFI/WWAN ...) in NetworkChangeNotifier. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: sync Created 8 years, 7 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: chrome/browser/renderer_host/offline_resource_throttle.cc
diff --git a/chrome/browser/renderer_host/offline_resource_throttle.cc b/chrome/browser/renderer_host/offline_resource_throttle.cc
index b5afb31ec05e96fa113ef61fd1bf0d782fc4c945..97edba62982d7051d078f0a8c03dfb327cd1a1a3 100644
--- a/chrome/browser/renderer_host/offline_resource_throttle.cc
+++ b/chrome/browser/renderer_host/offline_resource_throttle.cc
@@ -40,7 +40,8 @@ void ShowOfflinePage(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// Check again on UI thread and proceed if it's connected.
- if (!net::NetworkChangeNotifier::IsOffline()) {
+ if (net::NetworkChangeNotifier::GetConnectionType() !=
+ net::NetworkChangeNotifier::CONNECTION_NONE) {
wtc 2012/05/11 01:35:05 Nit: this line doesn't need to be indented. Simila
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE, base::Bind(callback, true));
} else {
@@ -127,7 +128,9 @@ bool OfflineResourceThrottle::IsRemote(const GURL& url) const {
bool OfflineResourceThrottle::ShouldShowOfflinePage(const GURL& url) const {
// If the network is disconnected while loading other resources, we'll simply
// show broken link/images.
- return IsRemote(url) && net::NetworkChangeNotifier::IsOffline();
+ return IsRemote(url) &&
+ net::NetworkChangeNotifier::GetConnectionType() ==
+ net::NetworkChangeNotifier::CONNECTION_NONE;
}
void OfflineResourceThrottle::OnCanHandleOfflineComplete(int rv) {

Powered by Google App Engine
This is Rietveld 408576698