OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This is a small utility that watches for and logs network changes. | 5 // This is a small utility that watches for and logs network changes. |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 case net::NetworkChangeNotifier::CONNECTION_WIFI: | 43 case net::NetworkChangeNotifier::CONNECTION_WIFI: |
44 return "CONNECTION_WIFI"; | 44 return "CONNECTION_WIFI"; |
45 case net::NetworkChangeNotifier::CONNECTION_2G: | 45 case net::NetworkChangeNotifier::CONNECTION_2G: |
46 return "CONNECTION_2G"; | 46 return "CONNECTION_2G"; |
47 case net::NetworkChangeNotifier::CONNECTION_3G: | 47 case net::NetworkChangeNotifier::CONNECTION_3G: |
48 return "CONNECTION_3G"; | 48 return "CONNECTION_3G"; |
49 case net::NetworkChangeNotifier::CONNECTION_4G: | 49 case net::NetworkChangeNotifier::CONNECTION_4G: |
50 return "CONNECTION_4G"; | 50 return "CONNECTION_4G"; |
51 case net::NetworkChangeNotifier::CONNECTION_NONE: | 51 case net::NetworkChangeNotifier::CONNECTION_NONE: |
52 return "CONNECTION_NONE"; | 52 return "CONNECTION_NONE"; |
| 53 case net::NetworkChangeNotifier::CONNECTION_BLUETOOTH: |
| 54 return "CONNECTION_BLUETOOTH"; |
53 default: | 55 default: |
54 return "CONNECTION_UNEXPECTED"; | 56 return "CONNECTION_UNEXPECTED"; |
55 } | 57 } |
56 } | 58 } |
57 | 59 |
58 std::string ProxyConfigToString(const net::ProxyConfig& config) { | 60 std::string ProxyConfigToString(const net::ProxyConfig& config) { |
59 scoped_ptr<base::Value> config_value(config.ToValue()); | 61 scoped_ptr<base::Value> config_value(config.ToValue()); |
60 std::string str; | 62 std::string str; |
61 base::JSONWriter::Write(config_value.get(), &str); | 63 base::JSONWriter::Write(config_value.get(), &str); |
62 return str; | 64 return str; |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 proxy_config_service->RemoveObserver(&net_watcher); | 191 proxy_config_service->RemoveObserver(&net_watcher); |
190 | 192 |
191 // Uses |network_change_notifier|. | 193 // Uses |network_change_notifier|. |
192 net::NetworkChangeNotifier::RemoveDNSObserver(&net_watcher); | 194 net::NetworkChangeNotifier::RemoveDNSObserver(&net_watcher); |
193 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(&net_watcher); | 195 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(&net_watcher); |
194 net::NetworkChangeNotifier::RemoveIPAddressObserver(&net_watcher); | 196 net::NetworkChangeNotifier::RemoveIPAddressObserver(&net_watcher); |
195 net::NetworkChangeNotifier::RemoveNetworkChangeObserver(&net_watcher); | 197 net::NetworkChangeNotifier::RemoveNetworkChangeObserver(&net_watcher); |
196 | 198 |
197 return 0; | 199 return 0; |
198 } | 200 } |
OLD | NEW |