Chromium Code Reviews| Index: chrome/browser/media/chrome_midi_permission_context.h |
| diff --git a/chrome/browser/media/chrome_midi_permission_context.h b/chrome/browser/media/chrome_midi_permission_context.h |
| index 7f2ff328408cb19840e6aba5bf2bed88ecef84f6..c0a5e79926aa797267256f64343360046fe215bc 100644 |
| --- a/chrome/browser/media/chrome_midi_permission_context.h |
| +++ b/chrome/browser/media/chrome_midi_permission_context.h |
| @@ -8,6 +8,7 @@ |
| #include "base/memory/scoped_ptr.h" |
| #include "components/browser_context_keyed_service/browser_context_keyed_service.h" |
| #include "content/public/browser/browser_context.h" |
| +#include "content/public/browser/midi_permission_context.h" |
| class GURL; |
| class PermissionQueueController; |
| @@ -15,20 +16,29 @@ class PermissionRequestID; |
| class Profile; |
| // This class manages MIDI permissions flow. Used on the UI thread. |
| -class ChromeMIDIPermissionContext : public BrowserContextKeyedService { |
| +class ChromeMIDIPermissionContext : public content::MidiPermissionContext { |
| public: |
| explicit ChromeMIDIPermissionContext(Profile* profile); |
| virtual ~ChromeMIDIPermissionContext(); |
| - // BrowserContextKeyedService methods: |
| - virtual void Shutdown() OVERRIDE; |
| - |
| // Request to ask users permission about MIDI. |
|
jam
2013/10/24 16:15:26
nit: just put content::MidiPermissionContext imple
Kibeom Kim (inactive)
2013/10/24 19:36:26
Done.
|
| void RequestMIDISysExPermission( |
| int render_process_id, |
| int render_view_id, |
| + int bridge_id, |
| const GURL& requesting_frame, |
| - const content::BrowserContext::MIDISysExPermissionCallback& callback); |
| + const content::MIDISysExPermissionCallback& callback) |
| + OVERRIDE; |
|
jam
2013/10/24 16:15:26
nit: override doesn't start a line per convention,
Kibeom Kim (inactive)
2013/10/24 19:36:26
Done.
|
| + |
| + // The renderer is cancelling a pending permission request. |
| + virtual void CancelMIDISysExPermissionRequest( |
|
Bernhard Bauer
2013/10/24 07:42:04
Nit: at the beginning of a block of virtual method
Kibeom Kim (inactive)
2013/10/24 19:36:26
Done.
|
| + int render_process_id, |
| + int render_view_id, |
| + int bridge_id, |
| + const GURL& requesting_frame) OVERRIDE; |
| + |
| + // Called on the UI thread when the profile is about to be destroyed. |
| + void ShutdownOnUIThread(); |
| private: |
| // Decide whether the permission should be granted. |
| @@ -38,14 +48,14 @@ class ChromeMIDIPermissionContext : public BrowserContextKeyedService { |
| const PermissionRequestID& id, |
| const GURL& requesting_frame, |
| const GURL& embedder, |
| - const content::BrowserContext::MIDISysExPermissionCallback& callback); |
| + const content::MIDISysExPermissionCallback& callback); |
| // Called when permission is granted without interactively asking the user. |
| void PermissionDecided( |
| const PermissionRequestID& id, |
| const GURL& requesting_frame, |
| const GURL& embedder, |
| - const content::BrowserContext::MIDISysExPermissionCallback& callback, |
| + const content::MIDISysExPermissionCallback& callback, |
| bool allowed); |
| // Called when the permission decision is made. It may be by the |
| @@ -53,12 +63,15 @@ class ChromeMIDIPermissionContext : public BrowserContextKeyedService { |
| void NotifyPermissionSet( |
| const PermissionRequestID& id, |
| const GURL& requesting_frame, |
| - const content::BrowserContext::MIDISysExPermissionCallback& callback, |
| + const content::MIDISysExPermissionCallback& callback, |
| bool allowed); |
| // Return an instance of the infobar queue controller, creating it if needed. |
| PermissionQueueController* GetQueueController(); |
| + // Removes any pending InfoBar request. |
| + void CancelPendingInfoBarRequest(const PermissionRequestID& id); |
| + |
| Profile* const profile_; |
| bool shutting_down_; |
| scoped_ptr<PermissionQueueController> permission_queue_controller_; |