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/network_change_notifier_delegate_android.h" | 5 #include "net/android/network_change_notifier_delegate_android.h" |
6 | 6 |
7 #include "base/android/context_utils.h" | 7 #include "base/android/context_utils.h" |
8 #include "base/android/jni_array.h" | 8 #include "base/android/jni_array.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "jni/NetworkChangeNotifier_jni.h" | 10 #include "jni/NetworkChangeNotifier_jni.h" |
11 #include "net/android/network_change_notifier_android.h" | 11 #include "net/android/network_change_notifier_android.h" |
12 | 12 |
| 13 using base::android::JavaParamRef; |
| 14 using base::android::ScopedJavaLocalRef; |
| 15 |
13 namespace net { | 16 namespace net { |
14 | 17 |
15 namespace { | 18 namespace { |
16 | 19 |
17 // Converts a Java side connection type (integer) to | 20 // Converts a Java side connection type (integer) to |
18 // the native side NetworkChangeNotifier::ConnectionType. | 21 // the native side NetworkChangeNotifier::ConnectionType. |
19 NetworkChangeNotifier::ConnectionType ConvertConnectionType( | 22 NetworkChangeNotifier::ConnectionType ConvertConnectionType( |
20 jint connection_type) { | 23 jint connection_type) { |
21 switch (connection_type) { | 24 switch (connection_type) { |
22 case NetworkChangeNotifier::CONNECTION_UNKNOWN: | 25 case NetworkChangeNotifier::CONNECTION_UNKNOWN: |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 Java_NetworkChangeNotifier_fakeDefaultNetwork(env, network, type); | 368 Java_NetworkChangeNotifier_fakeDefaultNetwork(env, network, type); |
366 } | 369 } |
367 | 370 |
368 void NetworkChangeNotifierDelegateAndroid::FakeMaxBandwidthChanged( | 371 void NetworkChangeNotifierDelegateAndroid::FakeMaxBandwidthChanged( |
369 double max_bandwidth_mbps) { | 372 double max_bandwidth_mbps) { |
370 JNIEnv* env = base::android::AttachCurrentThread(); | 373 JNIEnv* env = base::android::AttachCurrentThread(); |
371 Java_NetworkChangeNotifier_fakeMaxBandwidthChanged(env, max_bandwidth_mbps); | 374 Java_NetworkChangeNotifier_fakeMaxBandwidthChanged(env, max_bandwidth_mbps); |
372 } | 375 } |
373 | 376 |
374 } // namespace net | 377 } // namespace net |
OLD | NEW |