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/permissions/permission_context_base.h" | 8 #include "chrome/browser/permissions/permission_context_base.h" |
9 #include "chrome/browser/permissions/permission_request_id.h" | 9 #include "chrome/browser/permissions/permission_request_id.h" |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 class PrefRegistrySyncable; | 31 class PrefRegistrySyncable; |
32 } | 32 } |
33 | 33 |
34 // Manages protected media identifier permissions flow, and delegates UI | 34 // Manages protected media identifier permissions flow, and delegates UI |
35 // handling via PermissionQueueController. | 35 // handling via PermissionQueueController. |
36 class ProtectedMediaIdentifierPermissionContext | 36 class ProtectedMediaIdentifierPermissionContext |
37 : public PermissionContextBase { | 37 : public PermissionContextBase { |
38 public: | 38 public: |
39 explicit ProtectedMediaIdentifierPermissionContext(Profile* profile); | 39 explicit ProtectedMediaIdentifierPermissionContext(Profile* profile); |
40 | 40 |
41 // In addition to the base class flow checks that it is only code from | 41 // PermissionContextBase implementation. |
42 // valid iframes. It also adds special logic when called through an extension. | 42 #if defined(OS_CHROMEOS) |
43 void RequestPermission(content::WebContents* web_contents, | 43 void RequestPermission(content::WebContents* web_contents, |
44 const PermissionRequestID& id, | 44 const PermissionRequestID& id, |
45 const GURL& requesting_origin, | 45 const GURL& requesting_origin, |
46 bool user_gesture, | 46 bool user_gesture, |
47 const BrowserPermissionCallback& callback) override; | 47 const BrowserPermissionCallback& callback) override; |
| 48 #endif // defined(OS_CHROMEOS) |
48 ContentSetting GetPermissionStatus( | 49 ContentSetting GetPermissionStatus( |
49 const GURL& requesting_origin, | 50 const GURL& requesting_origin, |
50 const GURL& embedding_origin) const override; | 51 const GURL& embedding_origin) const override; |
51 void CancelPermissionRequest(content::WebContents* web_contents, | 52 void CancelPermissionRequest(content::WebContents* web_contents, |
52 const PermissionRequestID& id) override; | 53 const PermissionRequestID& id) override; |
53 | 54 |
54 private: | 55 private: |
55 ~ProtectedMediaIdentifierPermissionContext() override; | 56 ~ProtectedMediaIdentifierPermissionContext() override; |
56 | 57 |
57 void UpdateTabContext(const PermissionRequestID& id, | 58 void UpdateTabContext(const PermissionRequestID& id, |
(...skipping 27 matching lines...) Expand all Loading... |
85 | 86 |
86 // Must be the last member, to ensure that it will be | 87 // Must be the last member, to ensure that it will be |
87 // destroyed first, which will invalidate weak pointers | 88 // destroyed first, which will invalidate weak pointers |
88 base::WeakPtrFactory<ProtectedMediaIdentifierPermissionContext> weak_factory_; | 89 base::WeakPtrFactory<ProtectedMediaIdentifierPermissionContext> weak_factory_; |
89 #endif | 90 #endif |
90 | 91 |
91 DISALLOW_COPY_AND_ASSIGN(ProtectedMediaIdentifierPermissionContext); | 92 DISALLOW_COPY_AND_ASSIGN(ProtectedMediaIdentifierPermissionContext); |
92 }; | 93 }; |
93 | 94 |
94 #endif // CHROME_BROWSER_MEDIA_PROTECTED_MEDIA_IDENTIFIER_PERMISSION_CONTEXT_H_ | 95 #endif // CHROME_BROWSER_MEDIA_PROTECTED_MEDIA_IDENTIFIER_PERMISSION_CONTEXT_H_ |
OLD | NEW |