Chromium Code Reviews| 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_MEDIA_STREAM_DEVICE_PERMISSION_CONTEXT_H_ | |
| 6 #define CHROME_BROWSER_MEDIA_MEDIA_STREAM_DEVICE_PERMISSION_CONTEXT_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "chrome/browser/permissions/permission_context_base.h" | |
| 10 #include "components/content_settings/core/common/content_settings_types.h" | |
| 11 | |
| 12 // Common class which handles the mic and camera permissions. | |
| 13 // MediaStreamMicPermissionContextFactory and | |
| 14 // MediaStreamCameraPermissionContextFactory will instantiate this with | |
| 15 // corresponding |permission_type|. | |
| 16 class MediaStreamDevicePermissionContext : public PermissionContextBase { | |
| 17 public: | |
| 18 MediaStreamDevicePermissionContext( | |
| 19 Profile* profile, | |
| 20 const ContentSettingsType content_settings_type); | |
| 21 ~MediaStreamDevicePermissionContext() override; | |
| 22 | |
| 23 // PermissionContextBase: | |
| 24 void RequestPermission(content::WebContents* web_contents, | |
| 25 const PermissionRequestID& id, | |
| 26 const GURL& requesting_frame, | |
| 27 bool user_gesture, | |
| 28 const BrowserPermissionCallback& callback) override; | |
| 29 | |
| 30 ContentSetting GetPermissionStatus( | |
| 31 const GURL& requesting_origin, | |
| 32 const GURL& embedding_origin) const override; | |
| 33 | |
| 34 void ResetPermission(const GURL& requesting_origin, | |
|
palmer
2015/09/01 18:31:04
Can you please add a TODO and file a bug, and CC m
guoweis_left_chromium
2015/09/01 19:36:33
crbug.com/527149. However, since I don't have secu
| |
| 35 const GURL& embedding_origin) override; | |
| 36 | |
| 37 void CancelPermissionRequest(content::WebContents* web_contents, | |
| 38 const PermissionRequestID& id) override; | |
| 39 | |
| 40 private: | |
| 41 // PermissionContextBase: | |
| 42 bool IsRestrictedToSecureOrigins() const override; | |
| 43 | |
| 44 ContentSettingsType content_settings_type_; | |
| 45 | |
| 46 DISALLOW_COPY_AND_ASSIGN(MediaStreamDevicePermissionContext); | |
| 47 }; | |
| 48 | |
| 49 #endif // CHROME_BROWSER_MEDIA_MEDIA_STREAM_DEVICE_PERMISSION_CONTEXT_H_ | |
| OLD | NEW |