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

Unified Diff: chrome/browser/extensions/permissions_updater.h

Issue 2794803003: PS - Remove Clipboard Read permission from extensions in Public Sessions (except for whitelisted on… (Closed)
Patch Set: Updated comment Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/permissions_updater.h
diff --git a/chrome/browser/extensions/permissions_updater.h b/chrome/browser/extensions/permissions_updater.h
index e31d52a45b0d00a6e0b902b2727139cf01e13605..249c7048e6b1a4aeba0787efdaa5f4cadcf87bc2 100644
--- a/chrome/browser/extensions/permissions_updater.h
+++ b/chrome/browser/extensions/permissions_updater.h
@@ -24,6 +24,17 @@ class PermissionSet;
// and notifies interested parties of the changes.
class PermissionsUpdater {
public:
+ // Platform specific delegate.
+ class Delegate {
+ public:
+ virtual ~Delegate() {}
+ // Platform specific initialization of |extension|'s permissions (does any
+ // necessary filtering of permissions or similar).
+ virtual void InitializePermissions(
+ const Extension* extension,
+ std::unique_ptr<const PermissionSet>* granted_permissions) = 0;
+ };
+
enum InitFlag {
INIT_FLAG_NONE = 0,
INIT_FLAG_TRANSIENT = 1 << 0,
@@ -39,6 +50,12 @@ class PermissionsUpdater {
InitFlag init_flag);
~PermissionsUpdater();
+ // Sets a delegate to provide platform-specific logic. This should be set
+ // during startup (to ensure all extensions are initialized through the
+ // delegate).
+ // |delegate| is a singleton instance and is leaked.
+ static void SetPlatformDelegate(Delegate* delegate);
+
// Adds the set of |permissions| to the |extension|'s active permission set
// and sends the relevant messages and notifications. This method assumes the
// user has already been prompted, if necessary, for the extra permissions.
« no previous file with comments | « chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc ('k') | chrome/browser/extensions/permissions_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698