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 586120c2db7f0a8f19df90ff641e0f8acf8cb9d7..d0a0b9401c1a8ef2a20ae7901c0458f0cd32bb8f 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/content_browser_client.h" |
| -#include "content/public/common/media_stream_request.h" |
| +#include "chrome/browser/media/media_stream_devices_controller.h" |
| -class MessageLoop; |
| class TabContents; |
| typedef TabContents TabContentsWrapper; |
| @@ -26,14 +23,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 has_audio() const; |
| + bool has_video() const; |
|
Ivan Korotkov
2012/06/14 17:14:12
If it's easy to rename them to HasVideo/Audio, ple
no longer working on chromium
2012/06/15 16:52:07
Done.
|
| // Returns lists of audio and/or video devices from which the user will have |
| // to choose. |
| @@ -44,20 +40,17 @@ 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, |
|
Ivan Korotkov
2012/06/14 17:14:12
Should be one line per argument.
no longer working on chromium
2012/06/15 16:52:07
Done.
|
| + 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; |
| @@ -65,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); |
| }; |