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/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 // | 39 // |
40 // For more details, see the implementation file. | 40 // For more details, see the implementation file. |
41 class NET_EXPORT_PRIVATE NetworkChangeNotifierAndroid | 41 class NET_EXPORT_PRIVATE NetworkChangeNotifierAndroid |
42 : public NetworkChangeNotifier, | 42 : public NetworkChangeNotifier, |
43 public NetworkChangeNotifierDelegateAndroid::Observer { | 43 public NetworkChangeNotifierDelegateAndroid::Observer { |
44 public: | 44 public: |
45 virtual ~NetworkChangeNotifierAndroid(); | 45 virtual ~NetworkChangeNotifierAndroid(); |
46 | 46 |
47 // NetworkChangeNotifier: | 47 // NetworkChangeNotifier: |
48 virtual ConnectionType GetCurrentConnectionType() const override; | 48 virtual ConnectionType GetCurrentConnectionType() const override; |
| 49 // Requires ACCESS_WIFI_STATE permission in order to provide precise WiFi link |
| 50 // speed. |
| 51 virtual double GetCurrentMaxBandwidth() const override; |
49 | 52 |
50 // NetworkChangeNotifierDelegateAndroid::Observer: | 53 // NetworkChangeNotifierDelegateAndroid::Observer: |
51 virtual void OnConnectionTypeChanged() override; | 54 virtual void OnConnectionTypeChanged() override; |
52 | 55 |
53 static bool Register(JNIEnv* env); | 56 static bool Register(JNIEnv* env); |
54 | 57 |
| 58 // Promote GetMaxBandwidthForConnectionSubtype to public for the Android |
| 59 // delegate class. |
| 60 using NetworkChangeNotifier::GetMaxBandwidthForConnectionSubtype; |
| 61 |
55 private: | 62 private: |
56 friend class NetworkChangeNotifierAndroidTest; | 63 friend class NetworkChangeNotifierAndroidTest; |
57 friend class NetworkChangeNotifierFactoryAndroid; | 64 friend class NetworkChangeNotifierFactoryAndroid; |
58 | 65 |
59 class DnsConfigServiceThread; | 66 class DnsConfigServiceThread; |
60 | 67 |
61 explicit NetworkChangeNotifierAndroid( | 68 explicit NetworkChangeNotifierAndroid( |
62 NetworkChangeNotifierDelegateAndroid* delegate); | 69 NetworkChangeNotifierDelegateAndroid* delegate); |
63 | 70 |
64 static NetworkChangeCalculatorParams NetworkChangeCalculatorParamsAndroid(); | 71 static NetworkChangeCalculatorParams NetworkChangeCalculatorParamsAndroid(); |
65 | 72 |
66 NetworkChangeNotifierDelegateAndroid* const delegate_; | 73 NetworkChangeNotifierDelegateAndroid* const delegate_; |
67 scoped_ptr<DnsConfigServiceThread> dns_config_service_thread_; | 74 scoped_ptr<DnsConfigServiceThread> dns_config_service_thread_; |
68 | 75 |
69 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierAndroid); | 76 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierAndroid); |
70 }; | 77 }; |
71 | 78 |
72 } // namespace net | 79 } // namespace net |
73 | 80 |
74 #endif // NET_ANDROID_NETWORK_CHANGE_NOTIFIER_ANDROID_H_ | 81 #endif // NET_ANDROID_NETWORK_CHANGE_NOTIFIER_ANDROID_H_ |
OLD | NEW |