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; | 14 class InfoBarTabHelper; |
15 class InfoBarTabService; | 15 class InfoBarService; |
16 | 16 |
17 // 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 |
18 // 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 |
19 // 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 |
20 // 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 |
21 // to them. | 21 // to them. |
22 class MediaStreamInfoBarDelegate : public InfoBarDelegate { | 22 class MediaStreamInfoBarDelegate : public InfoBarDelegate { |
23 public: | 23 public: |
24 // MediaStreamInfoBarDelegate takes the ownership of the |controller|. | 24 // MediaStreamInfoBarDelegate takes the ownership of the |controller|. |
25 MediaStreamInfoBarDelegate( | 25 MediaStreamInfoBarDelegate( |
(...skipping 21 matching lines...) Expand all Loading... |
47 // |always_allow| is true if the "always allow" option is checked. | 47 // |always_allow| is true if the "always allow" option is checked. |
48 // 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 |
49 // for audio or video devices respectively. | 49 // for audio or video devices respectively. |
50 void Accept(const std::string& audio_id, | 50 void Accept(const std::string& audio_id, |
51 const std::string& video_id, | 51 const std::string& video_id, |
52 bool always_allow); | 52 bool always_allow); |
53 void Deny(); | 53 void Deny(); |
54 | 54 |
55 private: | 55 private: |
56 // InfoBarDelegate: | 56 // InfoBarDelegate: |
57 virtual InfoBar* CreateInfoBar(InfoBarTabService* owner) OVERRIDE; | 57 virtual InfoBar* CreateInfoBar(InfoBarService* owner) OVERRIDE; |
58 virtual void InfoBarDismissed() OVERRIDE; | 58 virtual void InfoBarDismissed() OVERRIDE; |
59 virtual gfx::Image* GetIcon() const OVERRIDE; | 59 virtual gfx::Image* GetIcon() const OVERRIDE; |
60 virtual Type GetInfoBarType() const OVERRIDE; | 60 virtual Type GetInfoBarType() const OVERRIDE; |
61 virtual MediaStreamInfoBarDelegate* AsMediaStreamInfoBarDelegate() OVERRIDE; | 61 virtual MediaStreamInfoBarDelegate* AsMediaStreamInfoBarDelegate() OVERRIDE; |
62 | 62 |
63 | 63 |
64 private: | 64 private: |
65 scoped_ptr<MediaStreamDevicesController> controller_; | 65 scoped_ptr<MediaStreamDevicesController> controller_; |
66 | 66 |
67 DISALLOW_COPY_AND_ASSIGN(MediaStreamInfoBarDelegate); | 67 DISALLOW_COPY_AND_ASSIGN(MediaStreamInfoBarDelegate); |
68 }; | 68 }; |
69 | 69 |
70 #endif // CHROME_BROWSER_UI_MEDIA_STREAM_INFOBAR_DELEGATE_H_ | 70 #endif // CHROME_BROWSER_UI_MEDIA_STREAM_INFOBAR_DELEGATE_H_ |
OLD | NEW |