| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_WEBRTC_MEDIA_PERMISSION_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_WEBRTC_MEDIA_PERMISSION_H_ |
| 6 #define CHROME_BROWSER_MEDIA_WEBRTC_MEDIA_PERMISSION_H_ | 6 #define CHROME_BROWSER_MEDIA_WEBRTC_MEDIA_PERMISSION_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 const GURL& embedding_origin, | 27 const GURL& embedding_origin, |
| 28 Profile* profile, | 28 Profile* profile, |
| 29 content::WebContents* web_contents); | 29 content::WebContents* web_contents); |
| 30 | 30 |
| 31 // Returns the status of the permission. If the setting is | 31 // Returns the status of the permission. If the setting is |
| 32 // CONTENT_SETTING_BLOCK, |denial_reason| will output the reason for it being | 32 // CONTENT_SETTING_BLOCK, |denial_reason| will output the reason for it being |
| 33 // blocked. | 33 // blocked. |
| 34 ContentSetting GetPermissionStatus( | 34 ContentSetting GetPermissionStatus( |
| 35 content::MediaStreamRequestResult* denial_reason) const; | 35 content::MediaStreamRequestResult* denial_reason) const; |
| 36 | 36 |
| 37 // Returns the status of the permission as with GetPermissionStatus but also | |
| 38 // checks that the specified |device_id| is an available device. | |
| 39 ContentSetting GetPermissionStatusWithDeviceRequired( | |
| 40 const std::string& device_id, | |
| 41 content::MediaStreamRequestResult* denial_reason) const; | |
| 42 | |
| 43 private: | 37 private: |
| 44 bool HasAvailableDevices(const std::string& device_id) const; | 38 bool HasAvailableDevices(const std::string& device_id) const; |
| 45 | 39 |
| 46 const ContentSettingsType content_type_; | 40 const ContentSettingsType content_type_; |
| 47 const GURL requesting_origin_; | 41 const GURL requesting_origin_; |
| 48 const GURL embedding_origin_; | 42 const GURL embedding_origin_; |
| 49 const std::string device_id_; | 43 const std::string device_id_; |
| 50 Profile* const profile_; | 44 Profile* const profile_; |
| 51 content::WebContents* const web_contents_; | 45 content::WebContents* const web_contents_; |
| 52 | 46 |
| 53 DISALLOW_COPY_AND_ASSIGN(MediaPermission); | 47 DISALLOW_COPY_AND_ASSIGN(MediaPermission); |
| 54 }; | 48 }; |
| 55 | 49 |
| 56 #endif // CHROME_BROWSER_MEDIA_WEBRTC_MEDIA_PERMISSION_H_ | 50 #endif // CHROME_BROWSER_MEDIA_WEBRTC_MEDIA_PERMISSION_H_ |
| OLD | NEW |