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_MEDIA_MEDIA_STREAM_DEVICES_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_MEDIA_STREAM_DEVICES_CONTROLLER_H_ |
6 #define CHROME_BROWSER_MEDIA_MEDIA_STREAM_DEVICES_CONTROLLER_H_ | 6 #define CHROME_BROWSER_MEDIA_MEDIA_STREAM_DEVICES_CONTROLLER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 131 |
132 // Return true if the type has been requested and permission is currently set | 132 // Return true if the type has been requested and permission is currently set |
133 // to allowed. Note that it does not reflect the final permission decision. | 133 // to allowed. Note that it does not reflect the final permission decision. |
134 // This function is called during the filtering steps to check if the type has | 134 // This function is called during the filtering steps to check if the type has |
135 // been blocked yet or not and the permission may be changed to blocked during | 135 // been blocked yet or not and the permission may be changed to blocked during |
136 // these filterings. See also the initialization in the constructor and | 136 // these filterings. See also the initialization in the constructor and |
137 // comments on that. | 137 // comments on that. |
138 bool IsDeviceAudioCaptureRequestedAndAllowed() const; | 138 bool IsDeviceAudioCaptureRequestedAndAllowed() const; |
139 bool IsDeviceVideoCaptureRequestedAndAllowed() const; | 139 bool IsDeviceVideoCaptureRequestedAndAllowed() const; |
140 | 140 |
| 141 // Returns true if media capture device is allowed to be used. This could |
| 142 // return false when tab goes to background. |
| 143 bool IsCaptureDeviceRequestAllowed() const; |
| 144 |
141 content::WebContents* web_contents_; | 145 content::WebContents* web_contents_; |
142 | 146 |
143 // The owner of this class needs to make sure it does not outlive the profile. | 147 // The owner of this class needs to make sure it does not outlive the profile. |
144 Profile* profile_; | 148 Profile* profile_; |
145 | 149 |
146 // Weak pointer to the tab specific content settings of the tab for which the | 150 // Weak pointer to the tab specific content settings of the tab for which the |
147 // MediaStreamDevicesController was created. The tab specific content | 151 // MediaStreamDevicesController was created. The tab specific content |
148 // settings are associated with a the web contents of the tab. The | 152 // settings are associated with a the web contents of the tab. The |
149 // MediaStreamDeviceController must not outlive the web contents for which it | 153 // MediaStreamDeviceController must not outlive the web contents for which it |
150 // was created. | 154 // was created. |
(...skipping 10 matching lines...) Expand all Loading... |
161 // passed to the tab specific content settings when the permissions have been | 165 // passed to the tab specific content settings when the permissions have been |
162 // resolved. Currently only used by MEDIA_DEVICE_AUDIO_CAPTURE and | 166 // resolved. Currently only used by MEDIA_DEVICE_AUDIO_CAPTURE and |
163 // MEDIA_DEVICE_VIDEO_CAPTURE since those are the only types that require | 167 // MEDIA_DEVICE_VIDEO_CAPTURE since those are the only types that require |
164 // updates in the settings. | 168 // updates in the settings. |
165 MediaStreamTypeSettingsMap request_permissions_; | 169 MediaStreamTypeSettingsMap request_permissions_; |
166 | 170 |
167 DISALLOW_COPY_AND_ASSIGN(MediaStreamDevicesController); | 171 DISALLOW_COPY_AND_ASSIGN(MediaStreamDevicesController); |
168 }; | 172 }; |
169 | 173 |
170 #endif // CHROME_BROWSER_MEDIA_MEDIA_STREAM_DEVICES_CONTROLLER_H_ | 174 #endif // CHROME_BROWSER_MEDIA_MEDIA_STREAM_DEVICES_CONTROLLER_H_ |
OLD | NEW |