Chromium Code Reviews| 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..d43b4142a6658e63db64de2ce99e43637b00a225 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,13 @@ class PermissionsUpdater { |
| InitFlag init_flag); |
| ~PermissionsUpdater(); |
| + // Used for platform specific logic as to not litter the code with #ifdefs. |
| + // |delegate| is created and set during creation of browser process and its |
| + // lifetime is for the whole duration of the browser process - it is never |
| + // freed but this is fine since it will go away together with the browser |
|
Devlin
2017/04/11 15:06:22
I'm not quite sure I follow the "this is fine sinc
Ivan Šandrk
2017/04/11 15:11:16
You would summarize the whole "|delegate| is creat
Devlin
2017/04/11 15:15:02
Pretty much... suggested alternative:
// Sets a de
Ivan Šandrk
2017/04/12 13:57:47
Done.
|
| + // process. |
| + 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. |