| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_MEDIA_STREAM_INFOBAR_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_UI_MEDIA_STREAM_INFOBAR_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_UI_MEDIA_STREAM_INFOBAR_DELEGATE_H_ | 6 #define CHROME_BROWSER_UI_MEDIA_STREAM_INFOBAR_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "chrome/browser/api/infobars/infobar_delegate.h" | 11 #include "chrome/browser/api/infobars/infobar_delegate.h" |
| 12 #include "chrome/browser/media/media_stream_devices_controller.h" | 12 #include "chrome/browser/media/media_stream_devices_controller.h" |
| 13 | 13 |
| 14 class InfoBarTabHelper; |
| 15 class InfoBarTabService; |
| 16 |
| 14 // This class configures an infobar shown when a page requests access to a | 17 // This class configures an infobar shown when a page requests access to a |
| 15 // user's microphone and/or video camera. The user is shown a message asking | 18 // user's microphone and/or video camera. The user is shown a message asking |
| 16 // which audio and/or video devices he wishes to use with the current page, and | 19 // which audio and/or video devices he wishes to use with the current page, and |
| 17 // buttons to give access to the selected devices to the page, or to deny access | 20 // buttons to give access to the selected devices to the page, or to deny access |
| 18 // to them. | 21 // to them. |
| 19 class MediaStreamInfoBarDelegate : public InfoBarDelegate { | 22 class MediaStreamInfoBarDelegate : public InfoBarDelegate { |
| 20 public: | 23 public: |
| 21 // MediaStreamInfoBarDelegate takes the ownership of the |controller|. | 24 // MediaStreamInfoBarDelegate takes the ownership of the |controller|. |
| 22 MediaStreamInfoBarDelegate( | 25 MediaStreamInfoBarDelegate( |
| 23 InfoBarTabHelper* tab_helper, | 26 InfoBarTabHelper* tab_helper, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 44 // |always_allow| is true if the "always allow" option is checked. | 47 // |always_allow| is true if the "always allow" option is checked. |
| 45 // The |audio_id| or |video_id| values are ignored if the request did not ask | 48 // The |audio_id| or |video_id| values are ignored if the request did not ask |
| 46 // for audio or video devices respectively. | 49 // for audio or video devices respectively. |
| 47 void Accept(const std::string& audio_id, | 50 void Accept(const std::string& audio_id, |
| 48 const std::string& video_id, | 51 const std::string& video_id, |
| 49 bool always_allow); | 52 bool always_allow); |
| 50 void Deny(); | 53 void Deny(); |
| 51 | 54 |
| 52 private: | 55 private: |
| 53 // InfoBarDelegate: | 56 // InfoBarDelegate: |
| 54 virtual InfoBar* CreateInfoBar(InfoBarTabHelper* owner) OVERRIDE; | 57 virtual InfoBar* CreateInfoBar(InfoBarTabService* owner) OVERRIDE; |
| 55 virtual void InfoBarDismissed() OVERRIDE; | 58 virtual void InfoBarDismissed() OVERRIDE; |
| 56 virtual gfx::Image* GetIcon() const OVERRIDE; | 59 virtual gfx::Image* GetIcon() const OVERRIDE; |
| 57 virtual Type GetInfoBarType() const OVERRIDE; | 60 virtual Type GetInfoBarType() const OVERRIDE; |
| 58 virtual MediaStreamInfoBarDelegate* AsMediaStreamInfoBarDelegate() OVERRIDE; | 61 virtual MediaStreamInfoBarDelegate* AsMediaStreamInfoBarDelegate() OVERRIDE; |
| 59 | 62 |
| 60 | 63 |
| 61 private: | 64 private: |
| 62 scoped_ptr<MediaStreamDevicesController> controller_; | 65 scoped_ptr<MediaStreamDevicesController> controller_; |
| 63 | 66 |
| 64 DISALLOW_COPY_AND_ASSIGN(MediaStreamInfoBarDelegate); | 67 DISALLOW_COPY_AND_ASSIGN(MediaStreamInfoBarDelegate); |
| 65 }; | 68 }; |
| 66 | 69 |
| 67 #endif // CHROME_BROWSER_UI_MEDIA_STREAM_INFOBAR_DELEGATE_H_ | 70 #endif // CHROME_BROWSER_UI_MEDIA_STREAM_INFOBAR_DELEGATE_H_ |
| OLD | NEW |