| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 static bool Register(JNIEnv* env); | 55 static bool Register(JNIEnv* env); |
| 56 | 56 |
| 57 private: | 57 private: |
| 58 friend class NetworkChangeNotifierAndroidTest; | 58 friend class NetworkChangeNotifierAndroidTest; |
| 59 friend class NetworkChangeNotifierFactoryAndroid; | 59 friend class NetworkChangeNotifierFactoryAndroid; |
| 60 | 60 |
| 61 explicit NetworkChangeNotifierAndroid( | 61 explicit NetworkChangeNotifierAndroid( |
| 62 NetworkChangeNotifierDelegateAndroid* delegate); | 62 NetworkChangeNotifierDelegateAndroid* delegate); |
| 63 | 63 |
| 64 void SetConnectionType(ConnectionType new_connection_type); | 64 // Returns the previous connection type. |
| 65 ConnectionType SetConnectionType(ConnectionType new_connection_type); |
| 65 | 66 |
| 66 static NetworkChangeCalculatorParams NetworkChangeCalculatorParamsAndroid(); | 67 static NetworkChangeCalculatorParams NetworkChangeCalculatorParamsAndroid(); |
| 67 | 68 |
| 68 NetworkChangeNotifierDelegateAndroid* const delegate_; | 69 NetworkChangeNotifierDelegateAndroid* const delegate_; |
| 69 mutable base::Lock connection_type_lock_; // Protects the state below. | 70 mutable base::Lock connection_type_lock_; // Protects the state below. |
| 70 ConnectionType connection_type_; | 71 ConnectionType connection_type_; |
| 71 | 72 |
| 72 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierAndroid); | 73 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierAndroid); |
| 73 }; | 74 }; |
| 74 | 75 |
| 75 } // namespace net | 76 } // namespace net |
| 76 | 77 |
| 77 #endif // NET_ANDROID_NETWORK_CHANGE_NOTIFIER_ANDROID_H_ | 78 #endif // NET_ANDROID_NETWORK_CHANGE_NOTIFIER_ANDROID_H_ |
| OLD | NEW |