Revert 268405 "Make sure that ScratchBuffer::Allocate() always r..."
[chromium-blink-merge.git] / content / browser / renderer_host / media / midi_dispatcher_host.h
blobd8b35334fd9eafe0e0cdeeda5001cecf8876873f
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"
10 class GURL;
12 namespace content {
14 class BrowserContext;
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 {
20 public:
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;
29 protected:
30 virtual ~MidiDispatcherHost();
32 private:
33 void OnRequestSysExPermission(int render_view_id,
34 int bridge_id,
35 const GURL& origin,
36 bool user_gesture);
37 void OnCancelSysExPermissionRequest(int render_view_id,
38 int bridge_id,
39 const GURL& requesting_frame);
40 void WasSysExPermissionGranted(int render_view_id,
41 int bridge_id,
42 bool success);
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_