Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(939)

Side by Side Diff: chrome/browser/permissions/permission_manager.h

Issue 2745453002: Add requesting origin param to PermissionManager::GetPermissionStatusForFrame (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/permissions/permission_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
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,
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
62 // parameter because we can't yet guarantee that it matches the last committed
63 // origin of the RenderFrameHost. See crbug.com/698985.
61 PermissionResult GetPermissionStatusForFrame( 64 PermissionResult GetPermissionStatusForFrame(
62 ContentSettingsType permission, 65 ContentSettingsType permission,
63 content::RenderFrameHost* render_frame_host); 66 content::RenderFrameHost* render_frame_host,
67 const GURL& requesting_origin);
64 68
65 // content::PermissionManager implementation. 69 // content::PermissionManager implementation.
66 int RequestPermission( 70 int RequestPermission(
67 content::PermissionType permission, 71 content::PermissionType permission,
68 content::RenderFrameHost* render_frame_host, 72 content::RenderFrameHost* render_frame_host,
69 const GURL& requesting_origin, 73 const GURL& requesting_origin,
70 bool user_gesture, 74 bool user_gesture,
71 const base::Callback<void(blink::mojom::PermissionStatus)>& callback) 75 const base::Callback<void(blink::mojom::PermissionStatus)>& callback)
72 override; 76 override;
73 int RequestPermissions( 77 int RequestPermissions(
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 std::unique_ptr<PermissionContextBase>, 144 std::unique_ptr<PermissionContextBase>,
141 ContentSettingsTypeHash> 145 ContentSettingsTypeHash>
142 permission_contexts_; 146 permission_contexts_;
143 147
144 base::WeakPtrFactory<PermissionManager> weak_ptr_factory_; 148 base::WeakPtrFactory<PermissionManager> weak_ptr_factory_;
145 149
146 DISALLOW_COPY_AND_ASSIGN(PermissionManager); 150 DISALLOW_COPY_AND_ASSIGN(PermissionManager);
147 }; 151 };
148 152
149 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_MANAGER_H_ 153 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/permissions/permission_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698