| 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_MEDIA_STREAM_DEVICE_PERMISSION_CONTEXT_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_MEDIA_STREAM_DEVICE_PERMISSION_CONTEXT_H_ |
| 6 #define CHROME_BROWSER_MEDIA_MEDIA_STREAM_DEVICE_PERMISSION_CONTEXT_H_ | 6 #define CHROME_BROWSER_MEDIA_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" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 const PermissionRequestID& id, | 27 const PermissionRequestID& id, |
| 28 const GURL& requesting_frame, | 28 const GURL& requesting_frame, |
| 29 const BrowserPermissionCallback& callback) override; | 29 const BrowserPermissionCallback& callback) override; |
| 30 | 30 |
| 31 // TODO(xhwang): GURL.GetOrigin() shouldn't be used as the origin. Need to | 31 // TODO(xhwang): GURL.GetOrigin() shouldn't be used as the origin. Need to |
| 32 // refactor to use url::Origin. crbug.com/527149 is filed for this. | 32 // refactor to use url::Origin. crbug.com/527149 is filed for this. |
| 33 ContentSetting GetPermissionStatus( | 33 ContentSetting GetPermissionStatus( |
| 34 const GURL& requesting_origin, | 34 const GURL& requesting_origin, |
| 35 const GURL& embedding_origin) const override; | 35 const GURL& embedding_origin) const override; |
| 36 | 36 |
| 37 // For Pepper request, insecure origins are allowed to be persisted, hence we | |
| 38 // can't just call GetPermissionStatus when the requesting origin is insecure. | |
| 39 // TODO(raymes): Remove this after crbug.com/526324 is fixed. | |
| 40 ContentSetting GetPermissionStatusAllowingInsecureForPepper( | |
| 41 const GURL& requesting_origin, | |
| 42 const GURL& embedding_origin) const; | |
| 43 | |
| 44 void ResetPermission(const GURL& requesting_origin, | 37 void ResetPermission(const GURL& requesting_origin, |
| 45 const GURL& embedding_origin) override; | 38 const GURL& embedding_origin) override; |
| 46 | 39 |
| 47 void CancelPermissionRequest(content::WebContents* web_contents, | 40 void CancelPermissionRequest(content::WebContents* web_contents, |
| 48 const PermissionRequestID& id) override; | 41 const PermissionRequestID& id) override; |
| 49 | 42 |
| 50 private: | 43 private: |
| 51 ContentSetting GetPermissionStatusInternal(const GURL& requesting_origin, | |
| 52 const GURL& embedding_origin, | |
| 53 bool is_pepper_request) const; | |
| 54 | |
| 55 // PermissionContextBase: | 44 // PermissionContextBase: |
| 56 bool IsRestrictedToSecureOrigins() const override; | 45 bool IsRestrictedToSecureOrigins() const override; |
| 57 | 46 |
| 58 ContentSettingsType content_settings_type_; | 47 ContentSettingsType content_settings_type_; |
| 59 | 48 |
| 60 DISALLOW_COPY_AND_ASSIGN(MediaStreamDevicePermissionContext); | 49 DISALLOW_COPY_AND_ASSIGN(MediaStreamDevicePermissionContext); |
| 61 }; | 50 }; |
| 62 | 51 |
| 63 #endif // CHROME_BROWSER_MEDIA_MEDIA_STREAM_DEVICE_PERMISSION_CONTEXT_H_ | 52 #endif // CHROME_BROWSER_MEDIA_MEDIA_STREAM_DEVICE_PERMISSION_CONTEXT_H_ |
| OLD | NEW |