Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: content/browser/media/midi_dispatcher_host.h

Issue 335993002: Convert MIDI permission requests to use WebContents in preparation for switching the code to using … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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_MEDIA_MIDI_DISPATCHER_HOST_H_
6 #define CONTENT_BROWSER_MEDIA_MIDI_DISPATCHER_HOST_H_
7
8 #include <vector>
9
10 #include "base/callback_forward.h"
11 #include "base/memory/weak_ptr.h"
12 #include "content/public/browser/web_contents_observer.h"
13
14 namespace content {
15
16 class BrowserContext;
17
18 // MidiDispatcherHost handles permissions for using system exclusive messages.
19 class MidiDispatcherHost : public WebContentsObserver {
20 public:
21 explicit MidiDispatcherHost(WebContents* web_contents);
22 virtual ~MidiDispatcherHost();
23
24 // WebContentsObserver implementation.
25 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
26
27 private:
28 void OnRequestSysExPermission(int bridge_id,
29 const GURL& origin,
30 bool user_gesture);
31 void OnCancelSysExPermissionRequest(int bridge_id,
32 const GURL& requesting_frame);
33 void WasSysExPermissionGranted(int render_process_id,
34 int render_view_id,
35 int bridge_id,
36 bool is_allowed);
37
38 struct PendingPermission {
39 PendingPermission(int render_process_id,
40 int render_view_id,
41 int bridge_id);
42 ~PendingPermission();
43 int render_process_id;
44 int render_view_id;
45 int bridge_id;
46 base::Closure cancel;
47 };
48 std::vector<PendingPermission> pending_permissions_;
49
50 base::WeakPtrFactory<MidiDispatcherHost> weak_factory_;
51
52 DISALLOW_COPY_AND_ASSIGN(MidiDispatcherHost);
53 };
54
55 } // namespace content
56
57 #endif // CONTENT_BROWSER_MEDIA_MIDI_DISPATCHER_HOST_H_
OLDNEW
« no previous file with comments | « content/browser/download/download_manager_impl_unittest.cc ('k') | content/browser/media/midi_dispatcher_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698