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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 double GetCurrentMaxBandwidth() const override; |
53 | 53 |
54 // NetworkChangeNotifierDelegateAndroid::Observer: | 54 // NetworkChangeNotifierDelegateAndroid::Observer: |
55 void OnConnectionTypeChanged() override; | 55 void OnConnectionTypeChanged() override; |
56 void OnMaxBandwidthChanged(double max_bandwidth_mbps) override; | 56 void OnMaxBandwidthChanged(ConnectionType type, |
| 57 double max_bandwidth_mbps) override; |
57 | 58 |
58 static bool Register(JNIEnv* env); | 59 static bool Register(JNIEnv* env); |
59 | 60 |
60 // Promote GetMaxBandwidthForConnectionSubtype to public for the Android | 61 // Promote GetMaxBandwidthForConnectionSubtype to public for the Android |
61 // delegate class. | 62 // delegate class. |
62 using NetworkChangeNotifier::GetMaxBandwidthForConnectionSubtype; | 63 using NetworkChangeNotifier::GetMaxBandwidthForConnectionSubtype; |
63 | 64 |
64 private: | 65 private: |
65 friend class NetworkChangeNotifierAndroidTest; | 66 friend class NetworkChangeNotifierAndroidTest; |
66 friend class NetworkChangeNotifierFactoryAndroid; | 67 friend class NetworkChangeNotifierFactoryAndroid; |
67 | 68 |
68 class DnsConfigServiceThread; | 69 class DnsConfigServiceThread; |
69 | 70 |
70 NetworkChangeNotifierAndroid(NetworkChangeNotifierDelegateAndroid* delegate, | 71 NetworkChangeNotifierAndroid(NetworkChangeNotifierDelegateAndroid* delegate, |
71 const DnsConfig* dns_config_for_testing); | 72 const DnsConfig* dns_config_for_testing); |
72 | 73 |
73 static NetworkChangeCalculatorParams NetworkChangeCalculatorParamsAndroid(); | 74 static NetworkChangeCalculatorParams NetworkChangeCalculatorParamsAndroid(); |
74 | 75 |
75 NetworkChangeNotifierDelegateAndroid* const delegate_; | 76 NetworkChangeNotifierDelegateAndroid* const delegate_; |
76 scoped_ptr<DnsConfigServiceThread> dns_config_service_thread_; | 77 scoped_ptr<DnsConfigServiceThread> dns_config_service_thread_; |
77 | 78 |
78 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierAndroid); | 79 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierAndroid); |
79 }; | 80 }; |
80 | 81 |
81 } // namespace net | 82 } // namespace net |
82 | 83 |
83 #endif // NET_ANDROID_NETWORK_CHANGE_NOTIFIER_ANDROID_H_ | 84 #endif // NET_ANDROID_NETWORK_CHANGE_NOTIFIER_ANDROID_H_ |
OLD | NEW |