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..08140701f7428c697c7489524f34c6f3ad361dcb 100644 |
| --- a/net/base/network_change_notifier.cc |
| +++ b/net/base/network_change_notifier.cc |
| @@ -252,6 +252,29 @@ void NetworkChangeNotifier::GetDnsConfig(DnsConfig* config) { |
| } |
| // static |
| +const char* NetworkChangeNotifier::ConnectionTypeToString( |
| + ConnectionType type) { |
| + switch (type) { |
| + case CONNECTION_UNKNOWN: |
| + return "CONNECTION_UNKNOWN"; |
| + case CONNECTION_ETHERNET: |
| + return "CONNECTION_ETHERNET"; |
| + case CONNECTION_WIFI: |
| + return "CONNECTION_WIFI"; |
| + case CONNECTION_2G: |
| + return "CONNECTION_2G"; |
| + case CONNECTION_3G: |
| + return "CONNECTION_3G"; |
| + case CONNECTION_4G: |
| + return "CONNECTION_4G"; |
| + case CONNECTION_NONE: |
| + return "CONNECTION_NONE"; |
| + } |
|
mmenke
2012/10/25 16:25:31
To avoid regressions, I suggest putting these in a
pauljensen
2012/10/25 17:08:15
I copied the method of NetLog::EventPhaseToString(
mmenke
2012/10/25 17:34:57
Rsleevi's method is nifty, too. EventPhaseToStrin
|
| + NOTREACHED(); |
| + return NULL; |
| +} |
| + |
| +// static |
| void NetworkChangeNotifier::NotifyDataReceived(const GURL& source) { |
| if (!g_network_change_notifier) |
| return; |