| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_MEDIA_WEBRTC_MEDIA_PERMISSION_H_ | |
| 6 #define CHROME_BROWSER_MEDIA_WEBRTC_MEDIA_PERMISSION_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "components/content_settings/core/common/content_settings.h" | |
| 12 #include "components/content_settings/core/common/content_settings_types.h" | |
| 13 #include "content/public/common/media_stream_request.h" | |
| 14 #include "url/gurl.h" | |
| 15 | |
| 16 class Profile; | |
| 17 | |
| 18 namespace content { | |
| 19 class WebContents; | |
| 20 } | |
| 21 | |
| 22 // Represents a permission for microphone/camera access. | |
| 23 class MediaPermission { | |
| 24 public: | |
| 25 MediaPermission(ContentSettingsType content_type, | |
| 26 const GURL& requesting_origin, | |
| 27 const GURL& embedding_origin, | |
| 28 Profile* profile, | |
| 29 content::WebContents* web_contents); | |
| 30 | |
| 31 // Returns the status of the permission. If the setting is | |
| 32 // CONTENT_SETTING_BLOCK, |denial_reason| will output the reason for it being | |
| 33 // blocked. | |
| 34 ContentSetting GetPermissionStatus( | |
| 35 content::MediaStreamRequestResult* denial_reason) const; | |
| 36 | |
| 37 private: | |
| 38 bool HasAvailableDevices(const std::string& device_id) const; | |
| 39 | |
| 40 const ContentSettingsType content_type_; | |
| 41 const GURL requesting_origin_; | |
| 42 const GURL embedding_origin_; | |
| 43 const std::string device_id_; | |
| 44 Profile* const profile_; | |
| 45 content::WebContents* const web_contents_; | |
| 46 | |
| 47 DISALLOW_COPY_AND_ASSIGN(MediaPermission); | |
| 48 }; | |
| 49 | |
| 50 #endif // CHROME_BROWSER_MEDIA_WEBRTC_MEDIA_PERMISSION_H_ | |
| OLD | NEW |