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_ANDROID_H_ | 5 #ifndef NET_ANDROID_NETWORK_CHANGE_NOTIFIER_ANDROID_H_ |
6 #define NET_ANDROID_NETWORK_CHANGE_NOTIFIER_ANDROID_H_ | 6 #define NET_ANDROID_NETWORK_CHANGE_NOTIFIER_ANDROID_H_ |
7 | 7 |
8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 class NET_EXPORT_PRIVATE NetworkChangeNotifierAndroid | 42 class NET_EXPORT_PRIVATE NetworkChangeNotifierAndroid |
43 : public NetworkChangeNotifier, | 43 : public NetworkChangeNotifier, |
44 public NetworkChangeNotifierDelegateAndroid::Observer { | 44 public NetworkChangeNotifierDelegateAndroid::Observer { |
45 public: | 45 public: |
46 ~NetworkChangeNotifierAndroid() override; | 46 ~NetworkChangeNotifierAndroid() override; |
47 | 47 |
48 // NetworkChangeNotifier: | 48 // NetworkChangeNotifier: |
49 ConnectionType GetCurrentConnectionType() const override; | 49 ConnectionType GetCurrentConnectionType() const override; |
50 // Requires ACCESS_WIFI_STATE permission in order to provide precise WiFi link | 50 // Requires ACCESS_WIFI_STATE permission in order to provide precise WiFi link |
51 // speed. | 51 // speed. |
52 double GetCurrentMaxBandwidth() const override; | 52 void GetCurrentMaxBandwidthAndConnectionType( |
| 53 double* max_bandwidth_mbps, |
| 54 ConnectionType* connection_type) const override; |
53 | 55 |
54 // NetworkChangeNotifierDelegateAndroid::Observer: | 56 // NetworkChangeNotifierDelegateAndroid::Observer: |
55 void OnConnectionTypeChanged() override; | 57 void OnConnectionTypeChanged() override; |
56 void OnMaxBandwidthChanged(double max_bandwidth_mbps) override; | 58 void OnMaxBandwidthChanged(double max_bandwidth_mbps, |
| 59 ConnectionType type) override; |
57 | 60 |
58 static bool Register(JNIEnv* env); | 61 static bool Register(JNIEnv* env); |
59 | 62 |
60 // Promote GetMaxBandwidthForConnectionSubtype to public for the Android | 63 // Promote GetMaxBandwidthForConnectionSubtype to public for the Android |
61 // delegate class. | 64 // delegate class. |
62 using NetworkChangeNotifier::GetMaxBandwidthForConnectionSubtype; | 65 using NetworkChangeNotifier::GetMaxBandwidthForConnectionSubtype; |
63 | 66 |
64 private: | 67 private: |
65 friend class NetworkChangeNotifierAndroidTest; | 68 friend class NetworkChangeNotifierAndroidTest; |
66 friend class NetworkChangeNotifierFactoryAndroid; | 69 friend class NetworkChangeNotifierFactoryAndroid; |
67 | 70 |
68 class DnsConfigServiceThread; | 71 class DnsConfigServiceThread; |
69 | 72 |
70 NetworkChangeNotifierAndroid(NetworkChangeNotifierDelegateAndroid* delegate, | 73 NetworkChangeNotifierAndroid(NetworkChangeNotifierDelegateAndroid* delegate, |
71 const DnsConfig* dns_config_for_testing); | 74 const DnsConfig* dns_config_for_testing); |
72 | 75 |
73 static NetworkChangeCalculatorParams NetworkChangeCalculatorParamsAndroid(); | 76 static NetworkChangeCalculatorParams NetworkChangeCalculatorParamsAndroid(); |
74 | 77 |
75 NetworkChangeNotifierDelegateAndroid* const delegate_; | 78 NetworkChangeNotifierDelegateAndroid* const delegate_; |
76 scoped_ptr<DnsConfigServiceThread> dns_config_service_thread_; | 79 scoped_ptr<DnsConfigServiceThread> dns_config_service_thread_; |
77 | 80 |
78 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierAndroid); | 81 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierAndroid); |
79 }; | 82 }; |
80 | 83 |
81 } // namespace net | 84 } // namespace net |
82 | 85 |
83 #endif // NET_ANDROID_NETWORK_CHANGE_NOTIFIER_ANDROID_H_ | 86 #endif // NET_ANDROID_NETWORK_CHANGE_NOTIFIER_ANDROID_H_ |
OLD | NEW |