OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CONTENT_RENDERER_MEDIA_MIDI_DISPATCHER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_MIDI_DISPATCHER_H_ |
6 #define CONTENT_RENDERER_MEDIA_MIDI_DISPATCHER_H_ | 6 #define CONTENT_RENDERER_MEDIA_MIDI_DISPATCHER_H_ |
7 | 7 |
8 #include "base/id_map.h" | 8 #include "base/id_map.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "content/common/permission_service.mojom.h" | 10 #include "content/common/permission_service.mojom.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 // It works as RenderFrameObserver to keep a 1:1 relationship with a RenderFrame | 22 // It works as RenderFrameObserver to keep a 1:1 relationship with a RenderFrame |
23 // and make sure it has the same life cycle. | 23 // and make sure it has the same life cycle. |
24 class MidiDispatcher : public RenderFrameObserver, | 24 class MidiDispatcher : public RenderFrameObserver, |
25 public blink::WebMIDIClient { | 25 public blink::WebMIDIClient { |
26 public: | 26 public: |
27 explicit MidiDispatcher(RenderFrame* render_frame); | 27 explicit MidiDispatcher(RenderFrame* render_frame); |
28 ~MidiDispatcher() override; | 28 ~MidiDispatcher() override; |
29 | 29 |
30 private: | 30 private: |
31 // blink::WebMIDIClient implementation. | 31 // blink::WebMIDIClient implementation. |
32 void requestSysexPermission( | 32 void requestPermission(const blink::WebMIDIPermissionRequest& request, |
33 const blink::WebMIDIPermissionRequest& request) override; | 33 const blink::WebMIDIOptions& options) override; |
34 void cancelSysexPermissionRequest( | 34 void cancelPermissionRequest( |
35 const blink::WebMIDIPermissionRequest& request) override; | 35 const blink::WebMIDIPermissionRequest& request) override; |
36 | 36 |
37 // Permission for using system exclusive messages has been set. | 37 // Permission for using MIDI system has been set. |
38 void OnSysExPermissionSet(int request_id, PermissionStatus status); | 38 void OnPermissionSet(int request_id, PermissionStatus status); |
39 | 39 |
40 // Each WebMIDIPermissionRequest object is valid until | 40 // Each WebMIDIPermissionRequest object is valid until |
41 // cancelSysexPermissionRequest() is called with the object, or used to call | 41 // cancelSysexPermissionRequest() is called with the object, or used to call |
42 // WebMIDIPermissionRequest::setIsAllowed(). | 42 // WebMIDIPermissionRequest::setIsAllowed(). |
43 typedef IDMap<blink::WebMIDIPermissionRequest, IDMapOwnPointer> Requests; | 43 typedef IDMap<blink::WebMIDIPermissionRequest, IDMapOwnPointer> Requests; |
44 Requests requests_; | 44 Requests requests_; |
45 | 45 |
46 PermissionServicePtr permission_service_; | 46 PermissionServicePtr permission_service_; |
47 | 47 |
48 DISALLOW_COPY_AND_ASSIGN(MidiDispatcher); | 48 DISALLOW_COPY_AND_ASSIGN(MidiDispatcher); |
49 }; | 49 }; |
50 | 50 |
51 } // namespace content | 51 } // namespace content |
52 | 52 |
53 #endif // CONTENT_RENDERER_MEDIA_MIDI_DISPATCHER_H_ | 53 #endif // CONTENT_RENDERER_MEDIA_MIDI_DISPATCHER_H_ |
OLD | NEW |