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

Unified Diff: net/base/network_change_notifier.cc

Issue 11115009: Helper functions in NetworkChangeNotifier related to WWAN use (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 2 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
« net/base/network_change_notifier.h ('K') | « net/base/network_change_notifier.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/network_change_notifier.cc
diff --git a/net/base/network_change_notifier.cc b/net/base/network_change_notifier.cc
index 6b87a3a95cd9e18ec9d15743c3fc4206f626fa1d..5b8c130cdbb687f1842664ea65a987e64ccde8d4 100644
--- a/net/base/network_change_notifier.cc
+++ b/net/base/network_change_notifier.cc
@@ -275,6 +275,21 @@ NetworkChangeNotifier::GetAddressTracker() {
#endif
// static
+bool NetworkChangeNotifier::IsOffline() {
+ return GetConnectionType() == CONNECTION_NONE;
+}
+
+// static
+bool NetworkChangeNotifier::IsOverWWAN() {
+ return IsOverWWAN(GetConnectionType());
+}
+
+// static
+bool NetworkChangeNotifier::IsOverWWAN(ConnectionType type) {
+ return type >= CONNECTION_2G && type <= CONNECTION_4G;
pauljensen 2012/10/12 14:01:15 I'd prefer a switch statement. If you want to sti
+}
+
+// static
NetworkChangeNotifier* NetworkChangeNotifier::CreateMock() {
return new MockNetworkChangeNotifier();
}
« net/base/network_change_notifier.h ('K') | « net/base/network_change_notifier.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698