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 #ifndef NET_BASE_NETWORK_CHANGE_NOTIFIER_H_ | 5 #ifndef NET_BASE_NETWORK_CHANGE_NOTIFIER_H_ |
6 #define NET_BASE_NETWORK_CHANGE_NOTIFIER_H_ | 6 #define NET_BASE_NETWORK_CHANGE_NOTIFIER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 // and will be called back on the thread from which they registered. | 34 // and will be called back on the thread from which they registered. |
35 // NetworkChangeNotifiers are threadsafe, though they must be created and | 35 // NetworkChangeNotifiers are threadsafe, though they must be created and |
36 // destroyed on the same thread. | 36 // destroyed on the same thread. |
37 class NET_EXPORT NetworkChangeNotifier { | 37 class NET_EXPORT NetworkChangeNotifier { |
38 public: | 38 public: |
39 // This is a superset of the connection types in the NetInfo v3 specification: | 39 // This is a superset of the connection types in the NetInfo v3 specification: |
40 // http://w3c.github.io/netinfo/. | 40 // http://w3c.github.io/netinfo/. |
41 // | 41 // |
42 // A Java counterpart will be generated for this enum. | 42 // A Java counterpart will be generated for this enum. |
43 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.net | 43 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.net |
| 44 // |
| 45 // New enum values should only be added to the end of the enum and no values |
| 46 // should be modified or reused, as this is reported via UMA. |
44 enum ConnectionType { | 47 enum ConnectionType { |
45 CONNECTION_UNKNOWN = 0, // A connection exists, but its type is unknown. | 48 CONNECTION_UNKNOWN = 0, // A connection exists, but its type is unknown. |
46 // Also used as a default value. | 49 // Also used as a default value. |
47 CONNECTION_ETHERNET = 1, | 50 CONNECTION_ETHERNET = 1, |
48 CONNECTION_WIFI = 2, | 51 CONNECTION_WIFI = 2, |
49 CONNECTION_2G = 3, | 52 CONNECTION_2G = 3, |
50 CONNECTION_3G = 4, | 53 CONNECTION_3G = 4, |
51 CONNECTION_4G = 5, | 54 CONNECTION_4G = 5, |
52 CONNECTION_NONE = 6, // No connection. | 55 CONNECTION_NONE = 6, // No connection. |
53 CONNECTION_BLUETOOTH = 7, | 56 CONNECTION_BLUETOOTH = 7, |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 | 443 |
441 // Set true to disable non-test notifications (to prevent flakes in tests). | 444 // Set true to disable non-test notifications (to prevent flakes in tests). |
442 bool test_notifications_only_; | 445 bool test_notifications_only_; |
443 | 446 |
444 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifier); | 447 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifier); |
445 }; | 448 }; |
446 | 449 |
447 } // namespace net | 450 } // namespace net |
448 | 451 |
449 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_H_ | 452 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_H_ |
OLD | NEW |