1 // Copyright 2013 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 CONTENT_BROWSER_RENDERER_HOST_MEDIA_MIDI_DISPATCHER_HOST_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_MIDI_DISPATCHER_HOST_H_
8 #include "content/public/browser/browser_message_filter.h"
16 // MidiDispatcherHost handles permissions for using system exclusive messages.
17 // It works as BrowserMessageFilter to handle IPC messages between
18 // MidiDispatcher running as a RenderViewObserver.
19 class MidiDispatcherHost
: public BrowserMessageFilter
{
21 MidiDispatcherHost(int render_process_id
, BrowserContext
* browser_context
);
23 // BrowserMessageFilter implementation.
24 virtual bool OnMessageReceived(const IPC::Message
& message
,
25 bool* message_was_ok
) OVERRIDE
;
26 virtual void OverrideThreadForMessage(
27 const IPC::Message
& message
, BrowserThread::ID
* thread
) OVERRIDE
;
30 virtual ~MidiDispatcherHost();
33 void OnRequestSysExPermission(int render_view_id
,
37 void OnCancelSysExPermissionRequest(int render_view_id
,
39 const GURL
& requesting_frame
);
40 void WasSysExPermissionGranted(int render_view_id
,
44 int render_process_id_
;
45 BrowserContext
* browser_context_
;
47 DISALLOW_COPY_AND_ASSIGN(MidiDispatcherHost
);
50 } // namespace content
52 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MIDI_DISPATCHER_HOST_H_