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

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 comments 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..7547ff3da644b01eafdfed776c3282cd65e0e798 100644
--- a/chrome/browser/extensions/permissions_updater.h
+++ b/chrome/browser/extensions/permissions_updater.h
@@ -24,6 +24,15 @@ class PermissionSet;
// and notifies interested parties of the changes.
class PermissionsUpdater {
public:
+ // Platform specific delegate.
+ class Delegate {
+ public:
+ virtual ~Delegate() {}
+ virtual void InitializePermissions(
Andrew T Wilson (Slow) 2017/04/11 11:32:54 Document what exactly InitialPermissions is suppos
Ivan Šandrk 2017/04/11 13:37:27 Devlin gave me the suggestion to use InitializePer
Devlin 2017/04/11 15:03:38 I recommended InitializePermissions to keep symmet
+ const Extension* extension,
+ std::unique_ptr<const PermissionSet>* granted_permissions) = 0;
+ };
+
enum InitFlag {
INIT_FLAG_NONE = 0,
INIT_FLAG_TRANSIENT = 1 << 0,
@@ -39,6 +48,9 @@ class PermissionsUpdater {
InitFlag init_flag);
~PermissionsUpdater();
+ // Used for platform specific logic as to not litter the code with #ifdefs.
+ static void SetPlatformDelegate(Delegate* delegate);
Andrew T Wilson (Slow) 2017/04/11 11:32:54 I'm surprised to see this as a static function/sta
Ivan Šandrk 2017/04/11 13:37:27 PermissionsUpdater has a short lifetime - just a h
Devlin 2017/04/11 15:03:38 PermissionsUpdater is designed to be a (mostly) si
+
// 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.

Powered by Google App Engine
This is Rietveld 408576698