#ifndef CONTENT_RENDERER_MEDIA_MIDI_DISPATCHER_H_
#define CONTENT_RENDERER_MEDIA_MIDI_DISPATCHER_H_
#include "base/id_map.h"
#include "content/public/renderer/render_view_observer.h"
#include "third_party/WebKit/public/web/WebMIDIClient.h"
namespace blink {
class WebMIDIPermissionRequest;
}
namespace content {
class RenderViewImpl;
class MidiDispatcher : public RenderViewObserver,
public blink::WebMIDIClient {
public:
explicit MidiDispatcher(RenderViewImpl* render_view);
virtual ~MidiDispatcher();
private:
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
virtual void requestSysexPermission(
const blink::WebMIDIPermissionRequest& request);
virtual void cancelSysexPermissionRequest(
const blink::WebMIDIPermissionRequest& request);
void OnSysExPermissionApproved(int client_id, bool is_allowed);
IDMap<blink::WebMIDIPermissionRequest> requests_;
DISALLOW_COPY_AND_ASSIGN(MidiDispatcher);
};
}
#endif