| 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_STREAM_DEVICE_PERMISSION_CONTEXT_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_WEBRTC_MEDIA_STREAM_DEVICE_PERMISSION_CONTEXT_H_ |
| 6 #define CHROME_BROWSER_MEDIA_WEBRTC_MEDIA_STREAM_DEVICE_PERMISSION_CONTEXT_H_ | 6 #define CHROME_BROWSER_MEDIA_WEBRTC_MEDIA_STREAM_DEVICE_PERMISSION_CONTEXT_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "chrome/browser/permissions/permission_context_base.h" | 9 #include "chrome/browser/permissions/permission_context_base.h" |
| 10 #include "components/content_settings/core/common/content_settings_types.h" | 10 #include "components/content_settings/core/common/content_settings_types.h" |
| 11 #include "content/public/browser/permission_type.h" | |
| 12 | 11 |
| 13 // Common class which handles the mic and camera permissions. | 12 // Common class which handles the mic and camera permissions. |
| 14 // MediaStreamMicPermissionContextFactory and | |
| 15 // MediaStreamCameraPermissionContextFactory will instantiate this with | |
| 16 // corresponding |permission_type|. | |
| 17 class MediaStreamDevicePermissionContext : public PermissionContextBase { | 13 class MediaStreamDevicePermissionContext : public PermissionContextBase { |
| 18 public: | 14 public: |
| 19 MediaStreamDevicePermissionContext( | 15 MediaStreamDevicePermissionContext(Profile* profile, |
| 20 Profile* profile, | 16 ContentSettingsType content_settings_type); |
| 21 const content::PermissionType permission_type, | |
| 22 const ContentSettingsType content_settings_type); | |
| 23 ~MediaStreamDevicePermissionContext() override; | 17 ~MediaStreamDevicePermissionContext() override; |
| 24 | 18 |
| 25 // PermissionContextBase: | 19 // PermissionContextBase: |
| 26 void RequestPermission(content::WebContents* web_contents, | 20 void RequestPermission(content::WebContents* web_contents, |
| 27 const PermissionRequestID& id, | 21 const PermissionRequestID& id, |
| 28 const GURL& requesting_frame, | 22 const GURL& requesting_frame, |
| 29 bool user_gesture, | 23 bool user_gesture, |
| 30 const BrowserPermissionCallback& callback) override; | 24 const BrowserPermissionCallback& callback) override; |
| 31 | 25 |
| 32 // TODO(xhwang): GURL.GetOrigin() shouldn't be used as the origin. Need to | 26 // TODO(xhwang): GURL.GetOrigin() shouldn't be used as the origin. Need to |
| (...skipping 11 matching lines...) Expand all Loading... |
| 44 private: | 38 private: |
| 45 // PermissionContextBase: | 39 // PermissionContextBase: |
| 46 bool IsRestrictedToSecureOrigins() const override; | 40 bool IsRestrictedToSecureOrigins() const override; |
| 47 | 41 |
| 48 ContentSettingsType content_settings_type_; | 42 ContentSettingsType content_settings_type_; |
| 49 | 43 |
| 50 DISALLOW_COPY_AND_ASSIGN(MediaStreamDevicePermissionContext); | 44 DISALLOW_COPY_AND_ASSIGN(MediaStreamDevicePermissionContext); |
| 51 }; | 45 }; |
| 52 | 46 |
| 53 #endif // CHROME_BROWSER_MEDIA_WEBRTC_MEDIA_STREAM_DEVICE_PERMISSION_CONTEXT_H_ | 47 #endif // CHROME_BROWSER_MEDIA_WEBRTC_MEDIA_STREAM_DEVICE_PERMISSION_CONTEXT_H_ |
| OLD | NEW |