| 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 21 matching lines...) Expand all Loading... |
| 32 namespace user_prefs { | 32 namespace user_prefs { |
| 33 class PrefRegistrySyncable; | 33 class PrefRegistrySyncable; |
| 34 } | 34 } |
| 35 | 35 |
| 36 // Manages protected media identifier permissions flow, and delegates UI | 36 // Manages protected media identifier permissions flow, and delegates UI |
| 37 // handling via PermissionQueueController. | 37 // handling via PermissionQueueController. |
| 38 class ProtectedMediaIdentifierPermissionContext | 38 class ProtectedMediaIdentifierPermissionContext |
| 39 : public PermissionContextBase { | 39 : public PermissionContextBase { |
| 40 public: | 40 public: |
| 41 explicit ProtectedMediaIdentifierPermissionContext(Profile* profile); | 41 explicit ProtectedMediaIdentifierPermissionContext(Profile* profile); |
| 42 ~ProtectedMediaIdentifierPermissionContext() override; |
| 42 | 43 |
| 43 // PermissionContextBase implementation. | 44 // PermissionContextBase implementation. |
| 44 #if defined(OS_CHROMEOS) | 45 #if defined(OS_CHROMEOS) |
| 45 void DecidePermission(content::WebContents* web_contents, | 46 void DecidePermission(content::WebContents* web_contents, |
| 46 const PermissionRequestID& id, | 47 const PermissionRequestID& id, |
| 47 const GURL& requesting_origin, | 48 const GURL& requesting_origin, |
| 48 const GURL& embedding_origin, | 49 const GURL& embedding_origin, |
| 49 const BrowserPermissionCallback& callback) override; | 50 const BrowserPermissionCallback& callback) override; |
| 50 #endif // defined(OS_CHROMEOS) | 51 #endif // defined(OS_CHROMEOS) |
| 51 ContentSetting GetPermissionStatus( | 52 ContentSetting GetPermissionStatus( |
| 52 const GURL& requesting_origin, | 53 const GURL& requesting_origin, |
| 53 const GURL& embedding_origin) const override; | 54 const GURL& embedding_origin) const override; |
| 54 void CancelPermissionRequest(content::WebContents* web_contents, | 55 void CancelPermissionRequest(content::WebContents* web_contents, |
| 55 const PermissionRequestID& id) override; | 56 const PermissionRequestID& id) override; |
| 56 | 57 |
| 57 private: | 58 private: |
| 58 ~ProtectedMediaIdentifierPermissionContext() override; | |
| 59 | |
| 60 void UpdateTabContext(const PermissionRequestID& id, | 59 void UpdateTabContext(const PermissionRequestID& id, |
| 61 const GURL& requesting_frame, | 60 const GURL& requesting_frame, |
| 62 bool allowed) override; | 61 bool allowed) override; |
| 63 bool IsRestrictedToSecureOrigins() const override; | 62 bool IsRestrictedToSecureOrigins() const override; |
| 64 | 63 |
| 65 // Returns whether "Protected content" is enabled based on factors other | 64 // Returns whether "Protected content" is enabled based on factors other |
| 66 // than the protected media identifier content setting itself. For example, | 65 // than the protected media identifier content setting itself. For example, |
| 67 // 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 |
| 68 // guest mode, or by the device policy. | 67 // guest mode, or by the device policy. |
| 69 bool IsProtectedMediaIdentifierEnabled() const; | 68 bool IsProtectedMediaIdentifierEnabled() const; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 88 | 87 |
| 89 // Must be the last member, to ensure that it will be | 88 // Must be the last member, to ensure that it will be |
| 90 // destroyed first, which will invalidate weak pointers | 89 // destroyed first, which will invalidate weak pointers |
| 91 base::WeakPtrFactory<ProtectedMediaIdentifierPermissionContext> weak_factory_; | 90 base::WeakPtrFactory<ProtectedMediaIdentifierPermissionContext> weak_factory_; |
| 92 #endif | 91 #endif |
| 93 | 92 |
| 94 DISALLOW_COPY_AND_ASSIGN(ProtectedMediaIdentifierPermissionContext); | 93 DISALLOW_COPY_AND_ASSIGN(ProtectedMediaIdentifierPermissionContext); |
| 95 }; | 94 }; |
| 96 | 95 |
| 97 #endif // CHROME_BROWSER_MEDIA_PROTECTED_MEDIA_IDENTIFIER_PERMISSION_CONTEXT_H_ | 96 #endif // CHROME_BROWSER_MEDIA_PROTECTED_MEDIA_IDENTIFIER_PERMISSION_CONTEXT_H_ |
| OLD | NEW |