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

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

Issue 2714603002: Make PermissionManager use ContentSettingsType internally more (Closed)
Patch Set: address comments 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
« 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 19 matching lines...) Expand all
30 public: 30 public:
31 static PermissionManager* Get(Profile* profile); 31 static PermissionManager* Get(Profile* profile);
32 32
33 explicit PermissionManager(Profile* profile); 33 explicit PermissionManager(Profile* profile);
34 ~PermissionManager() override; 34 ~PermissionManager() override;
35 35
36 // Callers from within chrome/ should use the methods which take the 36 // Callers from within chrome/ should use the methods which take the
37 // ContentSettingsType enum. The methods which take PermissionType values 37 // ContentSettingsType enum. The methods which take PermissionType values
38 // are for the content::PermissionManager overrides and shouldn't be used 38 // are for the content::PermissionManager overrides and shouldn't be used
39 // from chrome/. 39 // from chrome/.
40
40 int RequestPermission( 41 int RequestPermission(
41 ContentSettingsType permission, 42 ContentSettingsType permission,
42 content::RenderFrameHost* render_frame_host, 43 content::RenderFrameHost* render_frame_host,
43 const GURL& requesting_origin, 44 const GURL& requesting_origin,
44 bool user_gesture, 45 bool user_gesture,
45 const base::Callback<void(blink::mojom::PermissionStatus)>& callback); 46 const base::Callback<void(blink::mojom::PermissionStatus)>& callback);
47 int RequestPermissions(
48 const std::vector<ContentSettingsType>& permissions,
49 content::RenderFrameHost* render_frame_host,
50 const GURL& requesting_origin,
51 bool user_gesture,
52 const base::Callback<
53 void(const std::vector<blink::mojom::PermissionStatus>&)>& callback);
54
46 blink::mojom::PermissionStatus GetPermissionStatus( 55 blink::mojom::PermissionStatus GetPermissionStatus(
47 ContentSettingsType permission, 56 ContentSettingsType permission,
48 const GURL& requesting_origin, 57 const GURL& requesting_origin,
49 const GURL& embedding_origin); 58 const GURL& embedding_origin);
50 59
51 // content::PermissionManager implementation. 60 // content::PermissionManager implementation.
52 int RequestPermission( 61 int RequestPermission(
53 content::PermissionType permission, 62 content::PermissionType permission,
54 content::RenderFrameHost* render_frame_host, 63 content::RenderFrameHost* render_frame_host,
55 const GURL& requesting_origin, 64 const GURL& requesting_origin,
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 std::unique_ptr<PermissionContextBase>, 130 std::unique_ptr<PermissionContextBase>,
122 ContentSettingsTypeHash> 131 ContentSettingsTypeHash>
123 permission_contexts_; 132 permission_contexts_;
124 133
125 base::WeakPtrFactory<PermissionManager> weak_ptr_factory_; 134 base::WeakPtrFactory<PermissionManager> weak_ptr_factory_;
126 135
127 DISALLOW_COPY_AND_ASSIGN(PermissionManager); 136 DISALLOW_COPY_AND_ASSIGN(PermissionManager);
128 }; 137 };
129 138
130 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_MANAGER_H_ 139 #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