| 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..b0410fb80bd93f61520e80a01de89a78f24fd8fc 100644
|
| --- a/chrome/browser/ui/media_stream_infobar_delegate.h
|
| +++ b/chrome/browser/ui/media_stream_infobar_delegate.h
|
| @@ -7,13 +7,10 @@
|
|
|
| #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"
|
| +#include "chrome/browser/media/media_stream_devices_controller.h"
|
|
|
| -class MessageLoop;
|
| class TabContents;
|
|
|
| // This class configures an infobar shown when a page requests access to a
|
| @@ -25,14 +22,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 +39,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 +58,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);
|
| };
|
|
|