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 #include "net/android/net_jni_registrar.h" | 5 #include "net/android/net_jni_registrar.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
9 #include "base/android/jni_registrar.h" | 9 #include "base/android/jni_registrar.h" |
10 #include "net/android/network_change_notifier_android.h" | 10 #include "net/android/network_change_notifier_android.h" |
11 #include "net/android/network_library.h" | 11 #include "net/android/network_library.h" |
12 #include "net/proxy/proxy_config_service_android.h" | 12 #include "net/proxy/proxy_config_service_android.h" |
13 | 13 |
14 namespace net { | 14 namespace net { |
15 namespace android { | 15 namespace android { |
16 | 16 |
17 static base::android::RegistrationMethod kNetRegisteredMethods[] = { | 17 static base::android::RegistrationMethod kNetRegisteredMethods[] = { |
18 { "AndroidNetworkLibrary", net::android::RegisterNetworkLibrary }, | 18 { "AndroidNetworkLibrary", net::android::RegisterNetworkLibrary }, |
19 { "NetworkChangeNotifier", net::android::NetworkChangeNotifier::Register }, | 19 { "NetworkChangeNotifier", net::android::NetworkChangeNotifier::Register }, |
20 { "ProxyConfigService", net::ProxyConfigServiceAndroid::Register }, | 20 { "ProxyConfigService", net::ProxyConfigServiceAndroid::Register }, |
21 }; | 21 }; |
22 | 22 |
23 bool RegisterJni(JNIEnv* env) { | 23 bool RegisterJni(JNIEnv* env) { |
24 return base::android::RegisterNativeMethods( | 24 return base::android::RegisterNativeMethods( |
25 env, kNetRegisteredMethods, arraysize(kNetRegisteredMethods)); | 25 env, kNetRegisteredMethods, arraysize(kNetRegisteredMethods)); |
26 } | 26 } |
27 | 27 |
| 28 // Add the methods to be registered for APK unit tests. |
| 29 ADD_JNI_REGISTRATION_METHODS_FOR_TESTS(kNetRegisteredMethods) |
| 30 |
28 } // namespace android | 31 } // namespace android |
29 } // namespace net | 32 } // namespace net |
OLD | NEW |