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_PERMISSIONS_PERMISSION_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_MANAGER_H_ |
6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_MANAGER_H_ | 6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_MANAGER_H_ |
7 | 7 |
8 #include <unordered_map> | 8 #include <unordered_map> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
44 const GURL& requesting_origin, | 44 const GURL& requesting_origin, |
45 bool user_gesture, | 45 bool user_gesture, |
46 const base::Callback<void(ContentSetting)>& callback); | 46 const base::Callback<void(ContentSetting)>& callback); |
47 int RequestPermissions( | 47 int RequestPermissions( |
48 const std::vector<ContentSettingsType>& permissions, | 48 const std::vector<ContentSettingsType>& permissions, |
49 content::RenderFrameHost* render_frame_host, | 49 content::RenderFrameHost* render_frame_host, |
50 const GURL& requesting_origin, | 50 const GURL& requesting_origin, |
51 bool user_gesture, | 51 bool user_gesture, |
52 const base::Callback<void(const std::vector<ContentSetting>&)>& callback); | 52 const base::Callback<void(const std::vector<ContentSetting>&)>& callback); |
53 | 53 |
54 PermissionResult GetPermissionStatus(ContentSettingsType permission, | 54 PermissionResult GetPermissionStatus(ContentSettingsType permission, |
benwells
2017/05/30 06:49:12
Is this public GetPermissionStatus still needed? I
benwells
2017/05/31 01:48:10
^^^ still valid. maybe it should be GetPermissionS
raymes
2017/06/01 02:54:40
Agreed - I want to address this too, but requires
| |
55 const GURL& requesting_origin, | 55 const GURL& requesting_origin, |
56 const GURL& embedding_origin); | 56 const GURL& embedding_origin); |
57 | 57 |
58 // Returns the permission status for a given frame. This should be preferred | 58 // Returns the permission status for a given frame. This should be preferred |
59 // over GetPermissionStatus as additional checks can be performed when we know | 59 // over GetPermissionStatus as additional checks can be performed when we know |
60 // the exact context the request is coming from. | 60 // the exact context the request is coming from. |
61 // TODO(raymes): Currently we still pass the |requesting_origin| as a separate | 61 // TODO(raymes): Currently we still pass the |requesting_origin| as a separate |
62 // parameter because we can't yet guarantee that it matches the last committed | 62 // parameter because we can't yet guarantee that it matches the last committed |
63 // origin of the RenderFrameHost. See crbug.com/698985. | 63 // origin of the RenderFrameHost. See crbug.com/698985. |
64 PermissionResult GetPermissionStatusForFrame( | 64 PermissionResult GetPermissionStatusForFrame( |
(...skipping 14 matching lines...) Expand all Loading... | |
79 content::RenderFrameHost* render_frame_host, | 79 content::RenderFrameHost* render_frame_host, |
80 const GURL& requesting_origin, | 80 const GURL& requesting_origin, |
81 bool user_gesture, | 81 bool user_gesture, |
82 const base::Callback< | 82 const base::Callback< |
83 void(const std::vector<blink::mojom::PermissionStatus>&)>& callback) | 83 void(const std::vector<blink::mojom::PermissionStatus>&)>& callback) |
84 override; | 84 override; |
85 void CancelPermissionRequest(int request_id) override; | 85 void CancelPermissionRequest(int request_id) override; |
86 void ResetPermission(content::PermissionType permission, | 86 void ResetPermission(content::PermissionType permission, |
87 const GURL& requesting_origin, | 87 const GURL& requesting_origin, |
88 const GURL& embedding_origin) override; | 88 const GURL& embedding_origin) override; |
89 blink::mojom::PermissionStatus GetPermissionStatus( | 89 blink::mojom::PermissionStatus GetPermissionStatusForFrame( |
90 content::PermissionType permission, | 90 content::PermissionType permission, |
91 const GURL& requesting_origin, | 91 content::RenderFrameHost* render_frame_host, |
92 const GURL& embedding_origin) override; | 92 const GURL& requesting_origin) override; |
93 blink::mojom::PermissionStatus GetPermissionStatusForWorker( | |
94 content::PermissionType permission, | |
95 const GURL& requesting_origin) override; | |
93 int SubscribePermissionStatusChange( | 96 int SubscribePermissionStatusChange( |
94 content::PermissionType permission, | 97 content::PermissionType permission, |
95 const GURL& requesting_origin, | 98 const GURL& requesting_origin, |
96 const GURL& embedding_origin, | 99 const GURL& embedding_origin, |
97 const base::Callback<void(blink::mojom::PermissionStatus)>& callback) | 100 const base::Callback<void(blink::mojom::PermissionStatus)>& callback) |
98 override; | 101 override; |
99 void UnsubscribePermissionStatusChange(int subscription_id) override; | 102 void UnsubscribePermissionStatusChange(int subscription_id) override; |
100 | 103 |
101 // TODO(raymes): Rather than exposing this, use the denial reason from | 104 // TODO(raymes): Rather than exposing this, use the denial reason from |
102 // GetPermissionStatus in callers to determine whether a permission is | 105 // GetPermissionStatus in callers to determine whether a permission is |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
147 std::unique_ptr<PermissionContextBase>, | 150 std::unique_ptr<PermissionContextBase>, |
148 ContentSettingsTypeHash> | 151 ContentSettingsTypeHash> |
149 permission_contexts_; | 152 permission_contexts_; |
150 | 153 |
151 base::WeakPtrFactory<PermissionManager> weak_ptr_factory_; | 154 base::WeakPtrFactory<PermissionManager> weak_ptr_factory_; |
152 | 155 |
153 DISALLOW_COPY_AND_ASSIGN(PermissionManager); | 156 DISALLOW_COPY_AND_ASSIGN(PermissionManager); |
154 }; | 157 }; |
155 | 158 |
156 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_MANAGER_H_ | 159 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_MANAGER_H_ |
OLD | NEW |