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

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

Issue 2714603002: Make PermissionManager use ContentSettingsType internally more (Closed)
Patch Set: tweak a comment Created 3 years, 10 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
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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 friend class GeolocationPermissionContextTests; 89 friend class GeolocationPermissionContextTests;
90 90
91 class PendingRequest; 91 class PendingRequest;
92 using PendingRequestsMap = IDMap<std::unique_ptr<PendingRequest>>; 92 using PendingRequestsMap = IDMap<std::unique_ptr<PendingRequest>>;
93 93
94 struct Subscription; 94 struct Subscription;
95 using SubscriptionsMap = IDMap<std::unique_ptr<Subscription>>; 95 using SubscriptionsMap = IDMap<std::unique_ptr<Subscription>>;
96 96
97 PermissionContextBase* GetPermissionContext(ContentSettingsType type); 97 PermissionContextBase* GetPermissionContext(ContentSettingsType type);
98 98
99 int RequestPermissions(
100 const std::vector<ContentSettingsType>& permissions,
101 content::RenderFrameHost* render_frame_host,
102 const GURL& requesting_origin,
103 bool user_gesture,
104 const base::Callback<
105 void(const std::vector<blink::mojom::PermissionStatus>&)>& callback);
106
99 // Called when a permission was decided for a given PendingRequest. The 107 // Called when a permission was decided for a given PendingRequest. The
100 // PendingRequest is identified by its |request_id| and the permission is 108 // PendingRequest is identified by its |request_id| and the permission is
101 // identified by its |permission_id|. If the PendingRequest contains more than 109 // identified by its |permission_id|. If the PendingRequest contains more than
102 // one permission, it will wait for the remaining permissions to be resolved. 110 // one permission, it will wait for the remaining permissions to be resolved.
103 // When all the permissions have been resolved, the PendingRequest's callback 111 // When all the permissions have been resolved, the PendingRequest's callback
104 // is run. 112 // is run.
105 void OnPermissionsRequestResponseStatus( 113 void OnPermissionsRequestResponseStatus(
106 int request_id, 114 int request_id,
107 int permission_id, 115 int permission_id,
108 blink::mojom::PermissionStatus status); 116 blink::mojom::PermissionStatus status);
(...skipping 12 matching lines...) Expand all
121 std::unique_ptr<PermissionContextBase>, 129 std::unique_ptr<PermissionContextBase>,
122 ContentSettingsTypeHash> 130 ContentSettingsTypeHash>
123 permission_contexts_; 131 permission_contexts_;
124 132
125 base::WeakPtrFactory<PermissionManager> weak_ptr_factory_; 133 base::WeakPtrFactory<PermissionManager> weak_ptr_factory_;
126 134
127 DISALLOW_COPY_AND_ASSIGN(PermissionManager); 135 DISALLOW_COPY_AND_ASSIGN(PermissionManager);
128 }; 136 };
129 137
130 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_MANAGER_H_ 138 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/permissions/permission_manager.cc » ('j') | chrome/browser/permissions/permission_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698