OLD | NEW |
---|---|
(Empty) | |
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. | |
4 | |
5 #ifndef CONTENT_BROWSER_MIDI_MIDI_PERMISSION_CONTEXT_H_ | |
6 #define CONTENT_BROWSER_MIDI_MIDI_PERMISSION_CONTEXT_H_ | |
7 | |
8 #include "base/callback.h" | |
9 #include "base/memory/ref_counted.h" | |
10 #include "content/common/content_export.h" | |
11 | |
12 class GURL; | |
13 | |
14 namespace content { | |
15 | |
16 typedef base::Callback<void(bool)> MIDISysExPermissionCallback; | |
17 | |
18 // MidiPermissionContext must be implemented by the embedder, to provide | |
19 // the policy and logic for the Midi permissions flow. | |
20 // This includes both prompting the user and persisting results, as required. | |
21 class CONTENT_EXPORT MidiPermissionContext | |
22 : public base::RefCountedThreadSafe<MidiPermissionContext> { | |
jam
2013/10/24 16:15:26
does this have to be ref counted? please avoid ref
Kibeom Kim (inactive)
2013/10/24 19:36:26
Done.
| |
23 public: | |
24 // The renderer is requesting permission to use Midi. | |
25 // When the answer to a permission request has been determined, |callback| | |
26 // should be called with the result. | |
27 virtual void RequestMIDISysExPermission( | |
28 int render_process_id, | |
29 int render_view_id, | |
30 int bridge_id, | |
31 const GURL& requesting_frame, | |
32 const MIDISysExPermissionCallback& callback) = 0; | |
33 | |
34 // The renderer is cancelling a pending permission request. | |
35 virtual void CancelMIDISysExPermissionRequest( | |
36 int render_process_id, | |
37 int render_view_id, | |
38 int bridge_id, | |
39 const GURL& requesting_frame) = 0; | |
40 | |
41 protected: | |
42 virtual ~MidiPermissionContext() {} | |
Bernhard Bauer
2013/10/24 07:42:04
Nit: one less space
Kibeom Kim (inactive)
2013/10/24 19:36:26
Done.
| |
43 | |
44 private: | |
45 friend class base::RefCountedThreadSafe<MidiPermissionContext>; | |
46 }; | |
47 | |
48 } // namespace content | |
49 | |
50 #endif // CONTENT_BROWSER_MIDI_MIDI_CONTEXT_H_ | |
OLD | NEW |