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 | |
145 content::WebContents* web_contents_; | 141 content::WebContents* web_contents_; |
146 | 142 |
147 // The owner of this class needs to make sure it does not outlive the profile. | 143 // The owner of this class needs to make sure it does not outlive the profile. |
148 Profile* profile_; | 144 Profile* profile_; |
149 | 145 |
150 // Weak pointer to the tab specific content settings of the tab for which the | 146 // Weak pointer to the tab specific content settings of the tab for which the |
151 // MediaStreamDevicesController was created. The tab specific content | 147 // MediaStreamDevicesController was created. The tab specific content |
152 // settings are associated with a the web contents of the tab. The | 148 // settings are associated with a the web contents of the tab. The |
153 // MediaStreamDeviceController must not outlive the web contents for which it | 149 // MediaStreamDeviceController must not outlive the web contents for which it |
154 // was created. | 150 // was created. |
(...skipping 10 matching lines...) Expand all Loading... |
165 // passed to the tab specific content settings when the permissions have been | 161 // passed to the tab specific content settings when the permissions have been |
166 // resolved. Currently only used by MEDIA_DEVICE_AUDIO_CAPTURE and | 162 // resolved. Currently only used by MEDIA_DEVICE_AUDIO_CAPTURE and |
167 // MEDIA_DEVICE_VIDEO_CAPTURE since those are the only types that require | 163 // MEDIA_DEVICE_VIDEO_CAPTURE since those are the only types that require |
168 // updates in the settings. | 164 // updates in the settings. |
169 MediaStreamTypeSettingsMap request_permissions_; | 165 MediaStreamTypeSettingsMap request_permissions_; |
170 | 166 |
171 DISALLOW_COPY_AND_ASSIGN(MediaStreamDevicesController); | 167 DISALLOW_COPY_AND_ASSIGN(MediaStreamDevicesController); |
172 }; | 168 }; |
173 | 169 |
174 #endif // CHROME_BROWSER_MEDIA_MEDIA_STREAM_DEVICES_CONTROLLER_H_ | 170 #endif // CHROME_BROWSER_MEDIA_MEDIA_STREAM_DEVICES_CONTROLLER_H_ |
OLD | NEW |