Chromium Code Reviews| 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(); |
| } |