Chromium Code Reviews| Index: chrome/browser/media/midi_permission_infobar_delegate.h |
| diff --git a/chrome/browser/geolocation/geolocation_infobar_delegate.h b/chrome/browser/media/midi_permission_infobar_delegate.h |
| similarity index 52% |
| copy from chrome/browser/geolocation/geolocation_infobar_delegate.h |
| copy to chrome/browser/media/midi_permission_infobar_delegate.h |
| index 93a6ab7d8370a0edfb26bc884e85334d94d0a555..1ec1d29016ce7402cb619f0ff696294fac9178da 100644 |
| --- a/chrome/browser/geolocation/geolocation_infobar_delegate.h |
| +++ b/chrome/browser/media/midi_permission_infobar_delegate.h |
| @@ -1,9 +1,9 @@ |
| -// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Copyright 2013 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef CHROME_BROWSER_GEOLOCATION_GEOLOCATION_INFOBAR_DELEGATE_H_ |
| -#define CHROME_BROWSER_GEOLOCATION_GEOLOCATION_INFOBAR_DELEGATE_H_ |
| +#ifndef CHROME_BROWSER_MEDIA_MIDI_PERMISSION_INFOBAR_DELEGATE_H_ |
| +#define CHROME_BROWSER_MEDIA_MIDI_PERMISSION_INFOBAR_DELEGATE_H_ |
| #include <string> |
| @@ -14,12 +14,15 @@ |
| class PermissionQueueController; |
| class InfoBarService; |
| -// GeolocationInfoBarDelegates are created by the |
| -// GeolocationInfoBarQueueController to control the display |
| -// and handling of geolocation permission infobars to the user. |
| -class GeolocationInfoBarDelegate : public ConfirmInfoBarDelegate { |
| +// TODO(toyoshim): Much more code can be shared with GeolocationInfoBarDelegate. |
| +// http://crbug.com/266743 |
| + |
| +// MIDIPermissionInfoBarDelegates are created by the |
| +// ChromeMIDIPermissionContext to control the display and handling of MIDI |
| +// permission infobars to the user. |
| +class MIDIPermissionInfoBarDelegate : public ConfirmInfoBarDelegate { |
| public: |
| - // Creates a geolocation infobar delegate and adds it to |infobar_service|. |
| + // Creates a infobar delegate and adds it to |infobar_service|. |
|
Peter Kasting
2013/08/02 06:00:57
Nit: Grammar; say "a MIDI permission infobar deleg
|
| // Returns the delegate if it was successfully added. |
| static InfoBarDelegate* Create(InfoBarService* infobar_service, |
| PermissionQueueController* controller, |
| @@ -28,19 +31,11 @@ class GeolocationInfoBarDelegate : public ConfirmInfoBarDelegate { |
| const std::string& display_languages); |
| protected: |
| - GeolocationInfoBarDelegate(InfoBarService* infobar_service, |
| - PermissionQueueController* controller, |
| - const PermissionRequestID& id, |
| - const GURL& requesting_frame, |
| - int contents_unique_id, |
| - const std::string& display_languages); |
| - virtual ~GeolocationInfoBarDelegate(); |
| - |
| - // ConfirmInfoBarDelegate: |
| - virtual bool Accept() OVERRIDE; |
| - |
| - // Call back to the controller, to inform of the user's decision. |
| - void SetPermission(bool update_content_setting, bool allowed); |
| + MIDIPermissionInfoBarDelegate(InfoBarService* infobar_service, |
| + PermissionQueueController* controller, |
| + const PermissionRequestID& id, |
| + const GURL& requesting_frame, |
| + const std::string& display_languages); |
| private: |
| // ConfirmInfoBarDelegate: |
| @@ -50,17 +45,20 @@ class GeolocationInfoBarDelegate : public ConfirmInfoBarDelegate { |
| const content::LoadCommittedDetails& details) const OVERRIDE; |
| virtual string16 GetMessageText() const OVERRIDE; |
| virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; |
| + virtual bool Accept() OVERRIDE; |
| virtual bool Cancel() OVERRIDE; |
| - virtual string16 GetLinkText() const OVERRIDE; |
| - virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE; |
| + // Callback to the controller to inform of the user's decision. |
| + void SetPermission(bool update_content_setting, bool allowed); |
| + |
| + private: |
| PermissionQueueController* controller_; |
| const PermissionRequestID id_; |
| GURL requesting_frame_; |
| int contents_unique_id_; |
| std::string display_languages_; |
| - DISALLOW_COPY_AND_ASSIGN(GeolocationInfoBarDelegate); |
| + DISALLOW_COPY_AND_ASSIGN(MIDIPermissionInfoBarDelegate); |
| }; |
| -#endif // CHROME_BROWSER_GEOLOCATION_GEOLOCATION_INFOBAR_DELEGATE_H_ |
| +#endif // CHROME_BROWSER_MEDIA_MIDI_PERMISSION_INFOBAR_DELEGATE_H_ |