OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "media/midi/usb_midi_device_factory_android.h" | 5 #include "media/midi/usb_midi_device_factory_android.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/android/context_utils.h" | 9 #include "base/android/context_utils.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 73 |
74 callback_.Run(true, &devices_to_pass); | 74 callback_.Run(true, &devices_to_pass); |
75 } | 75 } |
76 | 76 |
77 // Called from the Java world. | 77 // Called from the Java world. |
78 void UsbMidiDeviceFactoryAndroid::OnUsbMidiDeviceAttached( | 78 void UsbMidiDeviceFactoryAndroid::OnUsbMidiDeviceAttached( |
79 JNIEnv* env, | 79 JNIEnv* env, |
80 const JavaParamRef<jobject>& caller, | 80 const JavaParamRef<jobject>& caller, |
81 const JavaParamRef<jobject>& device) { | 81 const JavaParamRef<jobject>& device) { |
82 delegate_->OnDeviceAttached( | 82 delegate_->OnDeviceAttached( |
83 base::WrapUnique(new UsbMidiDeviceAndroid(device, delegate_))); | 83 base::MakeUnique<UsbMidiDeviceAndroid>(device, delegate_)); |
84 } | 84 } |
85 | 85 |
86 // Called from the Java world. | 86 // Called from the Java world. |
87 void UsbMidiDeviceFactoryAndroid::OnUsbMidiDeviceDetached( | 87 void UsbMidiDeviceFactoryAndroid::OnUsbMidiDeviceDetached( |
88 JNIEnv* env, | 88 JNIEnv* env, |
89 const JavaParamRef<jobject>& caller, | 89 const JavaParamRef<jobject>& caller, |
90 jint index) { | 90 jint index) { |
91 delegate_->OnDeviceDetached(index); | 91 delegate_->OnDeviceDetached(index); |
92 } | 92 } |
93 | 93 |
94 bool UsbMidiDeviceFactoryAndroid::RegisterUsbMidiDeviceFactory(JNIEnv* env) { | 94 bool UsbMidiDeviceFactoryAndroid::RegisterUsbMidiDeviceFactory(JNIEnv* env) { |
95 return RegisterNativesImpl(env); | 95 return RegisterNativesImpl(env); |
96 } | 96 } |
97 | 97 |
98 } // namespace midi | 98 } // namespace midi |
99 } // namespace media | 99 } // namespace media |
OLD | NEW |