Chromium Code Reviews| Index: chrome/browser/ui/media_stream_infobar_delegate.h |
| diff --git a/chrome/browser/ui/media_stream_infobar_delegate.h b/chrome/browser/ui/media_stream_infobar_delegate.h |
| index ca19cddefe85e88e40e4bdccb0a16c17afd2a3fc..0b79c9ce76184451597ede6a9c700bd4cd5388d7 100644 |
| --- a/chrome/browser/ui/media_stream_infobar_delegate.h |
| +++ b/chrome/browser/ui/media_stream_infobar_delegate.h |
| @@ -7,14 +7,9 @@ |
| #include <string> |
| -#include "base/callback.h" |
| #include "base/compiler_specific.h" |
| #include "chrome/browser/infobars/infobar_delegate.h" |
| -#include "content/public/browser/web_contents_delegate.h" |
| -#include "content/public/common/media_stream_request.h" |
| - |
| -class MessageLoop; |
| -class TabContents; |
| +#include "chrome/browser/media/media_stream_devices_controller.h" |
|
no longer working on chromium
2012/06/20 17:24:38
To joaodasilva: We need to include this header fil
|
| // This class configures an infobar shown when a page requests access to a |
| // user's microphone and/or video camera. The user is shown a message asking |
| @@ -25,14 +20,13 @@ class MediaStreamInfoBarDelegate : public InfoBarDelegate { |
| public: |
| MediaStreamInfoBarDelegate( |
| InfoBarTabHelper* tab_helper, |
| - const content::MediaStreamRequest* request, |
| - const content::MediaResponseCallback& callback); |
| + MediaStreamDevicesController* controller); |
| virtual ~MediaStreamInfoBarDelegate(); |
| // These tell whether the user has to select audio and/or video devices. |
| - bool has_audio() const { return has_audio_; } |
| - bool has_video() const { return has_video_; } |
| + bool HasAudio() const; |
| + bool HasVideo() const; |
| // Returns lists of audio and/or video devices from which the user will have |
| // to choose. |
| @@ -43,20 +37,18 @@ class MediaStreamInfoBarDelegate : public InfoBarDelegate { |
| // of this request. |
| const GURL& GetSecurityOrigin() const; |
| + |
| // Callbacks to handle accepting devices or denying the request. |audio_id| |
| // and |video_id| are the device IDs of the accepted audio and video devices. |
| + // |always_allow| is true if the "always allow" option is checked. |
| // The |audio_id| or |video_id| values are ignored if the request did not ask |
| // for audio or video devices respectively. |
| - void Accept(const std::string& audio_id, const std::string& video_id); |
| + void Accept(const std::string& audio_id, |
| + const std::string& video_id, |
| + bool always_allow); |
| void Deny(); |
| private: |
| - // Finds a device in the current request with the specified |id| and |type|, |
| - // and adds it to the |devices| array. |
| - void AddDeviceWithId(content::MediaStreamDeviceType type, |
| - const std::string& id, |
| - content::MediaStreamDevices* devices); |
| - |
| // InfoBarDelegate: |
| virtual InfoBar* CreateInfoBar(InfoBarTabHelper* owner) OVERRIDE; |
| virtual void InfoBarDismissed() OVERRIDE; |
| @@ -64,16 +56,9 @@ class MediaStreamInfoBarDelegate : public InfoBarDelegate { |
| virtual Type GetInfoBarType() const OVERRIDE; |
| virtual MediaStreamInfoBarDelegate* AsMediaStreamInfoBarDelegate() OVERRIDE; |
| - // The original request for access to devices. |
| - const content::MediaStreamRequest* request_; |
| - // The callback that needs to be Run to notify WebRTC of whether access to |
| - // audio/video devices was granted or not. |
| - content::MediaResponseCallback callback_; |
| - |
| - // Whether the request is for audio and/or video devices. |
| - bool has_audio_; |
| - bool has_video_; |
| + private: |
| + scoped_ptr<MediaStreamDevicesController> controller_; |
| DISALLOW_COPY_AND_ASSIGN(MediaStreamInfoBarDelegate); |
| }; |