OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "device/usb/usb_service_android.h" | 5 #include "device/usb/usb_service_android.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/android/context_utils.h" | 10 #include "base/android/context_utils.h" |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/location.h" | 12 #include "base/location.h" |
13 #include "base/thread_task_runner_handle.h" | 13 #include "base/threading/thread_task_runner_handle.h" |
14 #include "device/usb/usb_device_android.h" | 14 #include "device/usb/usb_device_android.h" |
15 #include "jni/ChromeUsbService_jni.h" | 15 #include "jni/ChromeUsbService_jni.h" |
16 | 16 |
17 using base::android::AttachCurrentThread; | 17 using base::android::AttachCurrentThread; |
18 using base::android::ScopedJavaLocalRef; | 18 using base::android::ScopedJavaLocalRef; |
19 | 19 |
20 namespace device { | 20 namespace device { |
21 | 21 |
22 // static | 22 // static |
23 bool UsbServiceAndroid::RegisterJNI(JNIEnv* env) { | 23 bool UsbServiceAndroid::RegisterJNI(JNIEnv* env) { |
(...skipping 22 matching lines...) Expand all Loading... |
46 ScopedJavaLocalRef<jobject> raw_device( | 46 ScopedJavaLocalRef<jobject> raw_device( |
47 env, env->GetObjectArrayElement(devices.obj(), i)); | 47 env, env->GetObjectArrayElement(devices.obj(), i)); |
48 results.push_back(UsbDeviceAndroid::Create(env, raw_device)); | 48 results.push_back(UsbDeviceAndroid::Create(env, raw_device)); |
49 } | 49 } |
50 | 50 |
51 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, | 51 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, |
52 base::Bind(callback, results)); | 52 base::Bind(callback, results)); |
53 } | 53 } |
54 | 54 |
55 } // namespace device | 55 } // namespace device |
OLD | NEW |