Remove INJECT_EVENTS permissions from test APKs.
[chromium-blink-merge.git] / media / midi / usb_midi_device_factory_android.h
blobd81586a37b3bafbae6714ed44e41e24a5ff25f7d
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
3 // found in the LICENSE file.
5 #ifndef MEDIA_MIDI_USB_MIDI_DEVICE_FACTORY_ANDROID_H_
6 #define MEDIA_MIDI_USB_MIDI_DEVICE_FACTORY_ANDROID_H_
8 #include <jni.h>
9 #include <vector>
11 #include "base/android/scoped_java_ref.h"
12 #include "base/basictypes.h"
13 #include "base/callback.h"
14 #include "base/memory/scoped_vector.h"
15 #include "base/memory/weak_ptr.h"
16 #include "media/midi/usb_midi_device.h"
17 #include "media/midi/usb_midi_export.h"
19 namespace media {
20 namespace midi {
22 // This class enumerates UsbMidiDevices.
23 class USB_MIDI_EXPORT UsbMidiDeviceFactoryAndroid
24 : public UsbMidiDevice::Factory {
25 public:
26 UsbMidiDeviceFactoryAndroid();
27 ~UsbMidiDeviceFactoryAndroid() override;
29 // UsbMidiDevice::Factory implementation.
30 void EnumerateDevices(UsbMidiDeviceDelegate* delegate,
31 Callback callback) override;
33 void OnUsbMidiDeviceRequestDone(JNIEnv* env,
34 jobject caller,
35 jobjectArray devices);
36 void OnUsbMidiDeviceAttached(JNIEnv* env, jobject caller, jobject device);
37 void OnUsbMidiDeviceDetached(JNIEnv* env, jobject caller, jint index);
39 static bool RegisterUsbMidiDeviceFactory(JNIEnv* env);
41 private:
42 base::android::ScopedJavaGlobalRef<jobject> raw_factory_;
43 // Not owned.
44 UsbMidiDeviceDelegate* delegate_;
45 Callback callback_;
47 DISALLOW_COPY_AND_ASSIGN(UsbMidiDeviceFactoryAndroid);
50 } // namespace midi
51 } // namespace media
53 #endif // MEDIA_MIDI_USB_MIDI_DEVICE_FACTORY_ANDROID_H_