| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_PROTECTED_MEDIA_IDENTIFIER_PERMISSION_CONTEXT_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_PROTECTED_MEDIA_IDENTIFIER_PERMISSION_CONTEXT_H_ |
| 6 #define CHROME_BROWSER_MEDIA_PROTECTED_MEDIA_IDENTIFIER_PERMISSION_CONTEXT_H_ | 6 #define CHROME_BROWSER_MEDIA_PROTECTED_MEDIA_IDENTIFIER_PERMISSION_CONTEXT_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/content_settings/permission_context_base.h" | 8 #include "chrome/browser/content_settings/permission_context_base.h" |
| 9 | 9 |
| 10 class PermissionRequestID; | 10 class PermissionRequestID; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 public: | 22 public: |
| 23 explicit ProtectedMediaIdentifierPermissionContext(Profile* profile); | 23 explicit ProtectedMediaIdentifierPermissionContext(Profile* profile); |
| 24 | 24 |
| 25 // In addition to the base class flow checks that it is only code from | 25 // In addition to the base class flow checks that it is only code from |
| 26 // valid iframes. It also adds special logic when called through an extension. | 26 // valid iframes. It also adds special logic when called through an extension. |
| 27 void RequestPermission(content::WebContents* web_contents, | 27 void RequestPermission(content::WebContents* web_contents, |
| 28 const PermissionRequestID& id, | 28 const PermissionRequestID& id, |
| 29 const GURL& requesting_frame_origin, | 29 const GURL& requesting_frame_origin, |
| 30 bool user_gesture, | 30 bool user_gesture, |
| 31 const BrowserPermissionCallback& callback) override; | 31 const BrowserPermissionCallback& callback) override; |
| 32 ContentSetting GetPermissionStatus( |
| 33 const GURL& requesting_origin, |
| 34 const GURL& embedding_origin) const override; |
| 32 | 35 |
| 33 private: | 36 private: |
| 34 ~ProtectedMediaIdentifierPermissionContext() override; | 37 ~ProtectedMediaIdentifierPermissionContext() override; |
| 35 | 38 |
| 36 void UpdateTabContext(const PermissionRequestID& id, | 39 void UpdateTabContext(const PermissionRequestID& id, |
| 37 const GURL& requesting_frame, | 40 const GURL& requesting_frame, |
| 38 bool allowed) override; | 41 bool allowed) override; |
| 39 | 42 |
| 43 // Returns whether "Protected content" is enabled. It can be disabled by a |
| 44 // user in the master switch in content settings, or by the device policy. |
| 45 bool IsProtectedMediaIdentifierEnabled() const; |
| 46 |
| 40 DISALLOW_COPY_AND_ASSIGN(ProtectedMediaIdentifierPermissionContext); | 47 DISALLOW_COPY_AND_ASSIGN(ProtectedMediaIdentifierPermissionContext); |
| 41 }; | 48 }; |
| 42 | 49 |
| 43 #endif // CHROME_BROWSER_MEDIA_PROTECTED_MEDIA_IDENTIFIER_PERMISSION_CONTEXT_H_ | 50 #endif // CHROME_BROWSER_MEDIA_PROTECTED_MEDIA_IDENTIFIER_PERMISSION_CONTEXT_H_ |
| OLD | NEW |