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_BROWSER_MEDIA_MIDI_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_MEDIA_MIDI_DISPATCHER_HOST_H_ |
6 #define CONTENT_BROWSER_MEDIA_MIDI_DISPATCHER_HOST_H_ | 6 #define CONTENT_BROWSER_MEDIA_MIDI_DISPATCHER_HOST_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "content/public/browser/web_contents_observer.h" | 12 #include "content/public/browser/web_contents_observer.h" |
13 | 13 |
14 namespace content { | 14 namespace content { |
15 | 15 |
16 class BrowserContext; | 16 class BrowserContext; |
17 | 17 |
18 // MidiDispatcherHost handles permissions for using system exclusive messages. | 18 // MidiDispatcherHost handles permissions for using system exclusive messages. |
19 class MidiDispatcherHost : public WebContentsObserver { | 19 class MidiDispatcherHost : public WebContentsObserver { |
20 public: | 20 public: |
21 explicit MidiDispatcherHost(WebContents* web_contents); | 21 explicit MidiDispatcherHost(WebContents* web_contents); |
22 virtual ~MidiDispatcherHost(); | 22 virtual ~MidiDispatcherHost(); |
23 | 23 |
24 // WebContentsObserver implementation. | 24 // WebContentsObserver implementation. |
25 virtual bool OnMessageReceived(const IPC::Message& message, | 25 virtual bool OnMessageReceived(const IPC::Message& message, |
26 RenderFrameHost* render_frame_host) OVERRIDE; | 26 RenderFrameHost* render_frame_host) override; |
27 | 27 |
28 private: | 28 private: |
29 void OnRequestSysExPermission(RenderFrameHost* render_frame_host, | 29 void OnRequestSysExPermission(RenderFrameHost* render_frame_host, |
30 int bridge_id, | 30 int bridge_id, |
31 const GURL& origin, | 31 const GURL& origin, |
32 bool user_gesture); | 32 bool user_gesture); |
33 void OnCancelSysExPermissionRequest(RenderFrameHost* render_frame_host, | 33 void OnCancelSysExPermissionRequest(RenderFrameHost* render_frame_host, |
34 int bridge_id, | 34 int bridge_id, |
35 const GURL& requesting_frame); | 35 const GURL& requesting_frame); |
36 void WasSysExPermissionGranted(int render_process_id, | 36 void WasSysExPermissionGranted(int render_process_id, |
(...skipping 14 matching lines...) Expand all Loading... |
51 std::vector<PendingPermission> pending_permissions_; | 51 std::vector<PendingPermission> pending_permissions_; |
52 | 52 |
53 base::WeakPtrFactory<MidiDispatcherHost> weak_factory_; | 53 base::WeakPtrFactory<MidiDispatcherHost> weak_factory_; |
54 | 54 |
55 DISALLOW_COPY_AND_ASSIGN(MidiDispatcherHost); | 55 DISALLOW_COPY_AND_ASSIGN(MidiDispatcherHost); |
56 }; | 56 }; |
57 | 57 |
58 } // namespace content | 58 } // namespace content |
59 | 59 |
60 #endif // CONTENT_BROWSER_MEDIA_MIDI_DISPATCHER_HOST_H_ | 60 #endif // CONTENT_BROWSER_MEDIA_MIDI_DISPATCHER_HOST_H_ |
OLD | NEW |