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_ANDROID_NETWORK_CHANGE_NOTIFIER_DELEGATE_ANDROID_H_ | 5 #ifndef NET_ANDROID_NETWORK_CHANGE_NOTIFIER_DELEGATE_ANDROID_H_ |
6 #define NET_ANDROID_NETWORK_CHANGE_NOTIFIER_DELEGATE_ANDROID_H_ | 6 #define NET_ANDROID_NETWORK_CHANGE_NOTIFIER_DELEGATE_ANDROID_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 void RemoveObserver(Observer* observer); | 99 void RemoveObserver(Observer* observer); |
100 | 100 |
101 // These methods are simply implementations of NetworkChangeNotifier APIs of | 101 // These methods are simply implementations of NetworkChangeNotifier APIs of |
102 // the same name. They can be called from any thread. | 102 // the same name. They can be called from any thread. |
103 ConnectionType GetCurrentConnectionType() const; | 103 ConnectionType GetCurrentConnectionType() const; |
104 void GetCurrentMaxBandwidthAndConnectionType( | 104 void GetCurrentMaxBandwidthAndConnectionType( |
105 double* max_bandwidth_mbps, | 105 double* max_bandwidth_mbps, |
106 ConnectionType* connection_type) const; | 106 ConnectionType* connection_type) const; |
107 ConnectionType GetNetworkConnectionType(NetworkHandle network) const; | 107 ConnectionType GetNetworkConnectionType(NetworkHandle network) const; |
108 NetworkHandle GetCurrentDefaultNetwork() const; | 108 NetworkHandle GetCurrentDefaultNetwork() const; |
| 109 bool GetCurrentNetworkCaptivePortal() const; |
109 void GetCurrentlyConnectedNetworks(NetworkList* network_list) const; | 110 void GetCurrentlyConnectedNetworks(NetworkList* network_list) const; |
110 | 111 |
111 // Can only be called from the main (Java) thread. | 112 // Can only be called from the main (Java) thread. |
112 NetworkChangeNotifier::ConnectionSubtype GetCurrentConnectionSubtype() const; | 113 NetworkChangeNotifier::ConnectionSubtype GetCurrentConnectionSubtype() const; |
113 | 114 |
114 // Initializes JNI bindings. | 115 // Initializes JNI bindings. |
115 static bool Register(JNIEnv* env); | 116 static bool Register(JNIEnv* env); |
116 | 117 |
117 private: | 118 private: |
118 friend class BaseNetworkChangeNotifierAndroidTest; | 119 friend class BaseNetworkChangeNotifierAndroidTest; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 double connection_max_bandwidth_; | 152 double connection_max_bandwidth_; |
152 NetworkHandle default_network_; | 153 NetworkHandle default_network_; |
153 NetworkMap network_map_; | 154 NetworkMap network_map_; |
154 | 155 |
155 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierDelegateAndroid); | 156 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierDelegateAndroid); |
156 }; | 157 }; |
157 | 158 |
158 } // namespace net | 159 } // namespace net |
159 | 160 |
160 #endif // NET_ANDROID_NETWORK_CHANGE_NOTIFIER_DELEGATE_ANDROID_H_ | 161 #endif // NET_ANDROID_NETWORK_CHANGE_NOTIFIER_DELEGATE_ANDROID_H_ |
OLD | NEW |