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 "base/macros.h" | 8 #include "base/macros.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "chrome/browser/permissions/permission_context_base.h" | 10 #include "chrome/browser/permissions/permission_context_base.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 const BrowserPermissionCallback& callback) override; | 46 const BrowserPermissionCallback& callback) override; |
47 #endif // defined(OS_CHROMEOS) | 47 #endif // defined(OS_CHROMEOS) |
48 ContentSetting GetPermissionStatusInternal( | 48 ContentSetting GetPermissionStatusInternal( |
49 content::RenderFrameHost* render_frame_host, | 49 content::RenderFrameHost* render_frame_host, |
50 const GURL& requesting_origin, | 50 const GURL& requesting_origin, |
51 const GURL& embedding_origin) const override; | 51 const GURL& embedding_origin) const override; |
52 void CancelPermissionRequest(content::WebContents* web_contents, | 52 void CancelPermissionRequest(content::WebContents* web_contents, |
53 const PermissionRequestID& id) override; | 53 const PermissionRequestID& id) override; |
54 | 54 |
55 private: | 55 private: |
| 56 friend class ProtectedMediaIdentifierPermissionContextTest; |
| 57 static bool IsOriginWhitelisted(const GURL& origin); |
| 58 |
56 void UpdateTabContext(const PermissionRequestID& id, | 59 void UpdateTabContext(const PermissionRequestID& id, |
57 const GURL& requesting_frame, | 60 const GURL& requesting_frame, |
58 bool allowed) override; | 61 bool allowed) override; |
59 bool IsRestrictedToSecureOrigins() const override; | 62 bool IsRestrictedToSecureOrigins() const override; |
60 | 63 |
61 // Returns whether "Protected content" is enabled based on factors other | 64 // Returns whether "Protected content" is enabled based on factors other |
62 // than the protected media identifier content setting itself. For example, | 65 // than the protected media identifier content setting itself. For example, |
63 // it can be disabled by a master switch in content settings, in incognito or | 66 // it can be disabled by a master switch in content settings, in incognito or |
64 // guest mode, or by the device policy. | 67 // guest mode, or by the device policy. |
65 bool IsProtectedMediaIdentifierEnabled() const; | 68 bool IsProtectedMediaIdentifierEnabled() const; |
(...skipping 18 matching lines...) Expand all Loading... |
84 | 87 |
85 // Must be the last member, to ensure that it will be | 88 // Must be the last member, to ensure that it will be |
86 // destroyed first, which will invalidate weak pointers | 89 // destroyed first, which will invalidate weak pointers |
87 base::WeakPtrFactory<ProtectedMediaIdentifierPermissionContext> weak_factory_; | 90 base::WeakPtrFactory<ProtectedMediaIdentifierPermissionContext> weak_factory_; |
88 #endif | 91 #endif |
89 | 92 |
90 DISALLOW_COPY_AND_ASSIGN(ProtectedMediaIdentifierPermissionContext); | 93 DISALLOW_COPY_AND_ASSIGN(ProtectedMediaIdentifierPermissionContext); |
91 }; | 94 }; |
92 | 95 |
93 #endif // CHROME_BROWSER_MEDIA_PROTECTED_MEDIA_IDENTIFIER_PERMISSION_CONTEXT_H_ | 96 #endif // CHROME_BROWSER_MEDIA_PROTECTED_MEDIA_IDENTIFIER_PERMISSION_CONTEXT_H_ |
OLD | NEW |